Class ItemFood

java.lang.Object
net.minecraft.src.Item
net.minecraft.src.ItemFood
Direct Known Subclasses:
CookedMysteryMeatItem, CookedWolfChopItem, FoodItem, HardBoiledEggItem, ItemAppleGold, ItemSeedFood, ItemSoup, MushroomSoupItem, SeedFoodItem

public class ItemFood extends Item
  • Field Details

    • itemUseDuration

      public final int itemUseDuration
      Number of ticks to run while 'EnumAction'ing until result.
  • Constructor Details

    • ItemFood

      public ItemFood(int par1, int par2, float par3, boolean par4)
    • ItemFood

      public ItemFood(int par1, int par2, boolean par3)
    • ItemFood

      public ItemFood(int iItemID, int iHealAmount, float fSaturationModifier, boolean bWolfsFavoriteMeat, boolean bZombiesConsume)
  • Method Details

    • onEaten

      public ItemStack onEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
      Overrides:
      onEaten in class Item
    • onFoodEaten

      protected void onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
    • getMaxItemUseDuration

      public int getMaxItemUseDuration(ItemStack par1ItemStack)
      How long it takes to use or consume an item
      Overrides:
      getMaxItemUseDuration in class Item
    • getItemUseAction

      public EnumAction getItemUseAction(ItemStack par1ItemStack)
      returns the action that specifies what animation to play when the items is being used
      Overrides:
      getItemUseAction in class Item
    • onItemRightClick

      public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)
      Called whenever this item is equipped and the right mouse button is pressed. Args: itemStack, world, entityPlayer
      Overrides:
      onItemRightClick in class Item
    • getHealAmount

      public int getHealAmount()
    • getSaturationModifier

      public float getSaturationModifier()
      gets the saturationModifier of the ItemFood
    • isWolfsFavoriteMeat

      public boolean isWolfsFavoriteMeat()
      Whether wolves like this food (true for raw and cooked porkchop).
    • setPotionEffect

      public ItemFood setPotionEffect(int par1, int par2, int par3, float par4)
      sets a potion effect on the item. Args: int potionId, int duration (will be multiplied by 20), int amplifier, float probability of effect happening
    • setAlwaysEdible

      public ItemFood setAlwaysEdible()
      Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat.
    • doZombiesConsume

      public boolean doZombiesConsume()
      Overrides:
      doZombiesConsume in class Item
    • isMultiUsePerClick

      public boolean isMultiUsePerClick()
      Overrides:
      isMultiUsePerClick in class Item
    • isWolfFood

      public boolean isWolfFood()
      Overrides:
      isWolfFood in class Item
    • getWolfHealAmount

      public int getWolfHealAmount()
      Overrides:
      getWolfHealAmount in class Item
    • getHungerRestored

      public int getHungerRestored()