Home Commands Examples Getting Started With Scripts Global Keywords
BracketDumpers BracketHandlers BracketValidators ResourceLocationBracketHandler

ArmorItem

Importing the class

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.

script.zs
import crafttweaker.api.item.type.armor.ArmorItem;

Extending ItemDefinition

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

Implemented Interfaces

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

Methods

Return Type: int

script.zs
// ArmorItem.getDefense() as int
myArmorItem.getDefense();

Return Type: SoundEvent?

script.zs
// ArmorItem.getEquipSound() as SoundEvent?
myArmorItem.getEquipSound();

Return Type: ArmorMaterial

script.zs
// ArmorItem.getMaterial() as ArmorMaterial
myArmorItem.getMaterial();

Return Type: EquipmentSlot

script.zs
// ArmorItem.getSlot() as EquipmentSlot
myArmorItem.getSlot();

Return Type: float

script.zs
// ArmorItem.getToughness() as float
myArmorItem.getToughness();

Properties

NameTypeHas GetterHas Setter
Name
defense
Type
int
Has Getter
true
Has Setter
false
Name
equipSound
Type
SoundEvent?
Has Getter
true
Has Setter
false
Name
material
Type
ArmorMaterial
Has Getter
true
Has Setter
false
Name
slot
Type
EquipmentSlot
Has Getter
true
Has Setter
false
Name
toughness
Type
float
Has Getter
true
Has Setter
false