Импорт класса

Link to импорт-класса

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;

Name: create

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.create(nutrition as int, saturationModifier as float) as FoodProperties
ПараметрТип
Параметр
nutrition
Тип
int
Параметр
saturationModifier
Тип
float

Name: addEffect

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.addEffect(effect as MobEffectInstance, probability as float) as FoodProperties
ПараметрТип
Параметр
effect
Тип
MobEffectInstance
Параметр
probability
Тип
float

Name: canAlwaysEat

Return Type: boolean

ZenScript
Copy
// FoodProperties.canAlwaysEat() as boolean

myFoodProperties.canAlwaysEat();

Name: getEffects

Return Type: stdlib.List<Pair<MobEffectInstance,float?>>

ZenScript
Copy
// FoodProperties.getEffects() as stdlib.List<Pair<MobEffectInstance,float?>>

myFoodProperties.getEffects();

Name: getNutrition

Return Type: int

ZenScript
Copy
// FoodProperties.getNutrition() as int

myFoodProperties.getNutrition();

Link to getSaturationModifier

Name: getSaturationModifier

Return Type: float

ZenScript
Copy
// FoodProperties.getSaturationModifier() as float

myFoodProperties.getSaturationModifier();

Name: isFastFood

Return Type: boolean

ZenScript
Copy
// FoodProperties.isFastFood() as boolean

myFoodProperties.isFastFood();

Name: isMeat

Return Type: boolean

ZenScript
Copy
// FoodProperties.isMeat() as boolean

myFoodProperties.isMeat();

Name: removeEffect

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.removeEffect(effect as MobEffect) as FoodProperties
ПараметрТип
Параметр
effect
Тип
MobEffect

Name: removeEffect

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.removeEffect(effect as MobEffectInstance) as FoodProperties
ПараметрТип
Параметр
effect
Тип
MobEffectInstance

Name: setCanAlwaysEat

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.setCanAlwaysEat(canAlwaysEat as boolean) as FoodProperties
ПараметрТип
Параметр
canAlwaysEat
Тип
boolean

Name: setIsFastFood

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.setIsFastFood(fastFood as boolean) as FoodProperties
ПараметрТип
Параметр
fastFood
Тип
boolean

Name: setIsMeat

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.setIsMeat(isMeat as boolean) as FoodProperties
ПараметрТип
Параметр
isMeat
Тип
boolean

Name: setNutrition

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.setNutrition(nutrition as int) as FoodProperties
ПараметрТип
Параметр
nutrition
Тип
int

Link to setSaturationModifier

Name: setSaturationModifier

Return Type: FoodProperties

ZenScript
Copy
FoodProperties.setSaturationModifier(saturationModifier as float) as FoodProperties
ПараметрТип
Параметр
saturationModifier
Тип
float

Свойства

Link to свойства

НазваниеТипИмеет GetterИмеет Setter
Название
canAlwaysEat
Тип
boolean
Имеет Getter
true
Имеет Setter
true
Название
effects
Тип
stdlib.List<Pair<MobEffectInstance,float?>>
Имеет Getter
true
Имеет Setter
false
Название
isFastFood
Тип
boolean
Имеет Getter
true
Имеет Setter
true
Название
isMeat
Тип
boolean
Имеет Getter
true
Имеет Setter
true
Название
nutrition
Тип
int
Имеет Getter
true
Имеет Setter
true
Название
saturationModifier
Тип
float
Имеет Getter
true
Имеет Setter
true