AttributeInstance

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.AttributeInstance;

Members

addPermanentModifier(modifier as AttributeModifier)
script.zs
// AttributeInstance.addPermanentModifier(modifier as AttributeModifier);
myAttributeInstance.addPermanentModifier(myAttributeModifier);

Parameters:

addTransientModifier(modifier as AttributeModifier)
script.zs
// AttributeInstance.addTransientModifier(modifier as AttributeModifier);
myAttributeInstance.addTransientModifier(myAttributeModifier);

Parameters:

Getter
script.zs
// AttributeInstance.baseValue as double
myAttributeInstance.baseValue

Return Type: double

Setter
script.zs
// AttributeInstance.baseValue = (value as double);
myAttributeInstance.baseValue = myDouble;

Parameters:

value Type: double
baseValue() as double
script.zs
// AttributeInstance.baseValue() as double;
myAttributeInstance.baseValue();

Return Type: double

baseValue(value as double)
script.zs
// AttributeInstance.baseValue(value as double);
myAttributeInstance.baseValue(myDouble);

Parameters:

value Type: double
getModifier(uuid as UUID) as AttributeModifier
script.zs
// AttributeInstance.getModifier(uuid as UUID) as AttributeModifier;
myAttributeInstance.getModifier(myUUID);

Parameters:

uuid Type: UUID

Return Type: AttributeModifier

getModifier(uuid as string) as AttributeModifier
script.zs
// AttributeInstance.getModifier(uuid as string) as AttributeModifier;
myAttributeInstance.getModifier(myString);

Parameters:

uuid Type: string

Return Type: AttributeModifier

hasModifier(modifier as AttributeModifier) as bool
script.zs
// AttributeInstance.hasModifier(modifier as AttributeModifier) as bool;
myAttributeInstance.hasModifier(myAttributeModifier);

Parameters:

Return Type: bool

Getter
script.zs
// AttributeInstance.modifiers as List<AttributeModifier>
myAttributeInstance.modifiers

Return Type: List<AttributeModifier>

modifiers() as List<AttributeModifier>
script.zs
// AttributeInstance.modifiers() as List<AttributeModifier>;
myAttributeInstance.modifiers();

Return Type: List<AttributeModifier>

removeModifier(modifier as UUID)
script.zs
// AttributeInstance.removeModifier(modifier as UUID);
myAttributeInstance.removeModifier(myUUID);

Parameters:

modifier Type: UUID
removeModifier(uuid as string)
script.zs
// AttributeInstance.removeModifier(uuid as string);
myAttributeInstance.removeModifier(myString);

Parameters:

uuid Type: string
Getter
script.zs
// AttributeInstance.value as double
myAttributeInstance.value

Return Type: double

value() as double
script.zs
// AttributeInstance.value() as double;
myAttributeInstance.value();

Return Type: double