Class PotionEffectAttribute
java.lang.Object
org.woftnw.eof.attribute.Attribute
org.woftnw.eof.attribute.PotionEffectAttribute
Represents a tribal attribute that uses a potion effect.
-
Field Summary
Fields inherited from class Attribute
lastTest, PREDICATE, REFRESH_ON_PREDICATE -
Constructor Summary
ConstructorsConstructorDescriptionPotionEffectAttribute(org.bukkit.potion.PotionEffect effect) Create a tribe attribute.PotionEffectAttribute(org.bukkit.potion.PotionEffect effect, @Nullable Predicate<org.bukkit.entity.Player> predicate) Create a tribe attribute.PotionEffectAttribute(org.bukkit.potion.PotionEffect effect, @Nullable Predicate<org.bukkit.entity.Player> predicate, boolean refreshOnPredicate) Create a tribe attribute. -
Method Summary
Methods inherited from class Attribute
meetsPredicate, tick
-
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:AttributeApply this attribute. This is only used when the player changes tribes or activates attributes. Subclasses should usemeetsPredicate(player)in this method. -
unapply
public void unapply(@NonNull org.bukkit.entity.Player player) Description copied from class:AttributeUnapply this attribute. This is only used when the player changes tribes or deactivates attributes. Subclasses should usemeetsPredicate(player)in this method.
-