AttributeModifier
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
import crafttweaker.api.entity.AttributeModifier;Static Methods
Creates a new AttributeModifier
Returns: the new attribute modifier
Return Type: AttributeModifier
// AttributeModifier.create(name as string, amount as double, operation as AttributeOperation, uuid as string) as AttributeModifier
AttributeModifier.create("My New Attribute Modifier", 11.4, AttributeOperation.ADDITION, "6d79f9c1-a4ab-4e72-a0ab-71870b89b4c6");| Parameter | Type | Description | Optional | DefaultValue | 
|---|---|---|---|---|
| Parametername | Typestring | Descriptionthe name of this attribute modifier | Optionalfalse | DefaultValue | 
| Parameteramount | Typedouble | Descriptionthe amount of this attribute modifier | Optionalfalse | DefaultValue | 
| Parameteroperation | TypeAttributeOperation | Descriptionthe operation of this attribute modifier. | Optionalfalse | DefaultValue | 
| Parameteruuid | Typestring | Descriptionthe uuid of this attribute modifier, if omitted, it will use a random one. | Optionaltrue | DefaultValue | 
Methods
Gets the amount of this AttributeModifier.
Returns: The amount of this AttributeModifier.
Return Type: double
// AttributeModifier.getAmount() as double
myAttributeModifier.getAmount();Gets the ID of this AttributeModifier.
Returns: The ID of this AttributeModifier
Return Type: string
// AttributeModifier.getID() as string
myAttributeModifier.getID();Gets the name of this AttributeModifier.
Returns: The name of this AttributeModifier.
Return Type: string
// AttributeModifier.getName() as string
myAttributeModifier.getName();Gets the operation of this AttributeModifier.
Returns: The operation of this AttributeModifier.
Return Type: AttributeOperation
// AttributeModifier.getOperation() as AttributeOperation
myAttributeModifier.getOperation();Properties
| Name | Type | Has Getter | Has Setter | Description | 
|---|---|---|---|---|
| Nameamount | Typedouble | Has Gettertrue | Has Setterfalse | DescriptionGets the amount of this AttributeModifier. | 
| Nameid | Typestring | Has Gettertrue | Has Setterfalse | DescriptionGets the ID of this AttributeModifier. | 
| Namename | Typestring | Has Gettertrue | Has Setterfalse | DescriptionGets the name of this AttributeModifier. | 
| Nameoperation | TypeAttributeOperation | Has Gettertrue | Has Setterfalse | DescriptionGets the operation of this AttributeModifier. |