FoodProperties
Link to foodproperties
导入类
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 Copyimport crafttweaker.api.food.FoodProperties;
Static Methods
Link to static-methods
Name: create
Return Type: FoodProperties
ZenScript CopyFoodProperties.create(nutrition as int, saturationModifier as float) as FoodProperties
参数 | 类型 |
---|---|
参数 nutrition | 类型 int |
参数 saturationModifier | 类型 float |
使用方式
Link to 使用方式
Name: addEffect
Return Type: FoodProperties
ZenScript CopyFoodProperties.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();
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 CopyFoodProperties.removeEffect(effect as MobEffect) as FoodProperties
参数 | 类型 |
---|---|
参数 effect | 类型 MobEffect |
Name: removeEffect
Return Type: FoodProperties
ZenScript CopyFoodProperties.removeEffect(effect as MobEffectInstance) as FoodProperties
参数 | 类型 |
---|---|
参数 effect | 类型 MobEffectInstance |
Name: setCanAlwaysEat
Return Type: FoodProperties
ZenScript CopyFoodProperties.setCanAlwaysEat(canAlwaysEat as boolean) as FoodProperties
参数 | 类型 |
---|---|
参数 canAlwaysEat | 类型 布尔值 |
Name: setIsFastFood
Return Type: FoodProperties
ZenScript CopyFoodProperties.setIsFastFood(fastFood as boolean) as FoodProperties
参数 | 类型 |
---|---|
参数 fastFood | 类型 布尔值 |
Name: setIsMeat
Return Type: FoodProperties
ZenScript CopyFoodProperties.setIsMeat(isMeat as boolean) as FoodProperties
参数 | 类型 |
---|---|
参数 isMeat | 类型 布尔值 |
Name: setNutrition
Return Type: FoodProperties
ZenScript CopyFoodProperties.setNutrition(nutrition as int) as FoodProperties
参数 | 类型 |
---|---|
参数 nutrition | 类型 int |
Name: setSaturationModifier
Return Type: FoodProperties
ZenScript CopyFoodProperties.setSaturationModifier(saturationModifier as float) as FoodProperties
参数 | 类型 |
---|---|
参数 saturationModifier | 类型 float |
名称 | 类型 | 可获得 | 可设置 |
---|---|---|---|
名称 canAlwaysEat | 类型 布尔值 | 可获得 true | 可设置 true |
名称 effects | 类型 stdlib.List<Pair<MobEffectInstance,float?>> | 可获得 true | 可设置 false |
名称 isFastFood | 类型 布尔值 | 可获得 true | 可设置 true |
名称 isMeat | 类型 布尔值 | 可获得 true | 可设置 true |
名称 nutrition | 类型 int | 可获得 true | 可设置 true |
名称 saturationModifier | 类型 float | 可获得 true | 可设置 true |