Attribute
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.
Methods
Clamps the given value to this Attribute’s range if it exist.
Returns: The clamped value if this Attribute has a range, otherwise the value is returned as is.
Return Type: double
Parameter | Type | Description |
---|---|---|
Parameter value | Type double | Description The given value to clamp. |
Gets the attribute bracket handler syntax for this Attribute.
E.G.
attribute:minecraft:generic.max_health
Returns: The attribute bracket handler syntax for this Block.
Return Type: string
Gets the default value for this Attribute.
Returns: The default value for this Attribute.
Return Type: double
Should this attribute be synced to the client.
Returns: True if synced. False otherwise.
Return Type: boolean
Properties
Name | Type | Has Getter | Has Setter | Description |
---|---|---|---|---|
Name commandString | Type string | Has Getter true | Has Setter false | Description Gets the attribute bracket handler syntax for this Attribute. E.G. |
Name defaultValue | Type double | Has Getter true | Has Setter false | Description Gets the default value for this Attribute. |
Name shouldWatch | Type boolean | Has Getter true | Has Setter false | Description Should this attribute be synced to the client. |