Interface ConsumableApplyEffects
- All Superinterfaces:
ConfigurationSerializable
,ConsumableEffect
Represent the effects applied when an item is consumed.
-
Method Summary
Modifier and TypeMethodDescriptionaddEffect
(PotionEffect effect) Adds an effect which may be applied by this item when consumed.Gets the effects which may be applied by this item when consumed.float
Gets the probability of this effect being applied.void
setEffects
(List<PotionEffect> effects) Sets the effects which may be applied by this item when consumed.void
setProbability
(float probability) Sets the probability of this effect being applied.Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializable
serialize
-
Method Details
-
getEffects
Gets the effects which may be applied by this item when consumed.- Returns:
- consumable effects
-
setEffects
Sets the effects which may be applied by this item when consumed.- Parameters:
effects
- new effects
-
addEffect
Adds an effect which may be applied by this item when consumed.- Parameters:
effect
- the effect- Returns:
- the added effect
-
getProbability
float getProbability()Gets the probability of this effect being applied.- Returns:
- probability
-
setProbability
void setProbability(float probability) Sets the probability of this effect being applied.- Parameters:
probability
- between 0 and 1 inclusive.
-