Package net.minestom.server.attribute
Class AttributeModifier
java.lang.Object
net.minestom.server.attribute.AttributeModifier
Represent an attribute modifier.
-
Constructor Summary
ConstructorsConstructorDescriptionAttributeModifier(@NotNull String name, double amount, @NotNull AttributeOperation operation) Creates a new modifier with a random id.AttributeModifier(@NotNull UUID id, @NotNull String name, double amount, @NotNull AttributeOperation operation) Creates a new modifier. -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets the value of this modifier.@NotNull UUIDgetId()Gets the id of this modifier.@NotNull StringgetName()Gets the name of this modifier.@NotNull AttributeOperationGets the operation of this modifier.
-
Constructor Details
-
AttributeModifier
public AttributeModifier(@NotNull @NotNull String name, double amount, @NotNull @NotNull AttributeOperation operation) Creates a new modifier with a random id.- Parameters:
name- the name of this modifieramount- the value of this modifieroperation- the operation to apply this modifier with
-
AttributeModifier
public AttributeModifier(@NotNull @NotNull UUID id, @NotNull @NotNull String name, double amount, @NotNull @NotNull AttributeOperation operation) Creates a new modifier.- Parameters:
id- the id of this modifiername- the name of this modifieramount- the value of this modifieroperation- the operation to apply this modifier with
-
-
Method Details
-
getId
Gets the id of this modifier.- Returns:
- the id of this modifier
-
getName
Gets the name of this modifier.- Returns:
- the name of this modifier
-
getAmount
public double getAmount()Gets the value of this modifier.- Returns:
- the value of this modifier
-
getOperation
Gets the operation of this modifier.- Returns:
- the operation of this modifier
-