Importing the class

Link to importing-the-class

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;

Link to g-

Name: addExhaustion

Return Type: void

ZenScript
Copy
FoodData.addExhaustion(exhaustion as float) as void
ParameterTypeDescription
Parameter
exhaustion
Type
float
Description
No Description Provided

Name: eat

Return Type: void

ZenScript
Copy
FoodData.eat(stack as IItemStack) as void
ParameterTypeDescription
Parameter
stack
Type
IItemStack
Description
No Description Provided

Name: eat

Return Type: void

ZenScript
Copy
FoodData.eat(foodLevelModifier as int, saturationLevelModifier as float) as void
ParameterTypeDescription
Parameter
foodLevelModifier
Type
int
Description
No Description Provided
Parameter
saturationLevelModifier
Type
float
Description
No Description Provided

Link to g--3

Name: getExhaustionLevel

Return Type: float

ZenScript
Copy
// FoodData.getExhaustionLevel() as float

myFoodData.getExhaustionLevel();

Link to g--4

Name: getFoodLevel

Return Type: int

ZenScript
Copy
// FoodData.getFoodLevel() as int

myFoodData.getFoodLevel();

Link to g--5

Name: getLastFoodLevel

Return Type: int

ZenScript
Copy
// FoodData.getLastFoodLevel() as int

myFoodData.getLastFoodLevel();

Link to g--6

Name: getSaturationLevel

Return Type: float

ZenScript
Copy
// FoodData.getSaturationLevel() as float

myFoodData.getSaturationLevel();

Link to g--7

Name: needsFood

Return Type: boolean

ZenScript
Copy
// FoodData.needsFood() as boolean

myFoodData.needsFood();

Link to g--8

Name: setExhaustion

Return Type: void

ZenScript
Copy
FoodData.setExhaustion(exhaustionLevel as float) as void
ParameterTypeDescription
Parameter
exhaustionLevel
Type
float
Description
No Description Provided

Link to g--9

Name: setFoodLevel

Return Type: void

ZenScript
Copy
FoodData.setFoodLevel(foodLevel as int) as void
ParameterTypeDescription
Parameter
foodLevel
Type
int
Description
No Description Provided

Link to g--10

Name: setSaturation

Return Type: void

ZenScript
Copy
FoodData.setSaturation(saturationLevel as float) as void
ParameterTypeDescription
Parameter
saturationLevel
Type
float
Description
No Description Provided