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 pFoodLevel, float pSaturationLevel) voidaddAdditionalSaveData(CompoundTag pCompoundTag) Writes the food data for the player.voidaddExhaustion(float pExhaustion) Adds input tofoodExhaustionLevelto a max of 40.voideat(int pFoodLevelModifier, float pSaturationLevelModifier) Add food stats.voideat(FoodProperties pFoodProperties) floatintintfloatbooleanvoidreadAdditionalSaveData(CompoundTag pCompoundTag) Reads the food data for the player.voidsetExhaustion(float pExhaustionLevel) voidsetFoodLevel(int pFoodLevel) voidsetSaturation(float pSaturationLevel) 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 pFoodLevel, float pSaturationLevel) -
eat
public void eat(int pFoodLevelModifier, float pSaturationLevelModifier) 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 pExhaustion) Adds input tofoodExhaustionLevelto 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)
-