Skip to content

ItemBuilder

Hakan Kargın edited this page Jun 1, 2022 · 1 revision

How To Use

HItemBuilder

HItemBuilder class is a builder class for creating stack basicly. With this feature you can easily create and manage items.

Example

HItemBuilder itemBuilder = new HItemBuilder(Material.DIAMOND_SWORD) // creates HItemBuilder with type Material.DIAMOND
        .name("test") // changes name as "test"
        .glow(true) // sets glow status as true
        .addItemFlags(ItemFlag.HIDE_ENCHANTS) // adds item flag
        .addEnchant(Enchantment.DAMAGE_ALL, 1); // adds Enchantment.DAMAGE_ALL with level 1
ItemStack item = itemBuilder.build(); // Creates item stack from builder.
Clone this wiki locally