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 pFoodLevel, float pSaturationLevel)
    • eat

      public void eat(int pFoodLevelModifier, float pSaturationLevelModifier)
      Add food stats.
    • eat

      public void eat(FoodProperties pFoodProperties)
    • tick

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

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

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

      public int getFoodLevel()
    • getLastFoodLevel

      public int getLastFoodLevel()
    • needsFood

      public boolean needsFood()
    • addExhaustion

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

      public float getExhaustionLevel()
    • getSaturationLevel

      public float getSaturationLevel()
    • setFoodLevel

      public void setFoodLevel(int pFoodLevel)
    • setSaturation

      public void setSaturation(float pSaturationLevel)
    • setExhaustion

      public void setExhaustion(float pExhaustionLevel)