Interface ConsumableApplyEffects

All Superinterfaces:
ConfigurationSerializable, ConsumableEffect

public interface ConsumableApplyEffects extends ConsumableEffect
Represent the effects applied when an item is consumed.
  • Method Details

    • getEffects

      @NotNull List<PotionEffect> getEffects()
      Gets the effects which may be applied by this item when consumed.
      Returns:
      consumable effects
    • setEffects

      void setEffects(@NotNull List<PotionEffect> effects)
      Sets the effects which may be applied by this item when consumed.
      Parameters:
      effects - new effects
    • addEffect

      @NotNull PotionEffect addEffect(@NotNull PotionEffect effect)
      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.