Home Migration Guide Getting Started With Scripts Commands Examples
BracketHandlers

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

Extending MCItemDefinition

ArmorItem extends MCItemDefinition. That means all methods available in MCItemDefinition 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

Gets the armor material of this Armor Item.

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

script.zs
// ArmorItem.getArmorMaterial() as IArmorMaterial
myArmorItem.getArmorMaterial();

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

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

Gets the equipment slot that this armor item goes into.

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

script.zs
// ArmorItem.getEquipmentSlot() as MCEquipmentSlotType
myArmorItem.getEquipmentSlot();

Gets the toughness of this Armor Item.

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

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

Properties

NameTypeHas GetterHas SetterDescription
Name
armorMaterial
Type
IArmorMaterial
Has Getter
true
Has Setter
false
Description
Gets the armor material of this Armor Item.
Name
damageReduceAmount
Type
int
Has Getter
true
Has Setter
false
Description
Gets the damage reduce amount of this Armor Item. This is how much armor protection this item applies.
Name
equipmentSlot
Type
MCEquipmentSlotType
Has Getter
true
Has Setter
false
Description
Gets the equipment slot that this armor item goes into.
Name
toughness
Type
float
Has Getter
true
Has Setter
false
Description
Gets the toughness of this Armor Item.