Package net.minecraft.item
Class FoodItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.FoodItem
public class FoodItem extends Item
- Mappings:
Namespace Name official zsintermediary net/minecraft/class_2050named net/minecraft/item/FoodItem
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.item.Item
Item.ToolMaterialType -
Field Summary
Fields Modifier and Type Field Description private booleanalwaysEdibleprivate booleancookableprivate intdurationinteatingTimeprivate floateffectChanceprivate inthungerPointsprivate intmultiplierprivate floatsaturationprivate intstatusEffectIdFields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_UUID, damageable, handheld, maxCount, RANDOM, REGISTRY -
Constructor Summary
-
Method Summary
Modifier and Type Method Description FoodItemalwaysEdible()protected voideat(ItemStack stack, World world, PlayerEntity player)intgetHungerPoints(ItemStack stack)intgetMaxUseTime(ItemStack stack)floatgetSaturation(ItemStack stack)UseActiongetUseAction(ItemStack stack)Returns the UseAction for an item when the item is used.booleanisCokkable()ItemStackonFinishUse(ItemStack stack, World world, PlayerEntity player)ItemStackonStartUse(ItemStack stack, World world, PlayerEntity player)FoodItemsetStatusEffect(int id, int duration, int multiplier, float effectChance)Methods inherited from class net.minecraft.item.Item
appendItemStacks, appendTooltip, byRawId, canRepair, canUseOnEntity, fromBlock, getAttributeModifierMap, getDisplayColor, getDisplayName, getEnchantability, getFromId, getItemGroup, getItemstackTranslatedName, getMaxCount, getMaxDamage, getMeta, getMiningSpeedMultiplier, getRarity, getRawId, getRecipeRemainder, getStatusEffectString, getTranslationKey, getTranslationKey, hasEnchantmentGlint, hasStatusEffectString, hasSubTypes, inventoryTick, isDamageable, isEffectiveOn, isEnchantable, isFood, isHandheld, isNetworkSynced, isUnbreakable, onBlockBroken, onCraft, onEntityHit, onHit, onUseStopped, postProcessTag, registerBlockItem, setHandheld, setItemGroup, setMaxCount, setMaxDamage, setRecipeRemainder, setStatusEffectString, setTranslationKey, setUnbreakable, setup, shouldRotate, shouldSyncTagToClient, use
-
Field Details
-
eatingTime
public final int eatingTime- See Also:
- Constant Field Values
- Mappings:
Namespace Name Mixin selector official aLzs;a:Iintermediary field_8617Lnet/minecraft/class_2050;field_8617:Inamed eatingTimeLnet/minecraft/item/FoodItem;eatingTime:I
-
hungerPoints
private final int hungerPoints- Mappings:
Namespace Name Mixin selector official bLzs;b:Iintermediary field_8618Lnet/minecraft/class_2050;field_8618:Inamed hungerPointsLnet/minecraft/item/FoodItem;hungerPoints:I
-
saturation
private final float saturation- Mappings:
Namespace Name Mixin selector official cLzs;c:Fintermediary field_8619Lnet/minecraft/class_2050;field_8619:Fnamed saturationLnet/minecraft/item/FoodItem;saturation:F
-
cookable
private final boolean cookable- Mappings:
Namespace Name Mixin selector official dLzs;d:Zintermediary field_8620Lnet/minecraft/class_2050;field_8620:Znamed cookableLnet/minecraft/item/FoodItem;cookable:Z
-
alwaysEdible
private boolean alwaysEdible- Mappings:
Namespace Name Mixin selector official kLzs;k:Zintermediary field_8621Lnet/minecraft/class_2050;field_8621:Znamed alwaysEdibleLnet/minecraft/item/FoodItem;alwaysEdible:Z
-
statusEffectId
private int statusEffectId- Mappings:
Namespace Name Mixin selector official lLzs;l:Iintermediary field_8622Lnet/minecraft/class_2050;field_8622:Inamed statusEffectIdLnet/minecraft/item/FoodItem;statusEffectId:I
-
duration
private int duration- Mappings:
Namespace Name Mixin selector official mLzs;m:Iintermediary field_8623Lnet/minecraft/class_2050;field_8623:Inamed durationLnet/minecraft/item/FoodItem;duration:I
-
multiplier
private int multiplier- Mappings:
Namespace Name Mixin selector official nLzs;n:Iintermediary field_8624Lnet/minecraft/class_2050;field_8624:Inamed multiplierLnet/minecraft/item/FoodItem;multiplier:I
-
effectChance
private float effectChance- Mappings:
Namespace Name Mixin selector official oLzs;o:Fintermediary field_8625Lnet/minecraft/class_2050;field_8625:Fnamed effectChanceLnet/minecraft/item/FoodItem;effectChance:F
-
-
Constructor Details
-
FoodItem
public FoodItem(int hungerPoints, float saturation, boolean cookable)- Mappings:
Namespace Name Mixin selector official <init>Lzs;<init>(IFZ)Vintermediary <init>Lnet/minecraft/class_2050;<init>(IFZ)Vnamed <init>Lnet/minecraft/item/FoodItem;<init>(IFZ)V
-
FoodItem
public FoodItem(int hungerPoints, boolean cookable)- Mappings:
Namespace Name Mixin selector official <init>Lzs;<init>(IZ)Vintermediary <init>Lnet/minecraft/class_2050;<init>(IZ)Vnamed <init>Lnet/minecraft/item/FoodItem;<init>(IZ)V
-
-
Method Details
-
onFinishUse
- Overrides:
onFinishUsein classItem- Mappings:
Namespace Name Mixin selector official bLzw;b(Lzx;Ladm;Lwn;)Lzx;intermediary method_8273Lnet/minecraft/class_2054;method_8273(Lnet/minecraft/class_2056;Lnet/minecraft/class_99;Lnet/minecraft/class_1963;)Lnet/minecraft/class_2056;named onFinishUseLnet/minecraft/item/Item;onFinishUse(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;
-
eat
- Mappings:
Namespace Name Mixin selector official cLzs;c(Lzx;Ladm;Lwn;)Vintermediary method_8238Lnet/minecraft/class_2050;method_8238(Lnet/minecraft/class_2056;Lnet/minecraft/class_99;Lnet/minecraft/class_1963;)Vnamed eatLnet/minecraft/item/FoodItem;eat(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)V
-
getMaxUseTime
- Overrides:
getMaxUseTimein classItem- Mappings:
Namespace Name Mixin selector official dLzw;d(Lzx;)Iintermediary method_8281Lnet/minecraft/class_2054;method_8281(Lnet/minecraft/class_2056;)Inamed getMaxUseTimeLnet/minecraft/item/Item;getMaxUseTime(Lnet/minecraft/item/ItemStack;)I
-
getUseAction
Returns the UseAction for an item when the item is used. Used by food, potions, bows, etc.- Overrides:
getUseActionin classItem- Parameters:
stack- The ItemStack that was used- See Also:
BowItem,PotionItem- Mappings:
Namespace Name Mixin selector official eLzw;e(Lzx;)Laba;intermediary method_8285Lnet/minecraft/class_2054;method_8285(Lnet/minecraft/class_2056;)Lnet/minecraft/class_30;named getUseActionLnet/minecraft/item/Item;getUseAction(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/UseAction;
-
onStartUse
- Overrides:
onStartUsein classItem- Mappings:
Namespace Name Mixin selector official aLzw;a(Lzx;Ladm;Lwn;)Lzx;intermediary method_8260Lnet/minecraft/class_2054;method_8260(Lnet/minecraft/class_2056;Lnet/minecraft/class_99;Lnet/minecraft/class_1963;)Lnet/minecraft/class_2056;named onStartUseLnet/minecraft/item/Item;onStartUse(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;
-
getHungerPoints
- Mappings:
Namespace Name Mixin selector official hLzs;h(Lzx;)Iintermediary method_8241Lnet/minecraft/class_2050;method_8241(Lnet/minecraft/class_2056;)Inamed getHungerPointsLnet/minecraft/item/FoodItem;getHungerPoints(Lnet/minecraft/item/ItemStack;)I
-
getSaturation
- Mappings:
Namespace Name Mixin selector official iLzs;i(Lzx;)Fintermediary method_8242Lnet/minecraft/class_2050;method_8242(Lnet/minecraft/class_2056;)Fnamed getSaturationLnet/minecraft/item/FoodItem;getSaturation(Lnet/minecraft/item/ItemStack;)F
-
isCokkable
public boolean isCokkable()- Mappings:
Namespace Name Mixin selector official gLzs;g()Zintermediary method_8239Lnet/minecraft/class_2050;method_8239()Znamed isCokkableLnet/minecraft/item/FoodItem;isCokkable()Z
-
setStatusEffect
- Mappings:
Namespace Name Mixin selector official aLzs;a(IIIF)Lzs;intermediary method_8237Lnet/minecraft/class_2050;method_8237(IIIF)Lnet/minecraft/class_2050;named setStatusEffectLnet/minecraft/item/FoodItem;setStatusEffect(IIIF)Lnet/minecraft/item/FoodItem;
-
alwaysEdible
- Mappings:
Namespace Name Mixin selector official hLzs;h()Lzs;intermediary method_8240Lnet/minecraft/class_2050;method_8240()Lnet/minecraft/class_2050;named alwaysEdibleLnet/minecraft/item/FoodItem;alwaysEdible()Lnet/minecraft/item/FoodItem;
-