Item Methods

String id() [required]

ID of item.

CustomItemBuilder createBuilder() [required]

Item creation process.

Example

@Override
public CustomItemBuilder createBuilder() {
    return new CustomItemBuilder(Material.DIAMOND)
        .name("Test Item")
        .loreString(List.of("&7Some lore"));
}

void improveItem(ItemStack)

To modify item meta and etc.

void itemReady(CustomItemRuntime)

Event called when item is ready to use.

Called sometimes in-game to be sure that item will not break anything so don't put big logic in it. Also good event to put your NBTStates

Example

Left and right clicks

CustomItem clicks have built-in cooldown of 1 tick (or 50ms) to fix double clicks for main hand.

Methods

Both left and right clicks can be handled with:

Item owner dealt and taken damage

CustomItem allow you to handle when item owner dealing damage to entity and taking damager from entity.

Methods

Item select and item switching hand event

CustomItem allow you handle when item is selected and deselected:

Methods

Also you can handle when player switching hand with only hotkey.

Register

See Register the item

Last updated