Импорт класса

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
Copy
import crafttweaker.api.item.armor.ArmorItem;

Extending MCItemDefinition

Link to extending-mcitemdefinition

ArmorItem extends MCItemDefinition. That means all methods available in MCItemDefinition are also available in ArmorItem

Implemented Interfaces

Link to implemented-interfaces

ArmorItem implements the following interfaces. That means all methods defined in these interfaces are also available in ArmorItem

Link to getArmorMaterial

Name: getArmorMaterial

Gets the armor material of this Armor Item.

Returns: The IArmorMaterial of this Armor Item.
Return Type: IArmorMaterial

ZenScript
Copy
// ArmorItem.getArmorMaterial() as IArmorMaterial

myArmorItem.getArmorMaterial();

Link to getDamageReduceAmount

Name: getDamageReduceAmount

Gets the damage reduce amount of this Armor Item. This is how much armor protection this item applies.

Returns: The damage reduce amount of this Armor Item.
Return Type: int

ZenScript
Copy
// ArmorItem.getDamageReduceAmount() as int

myArmorItem.getDamageReduceAmount();

Link to getEquipmentSlot

Name: getEquipmentSlot

Gets the equipment slot that this armor item goes into.

Returns: The EquipmentSlotType that thsi armor item goes into.
Return Type: MCEquipmentSlotType

ZenScript
Copy
// ArmorItem.getEquipmentSlot() as MCEquipmentSlotType

myArmorItem.getEquipmentSlot();

Name: getToughness

Gets the toughness of this Armor Item.

Returns: The toughness of this Armor Item.
Return Type: float

ZenScript
Copy
// ArmorItem.getToughness() as float

myArmorItem.getToughness();

Свойства

Link to свойства

НазваниеТипИмеет GetterИмеет SetterОписание
Название
armorMaterial
Тип
IArmorMaterial
Имеет Getter
true
Имеет Setter
false
Описание
Gets the armor material of this Armor Item.
Название
damageReduceAmount
Тип
int
Имеет Getter
true
Имеет Setter
false
Описание
Gets the damage reduce amount of this Armor Item. This is how much armor protection this item applies.
Название
equipmentSlot
Тип
MCEquipmentSlotType
Имеет Getter
true
Имеет Setter
false
Описание
Gets the equipment slot that this armor item goes into.
Название
toughness
Тип
float
Имеет Getter
true
Имеет Setter
false
Описание
Gets the toughness of this Armor Item.