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.
import crafttweaker.api.entity.attribute.AttributeModifier;
Members
Getter
Gets the amount of this AttributeModifier.script.zs
// AttributeModifier.amount as doublemyAttributeModifier.amount
Return Type:
double
amount() as double
Gets the amount of this AttributeModifier.script.zs
Returns: The amount of this AttributeModifier.
// 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 AttributeModifierscript.zs
Returns: the new attribute modifier
// 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");
Parameters:
name: string
Type: string
- the name of this attribute modifier amount: double
Type: double
- the amount of this attribute modifier uuid: string
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 stringmyAttributeModifier.id
Return Type:
string
id() as string
Gets the ID of this AttributeModifier.script.zs
Returns: The ID of this AttributeModifier
// AttributeModifier.id() as string;myAttributeModifier.id();
Return Type:
string
Getter
Gets the name of this AttributeModifier.script.zs
// AttributeModifier.name as stringmyAttributeModifier.name
Return Type:
string
name() as string
Gets the name of this AttributeModifier.script.zs
Returns: The name of this AttributeModifier.
// AttributeModifier.name() as string;myAttributeModifier.name();
Return Type:
string
Getter
Gets the operation of this AttributeModifier.script.zs
// AttributeModifier.operation as AttributeOperationmyAttributeModifier.operation
Return Type:
AttributeOperation
operation() as Operation
Gets the operation of this AttributeModifier.script.zs
Returns: The operation of this AttributeModifier.
myAttributeModifier.operation();
Return Type:
AttributeOperation