MCFood

这个类由mod-id为crafttweaker的模组添加. 因此,如果要使用此功能,则需要安装此mod。

导入相关包

如果遇到任何问题(例如强制转换数组),则可能需要导入软件包,因此,最好的方式就是导入包支持。

crafttweaker.api.food.MCFood

Constructor #构造函数

new crafttweaker.api.food.MCFood(healing as int, saturation as float);
参数类型描述
healingintNo description provided
saturationfloatNo description provided

方法

addEffect

Returns crafttweaker.api.food.MCFood

myMCFood.addEffect(effect as crafttweaker.api.potion.MCPotionEffectInstance, probability as float);
参数类型描述
effectcrafttweaker.api.potion.MCPotionEffectInstanceNo description provided
probabilityfloatNo description provided

clearEffects

myMCFood.clearEffects();

removeEffect

Returns crafttweaker.api.food.MCFood

myMCFood.removeEffect(effect as crafttweaker.api.potion.MCPotionEffectInstance);
参数类型描述
effectcrafttweaker.api.potion.MCPotionEffectInstanceNo description provided

setCanEatWhenFull

Returns crafttweaker.api.food.MCFood

myMCFood.setCanEatWhenFull(canEatWhenFull as boolean);
参数类型描述
canEatWhenFullbooleanNo description provided

setFastEating

Returns crafttweaker.api.food.MCFood

myMCFood.setFastEating(fastEating as boolean);
参数类型描述
fastEatingbooleanNo description provided

setHealing

Returns crafttweaker.api.food.MCFood

myMCFood.setHealing(healing as int);
参数类型描述
healingintNo description provided

setMeat

Returns crafttweaker.api.food.MCFood

myMCFood.setMeat(meat as boolean);
参数类型描述
meatbooleanNo description provided

setSaturation

Returns crafttweaker.api.food.MCFood

myMCFood.setSaturation(saturation as float);
参数类型描述
saturationfloatNo description provided

参数

名称类型可获得可设置
canEatWhenFullbooleantruefalse
healinginttruefalse
isFastEatingbooleantruefalse
meatbooleantruefalse
saturationfloattruefalse