Class AttributeModifierAttribute
java.lang.Object
org.woftnw.eof.attribute.Attribute
org.woftnw.eof.attribute.AttributeModifierAttribute
Represents a tribal attribute that uses an attribute modifier.
-
Field Summary
Fields inherited from class Attribute
lastTest, PREDICATE, REFRESH_ON_PREDICATE -
Constructor Summary
ConstructorsConstructorDescriptionAttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation) Create a tribe attribute using an attribute modifier.AttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation, @Nullable Predicate<org.bukkit.entity.Player> predicate) Create a tribe attribute using an attribute modifier.AttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation, @Nullable Predicate<org.bukkit.entity.Player> predicate, boolean refreshOnPredicate) Create a tribe attribute using an attribute modifier. -
Method Summary
Methods inherited from class Attribute
meetsPredicate
-
Constructor Details
-
AttributeModifierAttribute
public AttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation, @Nullable Predicate<org.bukkit.entity.Player> predicate, boolean refreshOnPredicate) Create a tribe attribute using an attribute modifier.- Parameters:
attributeType- The attribute to modify.plugin- The plugin instance.amount- The amount to use for the attribute modifier.operation- The operation to use to apply the attribute modifier.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.
-
AttributeModifierAttribute
public AttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation, @Nullable Predicate<org.bukkit.entity.Player> predicate) Create a tribe attribute using an attribute modifier.- Parameters:
attributeType- The attribute modifier type to apply.plugin- The plugin instance.amount- The amount to use for the attribute modifier.operation- The operation to use to apply the attribute modifier.predicate- The predicate that must be true to apply the attribute or null if it should always be applied.
-
AttributeModifierAttribute
public AttributeModifierAttribute(@NonNull org.bukkit.attribute.Attribute attributeType, ElytrasOfFire plugin, double amount, org.bukkit.attribute.AttributeModifier.Operation operation) Create a tribe attribute using an attribute modifier.- Parameters:
attributeType- The attribute modifier type to apply.plugin- The plugin instance.amount- The amount to use for the attribute modifier.operation- The operation to use to apply the attribute modifier.
-
-
Method Details
-
tick
-
apply
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.- Specified by:
applyin classAttribute- Parameters:
player- The player to apply to.- Throws:
IllegalArgumentException
-
unapply
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.- Specified by:
unapplyin classAttribute- Parameters:
player- The player to unapply to.- Throws:
IllegalArgumentException
-