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.
Members
addPermanentModifier(modifier as AttributeModifier)
addTransientModifier(modifier as AttributeModifier)
Getter
Gets the base value of the attribute.
Return Type:
double
Setter
Sets the base value of the attribute.
Parameters:
value: double
Type: double
- The new base value of the attribute. baseValue() as double
Gets the base value of the attribute.
Returns: The base value of the attribute.
Return Type:
double
baseValue(value as double)
Sets the base value of the attribute.
Parameters:
value: double
Type: double
- The new base value of the attribute. getModifier(id as ResourceLocation) as AttributeModifier
Gets the
AttributeModifier
with the given ID.Returns: The AttributeModifier
with the given ID, or null if it does not exist.
Parameters:
Return Type:
AttributeModifier
hasModifier(id as ResourceLocation) as bool
Checks if the attribute has a modifier with the given ID.
Returns: True if the attribute has a modifier with the given ID, false otherwise.
Parameters:
Return Type:
bool
Getter
modifiers() as List<AttributeModifier>
Gets the
AttributeModifier
of the attribute.Returns: The modifiers of the attribute.
Return Type:
List<AttributeModifier>
removeModifier(id as ResourceLocation)
Getter
Gets the current value of the attribute.
Return Type:
double
value() as double
Gets the current value of the attribute.
Returns: The current value of the attribute.
Return Type:
double