Class ItemFood

Direct Known Subclasses:
ItemChorusFruit, ItemFishCooked, ItemFishRaw, ItemFoodSeeds, ItemGoldenApple, ItemMilk, ItemPoisonousPotato, ItemRawChicken, ItemRottenFlesh, ItemSoup, ItemSpiderEye

public class ItemFood extends ItemTimedUsage
  • Constructor Details

    • ItemFood

      public ItemFood(int foodLevel, float saturation)
  • Method Details

    • getFoodLevel

      protected int getFoodLevel(org.bukkit.inventory.ItemStack stack)
    • getSaturation

      protected float getSaturation(org.bukkit.inventory.ItemStack stack)
    • handleEat

      protected boolean handleEat(GlowPlayer player, org.bukkit.inventory.ItemStack item)
    • eat

      public boolean eat(GlowPlayer player, org.bukkit.inventory.ItemStack item)
      Player attempts to eat this food.
      Parameters:
      player - the eating player
      item - the item stack eaten from
      Returns:
      whether food was eaten successfully
    • startUse

      public void startUse(GlowPlayer player, org.bukkit.inventory.ItemStack item)
      Overrides:
      startUse in class ItemTimedUsage
    • endUse

      public void endUse(GlowPlayer player, org.bukkit.inventory.ItemStack item)
      Overrides:
      endUse in class ItemTimedUsage