Package org.bukkit.attribute
Interface AttributeInstance
public interface AttributeInstance
Represents a mutable instance of an attribute and its associated modifiers
and values.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddModifier(@NotNull AttributeModifier modifier) Add a modifier to this instance.The attribute pertaining to this instance.doubleBase value of this instance before modifiers are applied.doubleGets the default value of the Attribute attached to this instance.Get all modifiers present on this instance.doublegetValue()Get the value of this instance after all associated modifiers have been applied.voidremoveModifier(@NotNull AttributeModifier modifier) Remove a modifier from this instance.voidsetBaseValue(double value) Set the base value of this instance.
-
Method Details
-
getAttribute
The attribute pertaining to this instance.- Returns:
- the attribute
-
getBaseValue
double getBaseValue()Base value of this instance before modifiers are applied.- Returns:
- base value
-
setBaseValue
void setBaseValue(double value) Set the base value of this instance.- Parameters:
value- new base value
-
getModifiers
Get all modifiers present on this instance.- Returns:
- a copied collection of all modifiers
-
addModifier
Add a modifier to this instance.- Parameters:
modifier- to add
-
removeModifier
Remove a modifier from this instance.- Parameters:
modifier- to remove
-
getValue
double getValue()Get the value of this instance after all associated modifiers have been applied.- Returns:
- the total attribute value
-
getDefaultValue
double getDefaultValue()Gets the default value of the Attribute attached to this instance.- Returns:
- server default value
-