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

amount() as double
Gets the amount of this AttributeModifier.

Returns: The amount of this AttributeModifier.

script.zs
// AttributeModifier.amount() as double;
myAttributeModifier.amount();

Return Type: double

static create(name as string, amount as double, operation as Operation, uuid as string) as AttributeModifier
Creates a new AttributeModifier

Returns: the new attribute modifier

script.zs
// AttributeModifier.create(name as string, amount as double, operation as Operation, uuid as string) as AttributeModifier;
AttributeModifier.create("My New Attribute Modifier", 11.4, AttributeOperation.ADDITION, "6d79f9c1-a4ab-4e72-a0ab-71870b89b4c6");

Parameters:

name Type: string - the name of this attribute modifier
amount Type: double - the amount of this attribute modifier
operation Type: AttributeOperation - the operation of this attribute modifier.
uuid Type: string - the uuid of this attribute modifier, if omitted, it will use a random one.

Return Type: AttributeModifier

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

Return Type: string

id() as string
Gets the ID of this AttributeModifier.

Returns: The ID of this AttributeModifier

script.zs
// AttributeModifier.id() as string;
myAttributeModifier.id();

Return Type: string

Getter
Gets the name of this AttributeModifier.
script.zs
// AttributeModifier.name as string
myAttributeModifier.name

Return Type: string

name() as string
Gets the name of this AttributeModifier.

Returns: The name of this AttributeModifier.

script.zs
// AttributeModifier.name() as string;
myAttributeModifier.name();

Return Type: string

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

Return Type: AttributeOperation

operation() as Operation
Gets the operation of this AttributeModifier.

Returns: The operation of this AttributeModifier.

script.zs
// AttributeModifier.operation() as Operation;
myAttributeModifier.operation();

Return Type: AttributeOperation