AttributeInstance

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.

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

Methods

script.zs
AttributeInstance.addPermanentModifier(modifier as AttributeModifier)
ParameterType
Parameter
modifier
Type
AttributeModifier
script.zs
AttributeInstance.addTransientModifier(modifier as AttributeModifier)
ParameterType
Parameter
modifier
Type
AttributeModifier

Return Type: double

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

Return Type: AttributeModifier?

script.zs
AttributeInstance.getModifier(uuid as string) as AttributeModifier?
ParameterType
Parameter
uuid
Type
string

Return Type: stdlib.List<AttributeModifier>

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

Return Type: double

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

Return Type: boolean

script.zs
AttributeInstance.hasModifier(modifier as AttributeModifier) as boolean
ParameterType
Parameter
modifier
Type
AttributeModifier
script.zs
AttributeInstance.removeModifier(modifier as AttributeModifier)
ParameterType
Parameter
modifier
Type
AttributeModifier
script.zs
AttributeInstance.removeModifier(uuid as string)
ParameterType
Parameter
uuid
Type
string
script.zs
AttributeInstance.setBaseValue(value as double)
ParameterType
Parameter
value
Type
double

Properties

NameTypeHas GetterHas Setter
Name
baseValue
Type
double
Has Getter
true
Has Setter
true
Name
modifiers
Type
stdlib.List<AttributeModifier>
Has Getter
true
Has Setter
false
Name
value
Type
double
Has Getter
true
Has Setter
false