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.
import crafttweaker.api.entity.attribute.AttributeInstance;
Methods
AttributeInstance.addPermanentModifier(modifier as AttributeModifier)
Parameter | Type |
---|---|
Parameter modifier | Type AttributeModifier |
AttributeInstance.addTransientModifier(modifier as AttributeModifier)
Parameter | Type |
---|---|
Parameter modifier | Type AttributeModifier |
Return Type: double
// AttributeInstance.getBaseValue() as double
myAttributeInstance.getBaseValue();
Return Type: AttributeModifier?
AttributeInstance.getModifier(uuid as string) as AttributeModifier?
Parameter | Type |
---|---|
Parameter uuid | Type string |
Return Type: stdlib.List<AttributeModifier>
// AttributeInstance.getModifiers() as stdlib.List<AttributeModifier>
myAttributeInstance.getModifiers();
Return Type: double
// AttributeInstance.getValue() as double
myAttributeInstance.getValue();
Return Type: boolean
AttributeInstance.hasModifier(modifier as AttributeModifier) as boolean
Parameter | Type |
---|---|
Parameter modifier | Type AttributeModifier |
AttributeInstance.removeModifier(modifier as AttributeModifier)
Parameter | Type |
---|---|
Parameter modifier | Type AttributeModifier |
AttributeInstance.removeModifier(uuid as string)
Parameter | Type |
---|---|
Parameter uuid | Type string |
AttributeInstance.setBaseValue(value as double)
Parameter | Type |
---|---|
Parameter value | Type double |
Properties
Name | Type | Has Getter | Has 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 |