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 at the very top of the file.

ZenScript
Copy
import crafttweaker.api.food.FoodData;

Name: addExhaustion

Return Type: void

ZenScript
Copy
FoodData.addExhaustion(exhaustion as float) as void
参数类型描述
参数
exhaustion
类型
浮点数
描述
No Description Provided

Name: eat

Return Type: void

ZenScript
Copy
FoodData.eat(stack as IItemStack) as void
参数类型描述
参数
堆叠
类型
IItemStack
描述
No Description Provided

Name: eat

Return Type: void

ZenScript
Copy
FoodData.eat(foodLevelModifier as int, saturationLevelModifier as float) as void
参数类型描述
参数
foodLevelModifier
类型
int
描述
No Description Provided
参数
saturationLevelModifier
类型
浮点数
描述
No Description Provided

Link to getExhaustionLevel

Name: getExhaustionLevel

Return Type: float

ZenScript
Copy
// FoodData.getExhaustionLevel() as float

myFoodData.getExhaustionLevel();

Name: getFoodLevel

Return Type: int

ZenScript
Copy
// FoodData.getFoodLevel() as int

myFoodData.getFoodLevel();

Link to getLastFoodLevel

Name: getLastFoodLevel

Return Type: int

ZenScript
Copy
// FoodData.getLastFoodLevel() as int

myFoodData.getLastFoodLevel();

Link to getSaturationLevel

Name: getSaturationLevel

Return Type: float

ZenScript
Copy
// FoodData.getSaturationLevel() as float

myFoodData.getSaturationLevel();

Name: needsFood

Return Type: boolean

ZenScript
Copy
// FoodData.needsFood() as boolean

myFoodData.needsFood();

Name: setExhaustion

Return Type: void

ZenScript
Copy
FoodData.setExhaustion(exhaustionLevel as float) as void
参数类型描述
参数
exhaustionLevel
类型
浮点数
描述
No Description Provided

Name: setFoodLevel

Return Type: void

ZenScript
Copy
FoodData.setFoodLevel(foodLevel as int) as void
参数类型描述
参数
foodLevel
类型
int
描述
No Description Provided

Name: setSaturation

Return Type: void

ZenScript
Copy
FoodData.setSaturation(saturationLevel as float) as void
参数类型描述
参数
saturationLevel
类型
浮点数
描述
No Description Provided