The Item Provider features a powerful ItemBuilder that makes creating and modifying complex ItemStack objects simple and expressive.

Creating an Item

Use the fluent API to define your item's properties.

ItemStack myItem = Core.item.create(Material.DIAMOND_SWORD)
    .name("<gold>Excalibur")
    .lore("<gray>A legendary blade.")
    .enchant(Enchantment.SHARPNESS, 5, true)
    .unbreakable(true)
    .build();

Editing an Existing Item

You can also wrap an existing ItemStack to edit it.

// Directly edits "someItem"
ItemBuilder builder = Core.item.edit(someItem)
    .amount(64);

// ...or you can create a clone with the edits
ItemStack cloneWithEdits = builder.build();