Class FoodData

java.lang.Object
net.minecraft.world.food.FoodData

public class FoodData extends Object
  • Field Details

    • foodLevel

      private int foodLevel
    • saturationLevel

      private float saturationLevel
    • exhaustionLevel

      private float exhaustionLevel
    • tickTimer

      private int tickTimer
    • lastFoodLevel

      private int lastFoodLevel
  • Constructor Details

    • FoodData

      public FoodData()
  • Method Details

    • add

      private void add(int foodLevel, float saturationLevel)
    • eat

      public void eat(int foodLevelModifier, float saturationLevelModifier)
      Add food stats.
    • eat

      public void eat(FoodProperties foodProperties)
    • tick

      public void tick(Player player)
      Handles the food game logic.
    • readAdditionalSaveData

      public void readAdditionalSaveData(CompoundTag compoundTag)
      Reads the food data for the player.
    • addAdditionalSaveData

      public void addAdditionalSaveData(CompoundTag compoundTag)
      Writes the food data for the player.
    • getFoodLevel

      public int getFoodLevel()
    • getLastFoodLevel

      public int getLastFoodLevel()
    • needsFood

      public boolean needsFood()
    • addExhaustion

      public void addExhaustion(float exhaustion)
      Adds input to foodExhaustionLevel to a max of 40.
    • getExhaustionLevel

      public float getExhaustionLevel()
    • getSaturationLevel

      public float getSaturationLevel()
    • setFoodLevel

      public void setFoodLevel(int foodLevel)
    • setSaturation

      public void setSaturation(float saturationLevel)
    • setExhaustion

      public void setExhaustion(float exhaustionLevel)