Home Migration Guide Getting Started With Scripts Commands Examples
BracketHandlers

MCFood

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 at the very top of the file.

script.zs
import crafttweaker.api.food.MCFood;

Constructors

No Description Provided

script.zs
new MCFood(healing as int, saturation as float) as MCFood
ParameterTypeDescription
Parameter
healing
Type
int
Description
No Description Provided
Parameter
saturation
Type
float
Description
No Description Provided

Methods

Return Type: MCFood

script.zs
MCFood.addEffect(effect as MCPotionEffectInstance, probability as float) as MCFood
ParameterTypeDescription
Parameter
effect
Type
MCPotionEffectInstance
Description
No Description Provided
Parameter
probability
Type
float
Description
No Description Provided

Return Type: void

script.zs
// MCFood.clearEffects() as void
myMCFood.clearEffects();

Return Type: MCFood

script.zs
MCFood.removeEffect(effect as MCPotionEffectInstance) as MCFood
ParameterTypeDescription
Parameter
effect
Type
MCPotionEffectInstance
Description
No Description Provided

Return Type: MCFood

script.zs
MCFood.setCanEatWhenFull(canEatWhenFull as boolean) as MCFood
ParameterTypeDescription
Parameter
canEatWhenFull
Type
boolean
Description
No Description Provided

Return Type: MCFood

script.zs
MCFood.setFastEating(fastEating as boolean) as MCFood
ParameterTypeDescription
Parameter
fastEating
Type
boolean
Description
No Description Provided

Return Type: MCFood

script.zs
MCFood.setHealing(healing as int) as MCFood
ParameterTypeDescription
Parameter
healing
Type
int
Description
No Description Provided

Return Type: MCFood

script.zs
MCFood.setMeat(meat as boolean) as MCFood
ParameterTypeDescription
Parameter
meat
Type
boolean
Description
No Description Provided

Return Type: MCFood

script.zs
MCFood.setSaturation(saturation as float) as MCFood
ParameterTypeDescription
Parameter
saturation
Type
float
Description
No Description Provided

Properties

NameTypeHas GetterHas SetterDescription
Name
canEatWhenFull
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
healing
Type
int
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
isFastEating
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
meat
Type
boolean
Has Getter
true
Has Setter
false
Description
No Description Provided
Name
saturation
Type
float
Has Getter
true
Has Setter
false
Description
No Description Provided