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.type.armor.ArmorItem;

Extending ItemDefinition

Link to extending-itemdefinition

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

已实现的接口

Link to 已实现的接口

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

Name: getDefense

Return Type: int

ZenScript
Copy
// ArmorItem.getDefense() as int

myArmorItem.getDefense();

Name: getEquipSound

Return Type: SoundEvent?

ZenScript
Copy
// ArmorItem.getEquipSound() as SoundEvent?

myArmorItem.getEquipSound();

Name: getMaterial

Return Type: ArmorMaterial

ZenScript
Copy
// ArmorItem.getMaterial() as ArmorMaterial

myArmorItem.getMaterial();

Name: getSlot

Return Type: EquipmentSlot

ZenScript
Copy
// ArmorItem.getSlot() as EquipmentSlot

myArmorItem.getSlot();

Name: getToughness

Return Type: float

ZenScript
Copy
// ArmorItem.getToughness() as float

myArmorItem.getToughness();
名称类型可获得可设置
名称
defense
类型
int
可获得
true
可设置
false
名称
equipSound
类型
SoundEvent?
可获得
true
可设置
false
名称
material
类型
ArmorMaterial
可获得
true
可设置
false
名称
slot
类型
EquipmentSlot
可获得
true
可设置
false
名称
toughness
类型
float
可获得
true
可设置
false