FoodData
Link to fooddata
导入类
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 at the very top of the file.
ZenScript Copyimport crafttweaker.api.food.FoodData;
使用方式
Link to 使用方式
Name: addExhaustion
ZenScript CopyFoodData.addExhaustion(exhaustion as float)
参数 | 类型 |
---|---|
参数 exhaustion | 类型 float |
Name: eat
ZenScript CopyFoodData.eat(foodLevelModifier as int, saturationLevelModifier as float)
参数 | 类型 |
---|---|
参数 foodLevelModifier | 类型 int |
参数 saturationLevelModifier | 类型 float |
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();
Name: getLastFoodLevel
Return Type: int
ZenScript Copy// FoodData.getLastFoodLevel() as int
myFoodData.getLastFoodLevel();
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
ZenScript CopyFoodData.setExhaustion(exhaustionLevel as float)
参数 | 类型 |
---|---|
参数 exhaustionLevel | 类型 float |
Name: setFoodLevel
ZenScript CopyFoodData.setFoodLevel(foodLevel as int)
参数 | 类型 |
---|---|
参数 foodLevel | 类型 int |
Name: setSaturation
ZenScript CopyFoodData.setSaturation(saturationLevel as float)
参数 | 类型 |
---|---|
参数 saturationLevel | 类型 float |