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

Constructor #构造函数

Link to constructor-构造函数

No Description Provided

ZenScript
Copy
new MCFood(healing as int, saturation as float) as MCFood
参数类型描述
参数
healing
类型
int
描述
No Description Provided
参数
saturation
类型
浮点数
描述
No Description Provided

Name: addEffect

Return Type: MCFood

ZenScript
Copy
MCFood.addEffect(effect as MCPotionEffectInstance, probability as float) as MCFood
参数类型描述
参数
effect
类型
MCPotionEffectInstance
描述
No Description Provided
参数
probability
类型
浮点数
描述
No Description Provided

Name: clearEffects

Return Type: void

ZenScript
Copy
// MCFood.clearEffects() as void

myMCFood.clearEffects();

Name: removeEffect

Return Type: MCFood

ZenScript
Copy
MCFood.removeEffect(effect as MCPotionEffectInstance) as MCFood
参数类型描述
参数
effect
类型
MCPotionEffectInstance
描述
No Description Provided

Name: setCanEatWhenFull

Return Type: MCFood

ZenScript
Copy
MCFood.setCanEatWhenFull(canEatWhenFull as boolean) as MCFood
参数类型描述
参数
canEatWhenFull
类型
布尔值
描述
No Description Provided

Name: setFastEating

Return Type: MCFood

ZenScript
Copy
MCFood.setFastEating(fastEating as boolean) as MCFood
参数类型描述
参数
fastEating
类型
布尔值
描述
No Description Provided

Name: setHealing

Return Type: MCFood

ZenScript
Copy
MCFood.setHealing(healing as int) as MCFood
参数类型描述
参数
healing
类型
int
描述
No Description Provided

Name: setMeat

Return Type: MCFood

ZenScript
Copy
MCFood.setMeat(meat as boolean) as MCFood
参数类型描述
参数
meat
类型
布尔值
描述
No Description Provided

Name: setSaturation

Return Type: MCFood

ZenScript
Copy
MCFood.setSaturation(saturation as float) as MCFood
参数类型描述
参数
saturation
类型
浮点数
描述
No Description Provided
名称类型可获得可设置描述
名称
canEatWhenFull
类型
布尔值
可获得
true
可设置
false
描述
No Description Provided
名称
healing
类型
int
可获得
true
可设置
false
描述
No Description Provided
名称
isFastEating
类型
布尔值
可获得
true
可设置
false
描述
No Description Provided
名称
meat
类型
布尔值
可获得
true
可设置
false
描述
No Description Provided
名称
saturation
类型
浮点数
可获得
true
可设置
false
描述
No Description Provided