Using ItemBuilder - TypicalFin/PluginCore GitHub Wiki


// You can optionally omit the item amount in the ItemBuilder constructor. The default item amount is 1.
final ItemStack apple = new ItemBuilder(Material.APPLE, 16)
        .setLore("&fThis is an apple.")
        .addEnchantment(Enchantment.DURABILITY, 1)

// Do note that all of these setters aren't mandatory. As an example, you can make an item with only a custom name.

The example code would result in the following item:


(16 apples with a green Apple display name and This is an apple. lore. Enchanted with Unbreaking I and an added item flag that hides enchantments)