Package net.minecraft.world.food
Class FoodData
java.lang.Object
net.minecraft.world.food.FoodData
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate float
private int
private int
private float
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
add
(int pFoodLevel, float pSaturationLevel) void
addAdditionalSaveData
(CompoundTag pCompoundTag) Writes the food data for the player.void
addExhaustion
(float pExhaustion) Adds input tofoodExhaustionLevel
to a max of 40.void
eat
(int pFoodLevelModifier, float pSaturationLevelModifier) Add food stats.void
eat
(FoodProperties pFoodProperties) float
int
int
float
boolean
void
readAdditionalSaveData
(CompoundTag pCompoundTag) Reads the food data for the player.void
setExhaustion
(float pExhaustionLevel) void
setFoodLevel
(int pFoodLevel) void
setSaturation
(float pSaturationLevel) void
Handles 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 tofoodExhaustionLevel
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)
-