Home Commands Examples Getting Started With Scripts Global Keywords 1.21 Migration Guide
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

FoodPropertiesPossibleEffect

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

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

Description

Represents a possible effect of the food properties.

Members

Getter
Gets the effect of the food properties possible effect.
script.zs
// PossibleEffect.effect as MobEffectInstance
myPossibleEffect.effect

Return Type: MobEffectInstance

static of(effect as MobEffectInstance, probability as float) as PossibleEffect
Creates a new food properties possible effect.

Returns: The new food properties possible effect.

script.zs
// PossibleEffect.of(effect as MobEffectInstance, probability as float) as FoodPropertiesPossibleEffect;
FoodPropertiesPossibleEffect.of(myMobEffectInstance, myFloat);

Parameters:

effect Type: MobEffectInstance - The effect.
probability Type: float - The probability.

Return Type: FoodPropertiesPossibleEffect

Getter
Gets the probability of the food properties possible effect.
script.zs
// PossibleEffect.probability as float
myPossibleEffect.probability

Return Type: float