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 enum`
`AttributeModifier.Operation`
Enumerable operation to be applied.

## Constructor Summary

Constructors
Constructor
Description
`AttributeModifier(@NotNull String name, double amount, @NotNull AttributeModifier.Operation operation)`
`AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull AttributeModifier.Operation operation)`
`AttributeModifier(@NotNull UUID uuid, @NotNull String name, double amount, @NotNull AttributeModifier.Operation operation, @Nullable EquipmentSlot slot)`

## Method Summary

Modifier and Type
Method
Description
`static @NotNull AttributeModifier`
`deserialize(@NotNull Map<String,Object> args)`
`boolean`
`equals(Object other)`
`double`
`getAmount()`
Get the amount by which this modifier will apply its `AttributeModifier.Operation`.
`@NotNull String`
`getName()`
Get the name of this modifier.
`@NotNull AttributeModifier.Operation`
`getOperation()`
Get the operation this modifier will apply.
`@Nullable EquipmentSlot`
`getSlot()`
Get the `EquipmentSlot` this AttributeModifier is active on, or null if this modifier is applicable for any slot.
`@NotNull UUID`
`getUniqueId()`
Get the unique ID for this modifier.
`int`
`hashCode()`
`@NotNull Map<String,Object>`
`serialize()`
Creates a Map representation of this class.
`String`
`toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### AttributeModifier

public AttributeModifier(@NotNull @NotNull String name, double amount, @NotNull @NotNull AttributeModifier.Operation operation)

### AttributeModifier

public AttributeModifier(@NotNull @NotNull UUID uuid, @NotNull @NotNull String name, double amount, @NotNull @NotNull AttributeModifier.Operation operation)

### AttributeModifier

public AttributeModifier(@NotNull @NotNull UUID uuid, @NotNull @NotNull String name, double amount, @NotNull @NotNull AttributeModifier.Operation operation, @Nullable @Nullable EquipmentSlot slot)

## Method Details

### getUniqueId

@NotNull public @NotNull UUID getUniqueId()
Get the unique ID for this modifier.

Returns:
  unique id

### getName

@NotNull public @NotNull String getName()
Get the name of this modifier.

Returns:
  name

### getAmount

public double getAmount()
Get the amount by which this modifier will apply its `AttributeModifier.Operation`.

Returns:
  modification amount

### getOperation

@NotNull public @NotNull AttributeModifier.Operation getOperation()
Get the operation this modifier will apply.

Returns:
  operation

### getSlot

@Nullable public @Nullable EquipmentSlot getSlot()
Get the `EquipmentSlot` this AttributeModifier is active on, or null if this modifier is applicable for any slot.

Returns:
  the slot

### serialize

@NotNull public @NotNull Map<String,Object> serialize()
Description copied from interface: `ConfigurationSerializable`
Creates a Map representation of this class.

This class must provide a method to restore this class, as defined in the `ConfigurationSerializable` interface javadocs.

Specified by:
  `serialize` in interface `ConfigurationSerializable`
Returns:
  Map containing the current state of this class

### equals

public boolean equals(Object other)

Overrides:
  `equals` in class `Object`

### hashCode

public int hashCode()

Overrides:
  `hashCode` in class `Object`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### deserialize

@NotNull public static @NotNull AttributeModifier deserialize(@NotNull @NotNull Map<String,Object> args)