AttributeModifier

Importing the class

If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.

script.zs
import crafttweaker.api.entity.attribute.AttributeModifier;

Members

Getter
Gets the amount of this AttributeModifier.
script.zs
// AttributeModifier.amount as double
myAttributeModifier.amount

Return Type: double

static create(id as ResourceLocation, amount as double, operation as Operation) as AttributeModifier
Creates a new AttributeModifier

Returns: the new attribute modifier

script.zs
// AttributeModifier.create(id as ResourceLocation, amount as double, operation as AttributeOperation) as AttributeModifier;
AttributeModifier.create(<resource:crafttweaker:generic.scripting>, 11.4, AttributeOperation.ADDITION);

Parameters:

id Type: ResourceLocation - the id of this attribute modifier
amount Type: double - the amount of this attribute modifier
operation Type: AttributeOperation - the operation of this attribute modifier.

Return Type: AttributeModifier

Getter
Gets the ID of this AttributeModifier.
script.zs
// AttributeModifier.id as ResourceLocation
myAttributeModifier.id

Return Type: ResourceLocation

Getter
Gets the operation of this AttributeModifier.
script.zs
// AttributeModifier.operation as AttributeOperation
myAttributeModifier.operation

Return Type: AttributeOperation