ArmorItem

class ArmorItem(name: String, material: Material)

Represents a custom armor item with customizable attributes and properties.

This class allows the creation of armor items with specific attributes such as armor points, toughness, knockback resistance, and durability. It also supports setting item properties like unbreakability, glow effects, and lore.

The created armor item can be used as a CustomItem which can be registered and given to players.

Parameters

name

The name of the armor item.

material

The Material of the armor item (e.g., DIAMOND_HELMET, IRON_CHESTPLATE).

Constructors

Link copied to clipboard
constructor(name: String, material: Material)

Functions

Link copied to clipboard
fun armor(points: Double): ArmorItem

Sets the armor points of the armor item.

Link copied to clipboard

Builds and returns the CustomItem representation of the armor item.

Link copied to clipboard
fun durability(amount: Int): ArmorItem

Sets the durability of the armor item.

Link copied to clipboard

Adds a glowing effect to the armor item.

Link copied to clipboard

Sets the knockback resistance of the armor item.

Link copied to clipboard
fun lore(vararg lines: String): ArmorItem

Adds lore to the armor item.

Link copied to clipboard
fun slot(slot: EquipmentSlotGroup): ArmorItem

Sets the equipment slot of the armor item (HEAD, CHEST, LEGS, FEET).

Link copied to clipboard
fun toughness(points: Double): ArmorItem

Sets the armor toughness of the armor item.

Link copied to clipboard
fun unbreakable(flag: Boolean = true): ArmorItem

Sets whether the armor item is unbreakable.