net.minecraft.item

## Class ItemFood

- java.lang.Object
- - net.minecraft.item.Item
  - - net.minecraft.item.ItemFood

- Direct Known Subclasses:
    ItemAppleGold, ItemSeedFood, ItemSoup

      public class ItemFood
      extends Item

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `itemUseDuration` Number of ticks to run while 'EnumAction'ing until result.

    - ### Fields inherited from class net.minecraft.item.Item

      `appleGold, appleRed, arrow, axeDiamond, axeGold, axeSteel, axeStone, axeWood, bakedPotato, bed, beefCooked, beefRaw, blazePowder, blazeRod, boat, bone, book, bootsChain, bootsDiamond, bootsGold, bootsLeather, bootsSteel, bow, bowlEmpty, bowlSoup, bread, brewingStand, brick, bucketEmpty, bucketLava, bucketMilk, bucketWater, cake, carrot, carrotOnAStick, cauldron, chickenCooked, chickenRaw, clay, coal, compass, cookie, diamond, doorSteel, doorWood, dyePowder, egg, emerald, emptyMap, enchantedBook, enderPearl, expBottle, eyeOfEnder, feather, fermentedSpiderEye, fireballCharge, firework, fireworkCharge, fishCooked, fishingRod, fishRaw, flint, flintAndSteel, flowerPot, ghastTear, glassBottle, goldenCarrot, goldNugget, gunpowder, helmetChain, helmetDiamond, helmetGold, helmetLeather, helmetSteel, hoeDiamond, hoeGold, hoeSteel, hoeStone, hoeWood, ingotGold, ingotIron, isDefaultTexture, itemFrame, itemID, itemsList, leather, legsChain, legsDiamond, legsGold, legsLeather, legsSteel, lightStoneDust, magmaCream, map, melon, melonSeeds, minecartCrate, minecartEmpty, minecartPowered, monsterPlacer, netherStalkSeeds, netherStar, painting, paper, pickaxeDiamond, pickaxeGold, pickaxeSteel, pickaxeStone, pickaxeWood, plateChain, plateDiamond, plateGold, plateLeather, plateSteel, pocketSundial, poisonousPotato, porkCooked, porkRaw, potato, potion, pumpkinPie, pumpkinSeeds, record11, record13, recordBlocks, recordCat, recordChirp, recordFar, recordMall, recordMellohi, recordStal, recordStrad, recordWait, recordWard, redstone, redstoneRepeater, reed, rottenFlesh, saddle, seeds, shears, shovelDiamond, shovelGold, shovelSteel, shovelStone, shovelWood, sign, silk, skull, slimeBall, snowball, speckledMelon, spiderEye, stick, sugar, swordDiamond, swordGold, swordSteel, swordStone, swordWood, wheat, writableBook, writtenBook`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ItemFood(int par1, int par2, boolean par3)`
    `ItemFood(int par1, int par2, float par3, boolean par4)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getHealAmount()`
    `EnumAction` | `getItemUseAction(ItemStack par1ItemStack)` returns the action that specifies what animation to play when the items is being used
    `int` | `getMaxItemUseDuration(ItemStack par1ItemStack)` How long it takes to use or consume an item
    `float` | `getSaturationModifier()` gets the saturationModifier of the ItemFood
    `boolean` | `isWolfsFavoriteMeat()` Whether wolves like this food (true for raw and cooked porkchop).
    `ItemStack` | `onFoodEaten(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)`
    `ItemStack` | `onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer)` Called whenever this item is equipped and the right mouse button is pressed.
    `ItemFood` | `setAlwaysEdible()` Set the field 'alwaysEdible' to true, and make the food edible even if the player don't need to eat.
    `ItemFood` | `setPotionEffect(int par1, int par2, int par3, float par4)` sets a potion effect on the item.

    - ### Methods inherited from class net.minecraft.item.Item

      `addInformation, canHarvestBlock, createEntity, doesContainerItemLeaveCraftingGrid, func_77653_i, func_82788_x, getChestGenBase, getColorFromItemStack, getContainerItem, getContainerItemStack, getCreativeTab, getCreativeTabs, getDamageVsEntity, getEntityLifespan, getHasSubtypes, getIconFromDamage, getIconFromDamageForRenderPass, getIconIndex, getIconIndex, getIconIndex, getIsRepairable, getItemDisplayName, getItemEnchantability, getItemName, getItemNameIS, getItemStackLimit, getLocalItemName, getMaxDamage, getMetadata, getPotionEffect, getPotionEffect, getRarity, getRenderPasses, getShareTag, getSmeltingExperience, getStatName, getStrVsBlock, getStrVsBlock, getSubItems, getTextureFile, hasContainerItem, hasCustomEntity, hasEffect, hitEntity, isDamageable, isFull3D, isItemTool, isMap, isPotionIngredient, isPotionIngredient, isRepairable, isValidArmor, itemInteractionForEntity, onArmorTickUpdate, onBlockDestroyed, onBlockStartBreak, onCreated, onDroppedByPlayer, onItemUse, onItemUseFirst, onLeftClickEntity, onPlayerStoppedUsing, onUpdate, onUsingItemTick, requiresMultipleRenderPasses, setContainerItem, setCreativeTab, setFull3D, setIconCoord, setIconIndex, setItemName, setMaxDamage, setMaxStackSize, setNoRepair, setTextureFile, shouldPassSneakingClickToBlock, shouldRotateAroundWhenRendering`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### itemUseDuration

          public final int itemUseDuration

      Number of ticks to run while 'EnumAction'ing until result.

  - ### Constructor Detail

    - #### ItemFood

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

    - #### ItemFood

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

  - ### Method Detail

    - #### onFoodEaten

          public ItemStack onFoodEaten(ItemStack par1ItemStack,
                              World par2World,
                              EntityPlayer par3EntityPlayer)

      Overrides:
        `onFoodEaten` in class `Item`

    - #### 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.