Diese Klasse importieren

Link to diese-klasse-importieren

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
Copy
import crafttweaker.api.entity.attribute.Attribute;
Result TypeIs Implicit
Result Type
string
Is Implicit
false

Link to getCommandString

Name: getCommandString

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

ZenScript
Copy
// Attribute.getCommandString() as string

myAttribute.getCommandString();

Name: getDefaultValue

Gets the default value for this Attribute.

Returns: The default value for this Attribute.
Return Type: double

ZenScript
Copy
// Attribute.getDefaultValue() as double

myAttribute.getDefaultValue();

Link to isClientSyncable

Name: isClientSyncable

Should this attribute be synced to the client.

Returns: True if synced. False otherwise.
Return Type: boolean

ZenScript
Copy
// Attribute.isClientSyncable() as boolean

myAttribute.isClientSyncable();

Name: sanitizeValue

Sanitizes the given value for this Attribute.

Returns: The sanitized value.
Return Type: double

ZenScript
Copy
// Attribute.sanitizeValue(value as double) as double

myAttribute.sanitizeValue(4);
ParameterTypeBeschreibung
Parameter
value
Type
double
Beschreibung
The given value to sanitized.
NameTypeHas GetterHas SetterBeschreibung
Name
clientSyncable
Type
boolean
Has Getter
true
Has Setter
false
Beschreibung
Should this attribute be synced to the client.
Name
commandString
Type
string
Has Getter
true
Has Setter
false
Beschreibung
Gets the attribute bracket handler syntax for this Attribute.

E.G.
<attribute:minecraft:generic.max_health>
Name
defaultValue
Type
double
Has Getter
true
Has Setter
false
Beschreibung
Gets the default value for this Attribute.