ToolItem

class ToolItem(name: String, material: Material = Material.DIAMOND_PICKAXE)

Represents a custom tool item with configurable attributes like attack damage, attack speed, and durability.

This class allows creating custom tool items such as pickaxes, axes, shovels, etc., with the ability to modify their attack damage, attack speed, and durability. The item can also be marked as unbreakable and given special attributes like glow effects and lore.

Parameters

name

The name of the tool item.

material

The material type of the tool item. Default is Material.DIAMOND_PICKAXE.

Constructors

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

Functions

Link copied to clipboard

Sets the attack damage of the tool item.

Link copied to clipboard

Sets the attack speed of the tool item.

Link copied to clipboard

Builds and returns the CustomItem representation of the tool item.

Link copied to clipboard
fun durability(durability: Int): ToolItem

Sets the durability (damage) of the tool item.

Link copied to clipboard
fun glow(): ToolItem

Adds a glowing effect to the tool item.

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

Adds lore (descriptive text) to the tool item.

Link copied to clipboard

Marks the tool item as unbreakable.