Package net.minecraft.world.food
Class FoodData
java.lang.Object
net.minecraft.world.food.FoodData
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate floatprivate intprivate intprivate floatprivate int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidadd(int foodLevel, float saturationLevel) voidaddAdditionalSaveData(CompoundTag compoundTag) Writes the food data for the player.voidaddExhaustion(float exhaustion) Adds input tofoodExhaustionLevelto a max of 40.voideat(int foodLevelModifier, float saturationLevelModifier) Add food stats.voideat(FoodProperties foodProperties) floatintintfloatbooleanvoidreadAdditionalSaveData(CompoundTag compoundTag) Reads the food data for the player.voidsetExhaustion(float exhaustionLevel) voidsetFoodLevel(int foodLevel) voidsetSaturation(float saturationLevel) voidHandles the food game logic.
-
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
-
tick
Handles the food game logic. -
readAdditionalSaveData
Reads the food data for the player. -
addAdditionalSaveData
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 tofoodExhaustionLevelto 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)
-