Импорт класса

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
Copy
import crafttweaker.api.food.FoodData;

Name: addExhaustion

ZenScript
Copy
FoodData.addExhaustion(exhaustion as float)
ПараметрТип
Параметр
exhaustion
Тип
float

Name: eat

ZenScript
Copy
FoodData.eat(stack as IItemStack)
ПараметрТип
Параметр
stack
Тип
IItemStack

Name: eat

ZenScript
Copy
FoodData.eat(foodLevelModifier as int, saturationLevelModifier as float)
ПараметрТип
Параметр
foodLevelModifier
Тип
int
Параметр
saturationLevelModifier
Тип
float

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

ZenScript
Copy
FoodData.setExhaustion(exhaustionLevel as float)
ПараметрТип
Параметр
exhaustionLevel
Тип
float

Name: setFoodLevel

ZenScript
Copy
FoodData.setFoodLevel(foodLevel as int)
ПараметрТип
Параметр
foodLevel
Тип
int

Name: setSaturation

ZenScript
Copy
FoodData.setSaturation(saturationLevel as float)
ПараметрТип
Параметр
saturationLevel
Тип
float