Class FoodData

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

public class FoodData extends Object
  • Field Details

    • DEFAULT_TICK_TIMER

      private static final int DEFAULT_TICK_TIMER
      See Also:
    • DEFAULT_EXHAUSTION_LEVEL

      private static final float DEFAULT_EXHAUSTION_LEVEL
      See Also:
    • foodLevel

      private int foodLevel
    • saturationLevel

      private float saturationLevel
    • exhaustionLevel

      private float exhaustionLevel
    • tickTimer

      private int tickTimer
  • 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(ServerPlayer pPlayer)
    • readAdditionalSaveData

      public void readAdditionalSaveData(ValueInput pInput)
    • addAdditionalSaveData

      public void addAdditionalSaveData(ValueOutput pOutput)
    • getFoodLevel

      public int getFoodLevel()
    • needsFood

      public boolean needsFood()
    • addExhaustion

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

      public float getSaturationLevel()
    • setFoodLevel

      public void setFoodLevel(int pFoodLevel)
    • setSaturation

      public void setSaturation(float pSaturationLevel)