AttributeInstance

Link to attributeinstance

Importare la Classe

Link to importare-la-classe

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.

ZenScript
Copy
import crafttweaker.api.entity.attribute.AttributeInstance;

Link to addPermanentModifier

Name: addPermanentModifier

ZenScript
Copy
AttributeInstance.addPermanentModifier(modifier as AttributeModifier)
ParametroTipo
Parametro
modifier
Tipo
AttributeModifier

Link to addTransientModifier

Name: addTransientModifier

ZenScript
Copy
AttributeInstance.addTransientModifier(modifier as AttributeModifier)
ParametroTipo
Parametro
modifier
Tipo
AttributeModifier

Name: getBaseValue

Return Type: double

ZenScript
Copy
// AttributeInstance.getBaseValue() as double

myAttributeInstance.getBaseValue();

Name: getModifier

Return Type: AttributeModifier?

ZenScript
Copy
AttributeInstance.getModifier(uuid as string) as AttributeModifier?
ParametroTipo
Parametro
uuid
Tipo
string

Name: getModifiers

Return Type: stdlib.List<AttributeModifier>

ZenScript
Copy
// AttributeInstance.getModifiers() as stdlib.List<AttributeModifier>

myAttributeInstance.getModifiers();

Name: getValue

Return Type: double

ZenScript
Copy
// AttributeInstance.getValue() as double

myAttributeInstance.getValue();

Name: hasModifier

Return Type: boolean

ZenScript
Copy
AttributeInstance.hasModifier(modifier as AttributeModifier) as boolean
ParametroTipo
Parametro
modifier
Tipo
AttributeModifier

Name: removeModifier

ZenScript
Copy
AttributeInstance.removeModifier(modifier as AttributeModifier)
ParametroTipo
Parametro
modifier
Tipo
AttributeModifier

Name: removeModifier

ZenScript
Copy
AttributeInstance.removeModifier(uuid as string)
ParametroTipo
Parametro
uuid
Tipo
string

Name: setBaseValue

ZenScript
Copy
AttributeInstance.setBaseValue(value as double)
ParametroTipo
Parametro
valore
Tipo
double
NomeTipoHa GetterHa Setter
Nome
baseValue
Tipo
double
Ha Getter
Ha Setter
Nome
modifiers
Tipo
stdlib.List<AttributeModifier>
Ha Getter
Ha Setter
no
Nome
valore
Tipo
double
Ha Getter
Ha Setter
no