Class PotionEffectAttribute

java.lang.Object
org.woftnw.eof.attribute.Attribute
org.woftnw.eof.attribute.PotionEffectAttribute

public class PotionEffectAttribute extends Attribute
Represents a tribal attribute that uses a potion effect.
  • Constructor Details

    • PotionEffectAttribute

      public PotionEffectAttribute(org.bukkit.potion.PotionEffect effect, @Nullable Predicate<org.bukkit.entity.Player> predicate, boolean refreshOnPredicate)
      Create a tribe attribute.
      Parameters:
      effect - The potion effect to apply.
      predicate - The predicate that must be true to apply the attribute or null if it should always be applied.
      refreshOnPredicate - Whether this attribute should only refresh when the predicate switches from false to true.
    • PotionEffectAttribute

      public PotionEffectAttribute(org.bukkit.potion.PotionEffect effect, @Nullable Predicate<org.bukkit.entity.Player> predicate)
      Create a tribe attribute.
      Parameters:
      effect - The potion effect to apply.
      predicate - The predicate that must be true to apply the attribute or null if it should always be applied.
    • PotionEffectAttribute

      public PotionEffectAttribute(org.bukkit.potion.PotionEffect effect)
      Create a tribe attribute.
      Parameters:
      effect - The potion effect to apply.
  • Method Details

    • apply

      public void apply(org.bukkit.entity.Player player)
      Description copied from class: Attribute
      Apply this attribute. This is only used when the player changes tribes or activates attributes. Subclasses should use meetsPredicate(player) in this method.
      Specified by:
      apply in class Attribute
      Parameters:
      player - The player to apply to.
    • unapply

      public void unapply(@NonNull org.bukkit.entity.Player player)
      Description copied from class: Attribute
      Unapply this attribute. This is only used when the player changes tribes or deactivates attributes. Subclasses should use meetsPredicate(player) in this method.
      Specified by:
      unapply in class Attribute
      Parameters:
      player - The player to unapply to.