Package org.bukkit.attribute
Class AttributeModifier
- java.lang.Object
-
- org.bukkit.attribute.AttributeModifier
-
- All Implemented Interfaces:
ConfigurationSerializable
public class AttributeModifier extends Object implements ConfigurationSerializable
Concrete implementation of an attribute modifier.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAttributeModifier.OperationEnumerable operation to be applied.
-
Constructor Summary
Constructors Constructor Description AttributeModifier(String name, double amount, AttributeModifier.Operation operation)AttributeModifier(UUID uuid, String name, double amount, AttributeModifier.Operation operation)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static AttributeModifierdeserialize(Map<String,Object> args)doublegetAmount()Get the amount by which this modifier will apply itsAttributeModifier.Operation.StringgetName()Get the name of this modifier.AttributeModifier.OperationgetOperation()Get the operation this modifier will apply.UUIDgetUniqueId()Get the unique ID for this modifier.Map<String,Object>serialize()Creates a Map representation of this class.
-
-
-
Constructor Detail
-
AttributeModifier
public AttributeModifier(String name, double amount, AttributeModifier.Operation operation)
-
AttributeModifier
public AttributeModifier(UUID uuid, String name, double amount, AttributeModifier.Operation operation)
-
-
Method Detail
-
getUniqueId
public UUID getUniqueId()
Get the unique ID for this modifier.- Returns:
- unique id
-
getName
public String getName()
Get the name of this modifier.- Returns:
- name
-
getAmount
public double getAmount()
Get the amount by which this modifier will apply itsAttributeModifier.Operation.- Returns:
- modification amount
-
getOperation
public AttributeModifier.Operation getOperation()
Get the operation this modifier will apply.- Returns:
- operation
-
serialize
public Map<String,Object> serialize()
Description copied from interface:ConfigurationSerializableCreates a Map representation of this class.This class must provide a method to restore this class, as defined in the
ConfigurationSerializableinterface javadocs.- Specified by:
serializein interfaceConfigurationSerializable- Returns:
- Map containing the current state of this class
-
deserialize
public static AttributeModifier deserialize(Map<String,Object> args)
-
-