ArmorItem
Link to armoritem
导入类
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 Copyimport 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
已实现的接口
Link to 已实现的接口
ArmorItem implements the following interfaces. That means all methods defined in these interfaces are also available in ArmorItem
使用方式
Link to 使用方式
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();
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();
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();
名称 | 类型 | 可获得 | 可设置 | 描述 |
---|---|---|---|---|
名称 armorMaterial | 类型 IArmorMaterial | 可获得 true | 可设置 false | 描述 Gets the armor material of this Armor Item. |
名称 damageReduceAmount | 类型 int | 可获得 true | 可设置 false | 描述 Gets the damage reduce amount of this Armor Item. This is how much armor protection this item applies. |
名称 equipmentSlot | 类型 MCEquipmentSlotType | 可获得 true | 可设置 false | 描述 Gets the equipment slot that this armor item goes into. |
名称 toughness | 类型 float | 可获得 true | 可设置 false | 描述 Gets the toughness of this Armor Item. |