AttributeModifier
Link to attributemodifier
Импорт класса
Link to импорт-класса
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 Copyimport crafttweaker.api.entity.AttributeModifier;
Static Methods
Link to static-methods
Name: create
Creates a new AttributeModifier
Returns: the new attribute modifier
Return Type: AttributeModifier
ZenScript Copy// AttributeModifier.create(name as string, amount as double, operation as AttributeOperation, uuid as string) as AttributeModifier
AttributeModifier.create("My New Attribute Modifier", 11.4, AttributeOperation.ADDITION, "6d79f9c1-a4ab-4e72-a0ab-71870b89b4c6");
Параметр | Тип | Описание | Optional | DefaultValue |
---|---|---|---|---|
Параметр name | Тип string | Описание the name of this attribute modifier | Optional false | DefaultValue |
Параметр amount | Тип double | Описание the amount of this attribute modifier | Optional false | DefaultValue |
Параметр operation | Тип AttributeOperation | Описание the operation of this attribute modifier. | Optional false | DefaultValue |
Параметр uuid | Тип string | Описание the uuid of this attribute modifier, if omitted, it will use a random one. | Optional true | DefaultValue |
Методы
Link to методы
Name: getAmount
Gets the amount of this AttributeModifier.
Returns: The amount of this AttributeModifier.
Return Type: double
ZenScript Copy// AttributeModifier.getAmount() as double
myAttributeModifier.getAmount();
Name: getID
Gets the ID of this AttributeModifier.
Returns: The ID of this AttributeModifier
Return Type: string
ZenScript Copy// AttributeModifier.getID() as string
myAttributeModifier.getID();
Name: getName
Gets the name of this AttributeModifier.
Returns: The name of this AttributeModifier.
Return Type: string
ZenScript Copy// AttributeModifier.getName() as string
myAttributeModifier.getName();
Name: getOperation
Gets the operation of this AttributeModifier.
Returns: The operation of this AttributeModifier.
Return Type: AttributeOperation
ZenScript Copy// AttributeModifier.getOperation() as AttributeOperation
myAttributeModifier.getOperation();
Свойства
Link to свойства
Название | Тип | Имеет Getter | Имеет Setter | Описание |
---|---|---|---|---|
Название amount | Тип double | Имеет Getter true | Имеет Setter false | Описание Gets the amount of this AttributeModifier. |
Название id | Тип string | Имеет Getter true | Имеет Setter false | Описание Gets the ID of this AttributeModifier. |
Название name | Тип string | Имеет Getter true | Имеет Setter false | Описание Gets the name of this AttributeModifier. |
Название operation | Тип AttributeOperation | Имеет Getter true | Имеет Setter false | Описание Gets the operation of this AttributeModifier. |