Attribute
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.
import crafttweaker.api.entity.attribute.Attribute;
Members
Getter
Should this attribute be synced to the client.script.zs
// Attribute.clientSyncable as boolmyAttribute.clientSyncable
Return Type:
bool
clientSyncable() as bool
Should this attribute be synced to the client.script.zs
Returns: True if synced. False otherwise.
// Attribute.clientSyncable() as bool;myAttribute.clientSyncable();
Return Type:
bool
Getter
Gets the attribute bracket handler syntax for this Attribute.
E.G.script.zs
E.G.
<attribute:minecraft:generic.max_health>
// Attribute.commandString as stringmyAttribute.commandString
Return Type:
string
commandString() as string
Gets the attribute bracket handler syntax for this Attribute.
E.G.script.zs
E.G.
<attribute:minecraft:generic.max_health>
Returns: The attribute bracket handler syntax for this Block.
// Attribute.commandString() as string;myAttribute.commandString();
Return Type:
string
as string
Gets the attribute bracket handler syntax for this Attribute.
E.G.script.zs
E.G.
<attribute:minecraft:generic.max_health>
// Attribute as stringmyAttribute as string
Return Type:
string
Getter
Gets the default value for this Attribute.script.zs
// Attribute.defaultValue as doublemyAttribute.defaultValue
Return Type:
double
defaultValue() as double
Gets the default value for this Attribute.script.zs
Returns: The default value for this Attribute.
// Attribute.defaultValue() as double;myAttribute.defaultValue();
Return Type:
double
Getter
// Attribute.registryName as ResourceLocationmyAttribute.registryName
Return Type:
ResourceLocation
registryName() as ResourceLocation
sanitizeValue(value as double) as double
Sanitizes the given value for this Attribute.script.zs
Returns: The sanitized value.
// Attribute.sanitizeValue(value as double) as double;myAttribute.sanitizeValue(4);
Parameters:
value: double
Type: double
- The given value to sanitized.
Return Type:
double