Home Migration Guide Getting Started With Scripts Commands Examples
BracketHandlers

IArmorMaterial

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.IArmorMaterial;

Methods

Gets the armor value of this material in the given slot. This is how many armor pieces this material fills in the armor bar.

Returns: The armor value of this material in the given slot.
Return Type: int

script.zs
IArmorMaterial.getDamageReductionAmount(slotIn as MCEquipmentSlotType) as int
ParameterTypeDescription
Parameter
slotIn
Type
MCEquipmentSlotType
Description
The slot to get the value of.

Gets the default durability of Armor pieces made from this material in the given slot.

Returns: The default durability of the armor piece.
Return Type: int

script.zs
IArmorMaterial.getDurability(slotIn as MCEquipmentSlotType) as int
ParameterTypeDescription
Parameter
slotIn
Type
MCEquipmentSlotType
Description
The slot to get the value of.

Gets the enchantability of this material.

Returns: The enchantability of this material.
Return Type: int

script.zs
// IArmorMaterial.getEnchantability() as int
myIArmorMaterial.getEnchantability();

Gets the knockback resistance of this material.

Returns: The knockback resistance of this material.
Return Type: float

script.zs
// IArmorMaterial.getKnockbackResistance() as float
myIArmorMaterial.getKnockbackResistance();

Gets the repair material of this material.

Returns: The repair material of this material.
Return Type: IIngredient

script.zs
// IArmorMaterial.getRepairMaterial() as IIngredient
myIArmorMaterial.getRepairMaterial();

Gets the toughness of this material.

Returns: The toughness of this material.
Return Type: float

script.zs
// IArmorMaterial.getToughness() as float
myIArmorMaterial.getToughness();

Properties

NameTypeHas GetterHas SetterDescription
Name
enchantability
Type
int
Has Getter
true
Has Setter
false
Description
Gets the enchantability of this material.
Name
knockbackResistance
Type
float
Has Getter
true
Has Setter
false
Description
Gets the knockback resistance of this material.
Name
repairMaterial
Type
IIngredient
Has Getter
true
Has Setter
false
Description
Gets the repair material of this material.
Name
toughness
Type
float
Has Getter
true
Has Setter
false
Description
Gets the toughness of this material.