This class was added by a mod with mod-id crafttweaker. So you need to have this mod installed if you want to use this feature.

Importing the class

Link to importing-the-class

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.

ZenScript
Copy
crafttweaker.api.food.MCFood
ZenScript
Copy
new crafttweaker.api.food.MCFood(healing as int, saturation as float);
ParameterTypeDescription
Parameter
healing
Type
int
Description
No description provided
Parameter
saturation
Type
float
Description
No description provided

Returns crafttweaker.api.food.MCFood

ZenScript
Copy
myMCFood.addEffect(effect as crafttweaker.api.potion.MCPotionEffectInstance, probability as float);
ParameterTypeDescription
Parameter
effect
Type
crafttweaker.api.potion.MCPotionEffectInstance
Description
No description provided
Parameter
probability
Type
float
Description
No description provided
ZenScript
Copy
myMCFood.clearEffects();

Returns crafttweaker.api.food.MCFood

ZenScript
Copy
myMCFood.removeEffect(effect as crafttweaker.api.potion.MCPotionEffectInstance);
ParameterTypeDescription
Parameter
effect
Type
crafttweaker.api.potion.MCPotionEffectInstance
Description
No description provided

setCanEatWhenFull

Link to setcaneatwhenfull

Returns crafttweaker.api.food.MCFood

ZenScript
Copy
myMCFood.setCanEatWhenFull(canEatWhenFull as boolean);
ParameterTypeDescription
Parameter
canEatWhenFull
Type
boolean型
Description
No description provided

Returns crafttweaker.api.food.MCFood

ZenScript
Copy
myMCFood.setFastEating(fastEating as boolean);
ParameterTypeDescription
Parameter
fastEating
Type
boolean型
Description
No description provided

Returns crafttweaker.api.food.MCFood

ZenScript
Copy
myMCFood.setHealing(healing as int);
ParameterTypeDescription
Parameter
healing
Type
int
Description
No description provided

Returns crafttweaker.api.food.MCFood

ZenScript
Copy
myMCFood.setMeat(meat as boolean);
ParameterTypeDescription
Parameter
meat
Type
boolean型
Description
No description provided

Returns crafttweaker.api.food.MCFood

ZenScript
Copy
myMCFood.setSaturation(saturation as float);
ParameterTypeDescription
Parameter
saturation
Type
float
Description
No description provided
名称TypeHas GetterHas Setter
名称
canEatWhenFull
Type
boolean型
Has Getter
true
Has Setter
false
名称
healing
Type
int
Has Getter
true
Has Setter
false
名称
isFastEating
Type
boolean型
Has Getter
true
Has Setter
false
名称
meat
Type
boolean型
Has Getter
true
Has Setter
false
名称
saturation
Type
float
Has Getter
true
Has Setter
false