IFoodStats
Link to ifoodstats
The IPlayer interface allows you to view certain information on a player's food Stats.
导入相关包
Link to 导入相关包
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import.
import crafttweaker.player.IFoodStats;
ZenGetter/ZenSetters
Link to zengetterzensetters
ZenGetter | ZenSetter | 类型 |
---|---|---|
ZenGetter foodLevel | ZenSetter foodLevel | 类型 int |
ZenGetter saturationLevel | ZenSetter saturationLevel | 类型 float |
ZenGetter needFood | ZenSetter | 类型 布尔值 |
ZenMethods
Link to zenmethods
Adding Stats
Link to adding-stats
Void Function. Takes an int and a float as intput parameters.
ZenScript Copystats.addStats(int foodValue, float saturationLevel);
onUpdate
Link to onupdate
Void Function. Takes an IPlayer object as input parameter.
ZenScript Copystats.onUpdate(IPlayer player);
asNBT
Link to asnbt
Returns an IData Object representing the foodStats.
ZenScript Copystats.asNBT();
stats as crafttweaker.data.IData;
Add Exhaustion
Link to add-exhaustion
Void Funtion. takes a float as input parameter.
ZenScript Copystats.addExhaustion(float exhaustion);