addEffect

fun addEffect(effect: PotionEffect, probability: Float): FoodItem

Adds a potion effect to the food item, which will be applied with a certain probability upon consumption.

Return

The FoodItem instance for method chaining.

Parameters

effect

The PotionEffect to apply.

probability

The probability (between 0 and 1) of applying the effect.