Package org.bukkit.attribute
Class AttributeModifier
java.lang.Object
org.bukkit.attribute.AttributeModifier
- All Implemented Interfaces:
- ConfigurationSerializable,- Keyed
Concrete implementation of an attribute modifier.
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumEnumerable operation to be applied.
- 
Constructor SummaryConstructorsConstructorDescriptionAttributeModifier(String name, double amount, AttributeModifier.Operation operation) Deprecated, for removal: This API element is subject to removal in a future version.AttributeModifier(UUID uuid, String name, double amount, AttributeModifier.Operation operation) Deprecated, for removal: This API element is subject to removal in a future version.AttributeModifier(UUID uuid, String name, double amount, AttributeModifier.Operation operation, EquipmentSlot slot) Deprecated, for removal: This API element is subject to removal in a future version.AttributeModifier(UUID uuid, String name, double amount, AttributeModifier.Operation operation, EquipmentSlotGroup slot) Deprecated, for removal: This API element is subject to removal in a future version.AttributeModifier(NamespacedKey key, double amount, AttributeModifier.Operation operation, EquipmentSlotGroup slot) 
- 
Method SummaryModifier and TypeMethodDescriptionstatic AttributeModifierdeserialize(Map<String, Object> args) booleandoubleGet the amount by which this modifier will apply itsAttributeModifier.Operation.getKey()Return the namespaced identifier for this object.getName()Get the name of this modifier.Get the operation this modifier will apply.getSlot()Deprecated.Get theEquipmentSlotthis AttributeModifier is active on, or null if this modifier is applicable for any slot.Deprecated, for removal: This API element is subject to removal in a future version.attributes are now identified by keysinthashCode()Creates a Map representation of this class.toString()
- 
Constructor Details- 
AttributeModifier@Deprecated(since="1.21", forRemoval=true) public AttributeModifier(@NotNull String name, double amount, @NotNull AttributeModifier.Operation operation) Deprecated, for removal: This API element is subject to removal in a future version.
- 
AttributeModifier@Deprecated(since="1.21", forRemoval=true) public AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull AttributeModifier.Operation operation) Deprecated, for removal: This API element is subject to removal in a future version.
- 
AttributeModifier@Deprecated(since="1.21", forRemoval=true) public AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull AttributeModifier.Operation operation, @Nullable EquipmentSlot slot) Deprecated, for removal: This API element is subject to removal in a future version.
- 
AttributeModifier@Deprecated(since="1.21", forRemoval=true) public AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull AttributeModifier.Operation operation, @NotNull EquipmentSlotGroup slot) Deprecated, for removal: This API element is subject to removal in a future version.
- 
AttributeModifierpublic AttributeModifier(@NotNull NamespacedKey key, double amount, @NotNull AttributeModifier.Operation operation, @NotNull EquipmentSlotGroup slot) 
 
- 
- 
Method Details- 
getUniqueIdDeprecated, for removal: This API element is subject to removal in a future version.attributes are now identified by keysGet the unique ID for this modifier.- Returns:
- unique id
- See Also:
 
- 
getKeyDescription copied from interface:KeyedReturn the namespaced identifier for this object.
- 
getNameGet the name of this modifier.- Returns:
- name
 
- 
getAmountpublic double getAmount()Get the amount by which this modifier will apply itsAttributeModifier.Operation.- Returns:
- modification amount
 
- 
getOperationGet the operation this modifier will apply.- Returns:
- operation
 
- 
getSlotDeprecated.usegetSlotGroup()Get theEquipmentSlotthis AttributeModifier is active on, or null if this modifier is applicable for any slot.- Returns:
- the slot
 
- 
getSlotGroupGet theEquipmentSlotthis AttributeModifier is active on, or null if this modifier is applicable for any slot.- Returns:
- the slot
 
- 
serializeDescription 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 interface- ConfigurationSerializable
- Returns:
- Map containing the current state of this class
 
- 
equals
- 
hashCodepublic int hashCode()
- 
toString
- 
deserialize
 
- 
getSlotGroup()