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

FoodProperties

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

Members

Getter
script.zs
// FoodProperties.canAlwaysEat as bool
myFoodProperties.canAlwaysEat

Return Type: bool

static create(nutrition as int, saturation as float, canAlwaysEat as bool, eatSeconds as float) as FoodProperties
script.zs
// FoodProperties.create(nutrition as int, saturation as float, canAlwaysEat as bool, eatSeconds as float) as FoodProperties;
FoodProperties.create(myInt, myFloat, myBool, myFloat);

Parameters:

nutrition Type: int
saturation Type: float
canAlwaysEat Type: bool
eatSeconds Type: float

Return Type: FoodProperties

static create(nutrition as int, saturation as float, canAlwaysEat as bool, eatSeconds as float, usingConvertsTo as IItemStack) as FoodProperties
script.zs
// FoodProperties.create(nutrition as int, saturation as float, canAlwaysEat as bool, eatSeconds as float, usingConvertsTo as IItemStack) as FoodProperties;
FoodProperties.create(myInt, myFloat, myBool, myFloat, myIItemStack);

Parameters:

nutrition Type: int
saturation Type: float
canAlwaysEat Type: bool
eatSeconds Type: float
usingConvertsTo Type: IItemStack

Return Type: FoodProperties

static create(nutrition as int, saturation as float, canAlwaysEat as bool, eatSeconds as float, usingConvertsTo as IItemStack, effects as List<PossibleEffect>) as FoodProperties
script.zs
// FoodProperties.create(nutrition as int, saturation as float, canAlwaysEat as bool, eatSeconds as float, usingConvertsTo as IItemStack, effects as List<FoodPropertiesPossibleEffect>) as FoodProperties;
FoodProperties.create(myInt, myFloat, myBool, myFloat, myIItemStack, myList);

Parameters:

nutrition Type: int
saturation Type: float
canAlwaysEat Type: bool
eatSeconds Type: float
usingConvertsTo Type: IItemStack

Return Type: FoodProperties

Getter
script.zs
// FoodProperties.eatSeconds as float
myFoodProperties.eatSeconds

Return Type: float

Getter
script.zs
// FoodProperties.effects as List<FoodPropertiesPossibleEffect>
myFoodProperties.effects

Return Type: List<FoodPropertiesPossibleEffect>

Getter
script.zs
// FoodProperties.nutrition as int
myFoodProperties.nutrition

Return Type: int

Getter
script.zs
// FoodProperties.saturationModifier as float
myFoodProperties.saturationModifier

Return Type: float

Getter
script.zs
// FoodProperties.usingConvertsTo as IItemStack
myFoodProperties.usingConvertsTo

Return Type: IItemStack

withCanAlwaysEat(canAlwaysEat as bool) as FoodProperties
script.zs
// FoodProperties.withCanAlwaysEat(canAlwaysEat as bool) as FoodProperties;
myFoodProperties.withCanAlwaysEat(myBool);

Parameters:

canAlwaysEat Type: bool

Return Type: FoodProperties

withEatSeconds(eatSeconds as int) as FoodProperties
script.zs
// FoodProperties.withEatSeconds(eatSeconds as int) as FoodProperties;
myFoodProperties.withEatSeconds(myInt);

Parameters:

eatSeconds Type: int

Return Type: FoodProperties

withEffect(effect as MobEffectInstance, probability as float) as FoodProperties
script.zs
// FoodProperties.withEffect(effect as MobEffectInstance, probability as float) as FoodProperties;
myFoodProperties.withEffect(myMobEffectInstance, myFloat);

Parameters:

probability Type: float

Return Type: FoodProperties

withEffect(effect as PossibleEffect) as FoodProperties
script.zs
// FoodProperties.withEffect(effect as FoodPropertiesPossibleEffect) as FoodProperties;
myFoodProperties.withEffect(myPossibleEffect);

Return Type: FoodProperties

withEffects(effects as List<PossibleEffect>) as FoodProperties
script.zs
// FoodProperties.withEffects(effects as List<FoodPropertiesPossibleEffect>) as FoodProperties;
myFoodProperties.withEffects(myList);

Parameters:

Return Type: FoodProperties

withNutrition(nutrition as int) as FoodProperties
script.zs
// FoodProperties.withNutrition(nutrition as int) as FoodProperties;
myFoodProperties.withNutrition(myInt);

Parameters:

nutrition Type: int

Return Type: FoodProperties

withoutEffect(effect as MobEffect) as FoodProperties
script.zs
// FoodProperties.withoutEffect(effect as MobEffect) as FoodProperties;
myFoodProperties.withoutEffect(myMobEffect);

Parameters:

effect Type: MobEffect

Return Type: FoodProperties

withoutEffect(effect as PossibleEffect) as FoodProperties
script.zs
// FoodProperties.withoutEffect(effect as FoodPropertiesPossibleEffect) as FoodProperties;
myFoodProperties.withoutEffect(myPossibleEffect);

Return Type: FoodProperties

withSaturation(saturation as float) as FoodProperties
script.zs
// FoodProperties.withSaturation(saturation as float) as FoodProperties;
myFoodProperties.withSaturation(myFloat);

Parameters:

saturation Type: float

Return Type: FoodProperties

withUsingConvertsTo(usingConvertsTo as IItemStack) as FoodProperties
script.zs
// FoodProperties.withUsingConvertsTo(usingConvertsTo as IItemStack) as FoodProperties;
myFoodProperties.withUsingConvertsTo(myIItemStack);

Parameters:

usingConvertsTo Type: IItemStack

Return Type: FoodProperties