Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

FoodData

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.food.FoodData;

Members

addExhaustion(exhaustion as float)
script.zs
// FoodData.addExhaustion(exhaustion as float);
myFoodData.addExhaustion(myFloat);

Parameters:

exhaustion Type: float
eat(foodLevelModifier as int, saturationLevelModifier as float)
script.zs
// FoodData.eat(foodLevelModifier as int, saturationLevelModifier as float);
myFoodData.eat(myInt, myFloat);

Parameters:

foodLevelModifier Type: int
saturationLevelModifier Type: float
eat(stack as IItemStack)
script.zs
// FoodData.eat(stack as IItemStack);
myFoodData.eat(myIItemStack);

Parameters:

stack Type: IItemStack
getExhaustionLevel() as float
script.zs
// FoodData.getExhaustionLevel() as float;
myFoodData.getExhaustionLevel();

Return Type: float

getFoodLevel() as int
script.zs
// FoodData.getFoodLevel() as int;
myFoodData.getFoodLevel();

Return Type: int

getLastFoodLevel() as int
script.zs
// FoodData.getLastFoodLevel() as int;
myFoodData.getLastFoodLevel();

Return Type: int

getSaturationLevel() as float
script.zs
// FoodData.getSaturationLevel() as float;
myFoodData.getSaturationLevel();

Return Type: float

needsFood() as bool
script.zs
// FoodData.needsFood() as bool;
myFoodData.needsFood();

Return Type: bool

setExhaustion(exhaustionLevel as float)
script.zs
// FoodData.setExhaustion(exhaustionLevel as float);
myFoodData.setExhaustion(myFloat);

Parameters:

exhaustionLevel Type: float
setFoodLevel(foodLevel as int)
script.zs
// FoodData.setFoodLevel(foodLevel as int);
myFoodData.setFoodLevel(myInt);

Parameters:

foodLevel Type: int
setSaturation(saturationLevel as float)
script.zs
// FoodData.setSaturation(saturationLevel as float);
myFoodData.setSaturation(myFloat);

Parameters:

saturationLevel Type: float