Package net.minecraft.item
Class FoodItem
java.lang.Object
net.minecraft.item.Item
net.minecraft.item.FoodItem
- Mappings:
Namespace Name official allintermediary net/minecraft/class_1065named net/minecraft/item/FoodItem
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate final booleanprivate intfinal intprivate floatprivate final intprivate intprivate final floatprivate intFields inherited from class net.minecraft.item.Item
ATTACK_DAMAGE_MODIFIER_UUID, damageable, handheld, maxCount, RANDOM, REGISTRY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voideat(ItemStack stack, World world, PlayerEntity player) intgetHungerPoints(ItemStack stack) intgetMaxUseTime(ItemStack stack) floatgetSaturation(ItemStack stack) getUseAction(ItemStack stack) Returns the UseAction for an item when the item is used.booleanonFinishUse(ItemStack stack, World world, PlayerEntity player) onStartUse(ItemStack stack, World world, PlayerEntity player) setStatusEffect(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, postProcessNbt, registerBlockItem, setHandheld, setItemGroup, setMaxCount, setMaxDamage, setRecipeRemainder, setStatusEffectString, setTranslationKey, setUnbreakable, setup, shouldRotate, shouldSyncNbtToClient, use
-
Field Details
-
eatingTime
public final int eatingTime- See Also:
- Mappings:
Namespace Name Mixin selector official aLall;a:Iintermediary field_4198Lnet/minecraft/class_1065;field_4198:Inamed eatingTimeLnet/minecraft/item/FoodItem;eatingTime:I
-
hungerPoints
private final int hungerPoints- Mappings:
Namespace Name Mixin selector official bLall;b:Iintermediary field_4199Lnet/minecraft/class_1065;field_4199:Inamed hungerPointsLnet/minecraft/item/FoodItem;hungerPoints:I
-
saturation
private final float saturation- Mappings:
Namespace Name Mixin selector official cLall;c:Fintermediary field_4202Lnet/minecraft/class_1065;field_4202:Fnamed saturationLnet/minecraft/item/FoodItem;saturation:F
-
cookable
private final boolean cookable- Mappings:
Namespace Name Mixin selector official dLall;d:Zintermediary field_4200Lnet/minecraft/class_1065;field_4200:Znamed cookableLnet/minecraft/item/FoodItem;cookable:Z
-
alwaysEdible
private boolean alwaysEdible- Mappings:
Namespace Name Mixin selector official kLall;k:Zintermediary field_4201Lnet/minecraft/class_1065;field_4201:Znamed alwaysEdibleLnet/minecraft/item/FoodItem;alwaysEdible:Z
-
statusEffectId
private int statusEffectId- Mappings:
Namespace Name Mixin selector official lLall;l:Iintermediary field_4203Lnet/minecraft/class_1065;field_4203:Inamed statusEffectIdLnet/minecraft/item/FoodItem;statusEffectId:I
-
duration
private int duration- Mappings:
Namespace Name Mixin selector official mLall;m:Iintermediary field_4204Lnet/minecraft/class_1065;field_4204:Inamed durationLnet/minecraft/item/FoodItem;duration:I
-
multiplier
private int multiplier- Mappings:
Namespace Name Mixin selector official nLall;n:Iintermediary field_4205Lnet/minecraft/class_1065;field_4205:Inamed multiplierLnet/minecraft/item/FoodItem;multiplier:I
-
effectChance
private float effectChance- Mappings:
Namespace Name Mixin selector official oLall;o:Fintermediary field_4206Lnet/minecraft/class_1065;field_4206: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>Lall;<init>(IFZ)Vintermediary <init>Lnet/minecraft/class_1065;<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>Lall;<init>(IZ)Vintermediary <init>Lnet/minecraft/class_1065;<init>(IZ)Vnamed <init>Lnet/minecraft/item/FoodItem;<init>(IZ)V
-
-
Method Details
-
onFinishUse
- Overrides:
onFinishUsein classItem- Mappings:
Namespace Name Mixin selector official bLalq;b(Lamj;Laqu;Lahd;)Lamj;intermediary method_3367Lnet/minecraft/class_1069;method_3367(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_988;)Lnet/minecraft/class_1071;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 cLall;c(Lamj;Laqu;Lahd;)Vintermediary method_3336Lnet/minecraft/class_1065;method_3336(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_988;)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 dLalq;d(Lamj;)Iintermediary method_3350Lnet/minecraft/class_1069;method_3350(Lnet/minecraft/class_1071;)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:
- Mappings:
Namespace Name Mixin selector official eLalq;e(Lamj;)Lano;intermediary method_3366Lnet/minecraft/class_1069;method_3366(Lnet/minecraft/class_1071;)Lnet/minecraft/class_1099;named getUseActionLnet/minecraft/item/Item;getUseAction(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/UseAction;
-
onStartUse
- Overrides:
onStartUsein classItem- Mappings:
Namespace Name Mixin selector official aLalq;a(Lamj;Laqu;Lahd;)Lamj;intermediary method_3358Lnet/minecraft/class_1069;method_3358(Lnet/minecraft/class_1071;Lnet/minecraft/class_1150;Lnet/minecraft/class_988;)Lnet/minecraft/class_1071;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 hLall;h(Lamj;)Iintermediary method_6360Lnet/minecraft/class_1065;method_6360(Lnet/minecraft/class_1071;)Inamed getHungerPointsLnet/minecraft/item/FoodItem;getHungerPoints(Lnet/minecraft/item/ItemStack;)I
-
getSaturation
- Mappings:
Namespace Name Mixin selector official iLall;i(Lamj;)Fintermediary method_6361Lnet/minecraft/class_1065;method_6361(Lnet/minecraft/class_1071;)Fnamed getSaturationLnet/minecraft/item/FoodItem;getSaturation(Lnet/minecraft/item/ItemStack;)F
-
isCokkable
public boolean isCokkable()- Mappings:
Namespace Name Mixin selector official gLall;g()Zintermediary method_3339Lnet/minecraft/class_1065;method_3339()Znamed isCokkableLnet/minecraft/item/FoodItem;isCokkable()Z
-
setStatusEffect
- Mappings:
Namespace Name Mixin selector official aLall;a(IIIF)Lall;intermediary method_3335Lnet/minecraft/class_1065;method_3335(IIIF)Lnet/minecraft/class_1065;named setStatusEffectLnet/minecraft/item/FoodItem;setStatusEffect(IIIF)Lnet/minecraft/item/FoodItem;
-
alwaysEdible
- Mappings:
Namespace Name Mixin selector official hLall;h()Lall;intermediary method_3340Lnet/minecraft/class_1065;method_3340()Lnet/minecraft/class_1065;named alwaysEdibleLnet/minecraft/item/FoodItem;alwaysEdible()Lnet/minecraft/item/FoodItem;
-