Class FoodItem

java.lang.Object
net.minecraft.item.Item
net.minecraft.item.FoodItem
Direct Known Subclasses:
AppleItem, CropItem, FishItem, StewItem

public class FoodItem
extends Item
Mappings:
Namespace Name
official zs
intermediary net/minecraft/class_2050
named net/minecraft/item/FoodItem
  • Field Details

    • eatingTime

      public final int eatingTime
      See Also:
      Constant Field Values
      Mappings:
      Namespace Name Mixin selector
      official a Lzs;a:I
      intermediary field_8617 Lnet/minecraft/class_2050;field_8617:I
      named eatingTime Lnet/minecraft/item/FoodItem;eatingTime:I
    • hungerPoints

      private final int hungerPoints
      Mappings:
      Namespace Name Mixin selector
      official b Lzs;b:I
      intermediary field_8618 Lnet/minecraft/class_2050;field_8618:I
      named hungerPoints Lnet/minecraft/item/FoodItem;hungerPoints:I
    • saturation

      private final float saturation
      Mappings:
      Namespace Name Mixin selector
      official c Lzs;c:F
      intermediary field_8619 Lnet/minecraft/class_2050;field_8619:F
      named saturation Lnet/minecraft/item/FoodItem;saturation:F
    • cookable

      private final boolean cookable
      Mappings:
      Namespace Name Mixin selector
      official d Lzs;d:Z
      intermediary field_8620 Lnet/minecraft/class_2050;field_8620:Z
      named cookable Lnet/minecraft/item/FoodItem;cookable:Z
    • alwaysEdible

      private boolean alwaysEdible
      Mappings:
      Namespace Name Mixin selector
      official k Lzs;k:Z
      intermediary field_8621 Lnet/minecraft/class_2050;field_8621:Z
      named alwaysEdible Lnet/minecraft/item/FoodItem;alwaysEdible:Z
    • statusEffectId

      private int statusEffectId
      Mappings:
      Namespace Name Mixin selector
      official l Lzs;l:I
      intermediary field_8622 Lnet/minecraft/class_2050;field_8622:I
      named statusEffectId Lnet/minecraft/item/FoodItem;statusEffectId:I
    • duration

      private int duration
      Mappings:
      Namespace Name Mixin selector
      official m Lzs;m:I
      intermediary field_8623 Lnet/minecraft/class_2050;field_8623:I
      named duration Lnet/minecraft/item/FoodItem;duration:I
    • multiplier

      private int multiplier
      Mappings:
      Namespace Name Mixin selector
      official n Lzs;n:I
      intermediary field_8624 Lnet/minecraft/class_2050;field_8624:I
      named multiplier Lnet/minecraft/item/FoodItem;multiplier:I
    • effectChance

      private float effectChance
      Mappings:
      Namespace Name Mixin selector
      official o Lzs;o:F
      intermediary field_8625 Lnet/minecraft/class_2050;field_8625:F
      named effectChance Lnet/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)V
      intermediary <init> Lnet/minecraft/class_2050;<init>(IFZ)V
      named <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)V
      intermediary <init> Lnet/minecraft/class_2050;<init>(IZ)V
      named <init> Lnet/minecraft/item/FoodItem;<init>(IZ)V
  • Method Details

    • onFinishUse

      public ItemStack onFinishUse​(ItemStack stack, World world, PlayerEntity player)
      Overrides:
      onFinishUse in class Item
      Mappings:
      Namespace Name Mixin selector
      official b Lzw;b(Lzx;Ladm;Lwn;)Lzx;
      intermediary method_8273 Lnet/minecraft/class_2054;method_8273(Lnet/minecraft/class_2056;Lnet/minecraft/class_99;Lnet/minecraft/class_1963;)Lnet/minecraft/class_2056;
      named onFinishUse Lnet/minecraft/item/Item;onFinishUse(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;
    • eat

      protected void eat​(ItemStack stack, World world, PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      official c Lzs;c(Lzx;Ladm;Lwn;)V
      intermediary method_8238 Lnet/minecraft/class_2050;method_8238(Lnet/minecraft/class_2056;Lnet/minecraft/class_99;Lnet/minecraft/class_1963;)V
      named eat Lnet/minecraft/item/FoodItem;eat(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)V
    • getMaxUseTime

      public int getMaxUseTime​(ItemStack stack)
      Overrides:
      getMaxUseTime in class Item
      Mappings:
      Namespace Name Mixin selector
      official d Lzw;d(Lzx;)I
      intermediary method_8281 Lnet/minecraft/class_2054;method_8281(Lnet/minecraft/class_2056;)I
      named getMaxUseTime Lnet/minecraft/item/Item;getMaxUseTime(Lnet/minecraft/item/ItemStack;)I
    • getUseAction

      public UseAction getUseAction​(ItemStack stack)
      Returns the UseAction for an item when the item is used. Used by food, potions, bows, etc.
      Overrides:
      getUseAction in class Item
      Parameters:
      stack - The ItemStack that was used
      See Also:
      BowItem, PotionItem
      Mappings:
      Namespace Name Mixin selector
      official e Lzw;e(Lzx;)Laba;
      intermediary method_8285 Lnet/minecraft/class_2054;method_8285(Lnet/minecraft/class_2056;)Lnet/minecraft/class_30;
      named getUseAction Lnet/minecraft/item/Item;getUseAction(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/util/UseAction;
    • onStartUse

      public ItemStack onStartUse​(ItemStack stack, World world, PlayerEntity player)
      Overrides:
      onStartUse in class Item
      Mappings:
      Namespace Name Mixin selector
      official a Lzw;a(Lzx;Ladm;Lwn;)Lzx;
      intermediary method_8260 Lnet/minecraft/class_2054;method_8260(Lnet/minecraft/class_2056;Lnet/minecraft/class_99;Lnet/minecraft/class_1963;)Lnet/minecraft/class_2056;
      named onStartUse Lnet/minecraft/item/Item;onStartUse(Lnet/minecraft/item/ItemStack;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/ItemStack;
    • getHungerPoints

      public int getHungerPoints​(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official h Lzs;h(Lzx;)I
      intermediary method_8241 Lnet/minecraft/class_2050;method_8241(Lnet/minecraft/class_2056;)I
      named getHungerPoints Lnet/minecraft/item/FoodItem;getHungerPoints(Lnet/minecraft/item/ItemStack;)I
    • getSaturation

      public float getSaturation​(ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official i Lzs;i(Lzx;)F
      intermediary method_8242 Lnet/minecraft/class_2050;method_8242(Lnet/minecraft/class_2056;)F
      named getSaturation Lnet/minecraft/item/FoodItem;getSaturation(Lnet/minecraft/item/ItemStack;)F
    • isCokkable

      public boolean isCokkable()
      Mappings:
      Namespace Name Mixin selector
      official g Lzs;g()Z
      intermediary method_8239 Lnet/minecraft/class_2050;method_8239()Z
      named isCokkable Lnet/minecraft/item/FoodItem;isCokkable()Z
    • setStatusEffect

      public FoodItem setStatusEffect​(int id, int duration, int multiplier, float effectChance)
      Mappings:
      Namespace Name Mixin selector
      official a Lzs;a(IIIF)Lzs;
      intermediary method_8237 Lnet/minecraft/class_2050;method_8237(IIIF)Lnet/minecraft/class_2050;
      named setStatusEffect Lnet/minecraft/item/FoodItem;setStatusEffect(IIIF)Lnet/minecraft/item/FoodItem;
    • alwaysEdible

      public FoodItem alwaysEdible()
      Mappings:
      Namespace Name Mixin selector
      official h Lzs;h()Lzs;
      intermediary method_8240 Lnet/minecraft/class_2050;method_8240()Lnet/minecraft/class_2050;
      named alwaysEdible Lnet/minecraft/item/FoodItem;alwaysEdible()Lnet/minecraft/item/FoodItem;