FoodData
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.
import crafttweaker.api.food.FoodData;Methods
Return Type: void
FoodData.addExhaustion(exhaustion as float) as void| Parameter | Type | Description |
|---|---|---|
Parameter exhaustion | Type float | Description No Description Provided |
Return Type: void
FoodData.eat(stack as IItemStack) as void| Parameter | Type | Description |
|---|---|---|
Parameter stack | Type IItemStack | Description No Description Provided |
Return Type: void
FoodData.eat(foodLevelModifier as int, saturationLevelModifier as float) as void| Parameter | Type | Description |
|---|---|---|
Parameter foodLevelModifier | Type int | Description No Description Provided |
Parameter saturationLevelModifier | Type float | Description No Description Provided |
Return Type: float
// FoodData.getExhaustionLevel() as float
myFoodData.getExhaustionLevel();Return Type: int
// FoodData.getFoodLevel() as int
myFoodData.getFoodLevel();Return Type: int
// FoodData.getLastFoodLevel() as int
myFoodData.getLastFoodLevel();Return Type: float
// FoodData.getSaturationLevel() as float
myFoodData.getSaturationLevel();Return Type: boolean
// FoodData.needsFood() as boolean
myFoodData.needsFood();Return Type: void
FoodData.setExhaustion(exhaustionLevel as float) as void| Parameter | Type | Description |
|---|---|---|
Parameter exhaustionLevel | Type float | Description No Description Provided |
Return Type: void
FoodData.setFoodLevel(foodLevel as int) as void| Parameter | Type | Description |
|---|---|---|
Parameter foodLevel | Type int | Description No Description Provided |
Return Type: void
FoodData.setSaturation(saturationLevel as float) as void| Parameter | Type | Description |
|---|---|---|
Parameter saturationLevel | Type float | Description No Description Provided |