AttributeModifier

Link to attributemodifier

Importing the class

Link to 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.

ZenScript
Copy
import crafttweaker.api.entity.attribute.AttributeModifier;

Extending Record

Link to extending-record

AttributeModifier extends Record. That means all methods available in Record are also available in AttributeModifier

Name: create

Creates a new AttributeModifier

Returns: the new attribute modifier
Return Type: AttributeModifier

ZenScript
Copy
// AttributeModifier.create(id as ResourceLocation, amount as double, operation as AttributeOperation) as AttributeModifier

AttributeModifier.create(<resource:crafttweaker:generic.scripting>, 11.4, AttributeOperation.ADDITION);
ParameterTypeDescription
Parameter
id
Type
ResourceLocation
Description
the id of this attribute modifier
Parameter
amount
Type
double
Description
the amount of this attribute modifier
Parameter
operation
Type
AttributeOperation
Description
the operation of this attribute modifier.
NameTypeHas GetterHas SetterDescription
Name
amount
Type
double
Has Getter
true
Has Setter
false
Description
Gets the amount of this AttributeModifier.
Name
id
Type
ResourceLocation
Has Getter
true
Has Setter
false
Description
Gets the ID of this AttributeModifier.
Name
operation
Type
AttributeOperation
Has Getter
true
Has Setter
false
Description
Gets the operation of this AttributeModifier.