AttributeInstance
Link to attributeinstance
Importing the class
Link to 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.
ZenScript Copyimport crafttweaker.api.entity.attribute.AttributeInstance;
Methods
Link to methods
Name: addPermanentModifier
ZenScript CopyAttributeInstance.addPermanentModifier(modifier as AttributeModifier)
Parameter | Type |
---|---|
Parameter modifier | Type AttributeModifier |
Name: addTransientModifier
ZenScript CopyAttributeInstance.addTransientModifier(modifier as AttributeModifier)
Parameter | Type |
---|---|
Parameter modifier | Type AttributeModifier |
Name: getBaseValue
Return Type: double
ZenScript Copy// AttributeInstance.getBaseValue() as double
myAttributeInstance.getBaseValue();
Name: getModifier
Return Type: AttributeModifier?
ZenScript CopyAttributeInstance.getModifier(uuid as string) as AttributeModifier?
Parameter | Type |
---|---|
Parameter uuid | Type 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 CopyAttributeInstance.hasModifier(modifier as AttributeModifier) as boolean
Parameter | Type |
---|---|
Parameter modifier | Type AttributeModifier |
Name: removeModifier
ZenScript CopyAttributeInstance.removeModifier(modifier as AttributeModifier)
Parameter | Type |
---|---|
Parameter modifier | Type AttributeModifier |
Name: removeModifier
ZenScript CopyAttributeInstance.removeModifier(uuid as string)
Parameter | Type |
---|---|
Parameter uuid | Type string |
Name: setBaseValue
ZenScript CopyAttributeInstance.setBaseValue(value as double)
Parameter | Type |
---|---|
Parameter value | Type double |
Properties
Link to properties
名称 | Type | Has Getter | Has Setter |
---|---|---|---|
名称 baseValue | Type double | Has Getter true | Has Setter true |
名称 modifiers | Type stdlib.List<AttributeModifier> | Has Getter true | Has Setter false |
名称 value | Type double | Has Getter true | Has Setter false |