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.FoodProperties;

Extending Record

Link to extending-record

FoodProperties extends Record. That means all methods available in Record are also available in FoodProperties

Name: create

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.create(nutrition as int, saturation as float, canAlwaysEat as boolean, eatSeconds as float) as FoodProperties
ParameterType
Parameter
nutrition
Type
int
Parameter
saturation
Type
float
Parameter
canAlwaysEat
Type
boolean
Parameter
eatSeconds
Type
float

Name: create

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.create(nutrition as int, saturation as float, canAlwaysEat as boolean, eatSeconds as float, effects as stdlib.List<FoodPropertiesPossibleEffect>) as FoodProperties
ParameterType
Parameter
nutrition
Type
int
Parameter
saturation
Type
float
Parameter
canAlwaysEat
Type
boolean
Parameter
eatSeconds
Type
float
Parameter
effects
Type
stdlib.List<FoodPropertiesPossibleEffect>

Link to withCanAlwaysEat

Name: withCanAlwaysEat

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.withCanAlwaysEat(canAlwaysEat as boolean) as FoodProperties
ParameterType
Parameter
canAlwaysEat
Type
boolean

Name: withEatSeconds

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.withEatSeconds(eatSeconds as int) as FoodProperties
ParameterType
Parameter
eatSeconds
Type
int

Name: withEffect

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.withEffect(effect as FoodPropertiesPossibleEffect) as FoodProperties
ParameterType
Parameter
effect
Type
FoodPropertiesPossibleEffect

Name: withEffect

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.withEffect(effect as MobEffectInstance, probability as float) as FoodProperties
ParameterType
Parameter
effect
Type
MobEffectInstance
Parameter
probability
Type
float

Name: withEffects

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.withEffects(effects as stdlib.List<FoodPropertiesPossibleEffect>) as FoodProperties
ParameterType
Parameter
effects
Type
stdlib.List<FoodPropertiesPossibleEffect>

Name: withNutrition

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.withNutrition(nutrition as int) as FoodProperties
ParameterType
Parameter
nutrition
Type
int

Name: withSaturation

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.withSaturation(saturation as float) as FoodProperties
ParameterType
Parameter
saturation
Type
float

Name: withoutEffect

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.withoutEffect(effect as FoodPropertiesPossibleEffect) as FoodProperties
ParameterType
Parameter
effect
Type
FoodPropertiesPossibleEffect

Name: withoutEffect

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.withoutEffect(effect as MobEffect) as FoodProperties
ParameterType
Parameter
effect
Type
MobEffect
NameTypeHas GetterHas Setter
Name
canAlwaysEat
Type
boolean
Has Getter
true
Has Setter
false
Name
eatSeconds
Type
float
Has Getter
true
Has Setter
false
Name
effects
Type
stdlib.List<FoodPropertiesPossibleEffect>
Has Getter
true
Has Setter
false
Name
nutrition
Type
int
Has Getter
true
Has Setter
false
Name
saturationModifier
Type
float
Has Getter
true
Has Setter
false