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.

script.zs
import crafttweaker.api.entity.attribute.Attribute;

Members

Getter
Should this attribute be synced to the client.
script.zs
// Attribute.clientSyncable as bool
myAttribute.clientSyncable

Return Type: bool

clientSyncable() as bool
Should this attribute be synced to the client.

Returns: True if synced. False otherwise.

script.zs
// Attribute.clientSyncable() as bool;
myAttribute.clientSyncable();

Return Type: bool

Getter
Gets the attribute bracket handler syntax for this Attribute.
E.G. <attribute:minecraft:generic.max_health>
script.zs
// Attribute.commandString as string
myAttribute.commandString

Return Type: string

commandString() as string
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.

script.zs
// Attribute.commandString() as string;
myAttribute.commandString();

Return Type: string

as string
Gets the attribute bracket handler syntax for this Attribute.
E.G. <attribute:minecraft:generic.max_health>
script.zs
// Attribute as string
myAttribute as string

Return Type: string

Getter
Gets the default value for this Attribute.
script.zs
// Attribute.defaultValue as double
myAttribute.defaultValue

Return Type: double

defaultValue() as double
Gets the default value for this Attribute.

Returns: The default value for this Attribute.

script.zs
// Attribute.defaultValue() as double;
myAttribute.defaultValue();

Return Type: double

Getter
script.zs
// Attribute.registryName as ResourceLocation
myAttribute.registryName

Return Type: ResourceLocation

registryName() as ResourceLocation
script.zs
// Attribute.registryName() as ResourceLocation;
myAttribute.registryName();

Return Type: ResourceLocation

sanitizeValue(value as double) as double
Sanitizes the given value for this Attribute.

Returns: The sanitized value.

script.zs
// Attribute.sanitizeValue(value as double) as double;
myAttribute.sanitizeValue(4);

Parameters:

value Type: double - The given value to sanitized.

Return Type: double