1 minute estimated read time

Item builders

Normal item builder

Below is an example of an item created using the item builder.

final var item = VitalItemStack.builder()
  .type(Material.COBBLESTONE)
  .name("My custom item")
  .amount(1)
  .unbreakable(true)
  .lore({"Line 1", "Line 2"})
  .itemFlags({ItemFlag.HIDE_ATTRIBUTES})
  .enchantments(Map.of(Enchantment.DURABILITY, 1, Enchantment.MENDING, 1))
  .build();

Head item builder

Below is an example of a head item created using the head item builder.

final var head = VitalHeadItemStack.builder()
  .owningPlayer(somePlayer)
  .type(Material.COBBLESTONE)
  .name("My custom item")
  .amount(1)
  .unbreakable(true)
  .lore({"Line 1", "Line 2"})
  .itemFlags({ItemFlag.HIDE_ATTRIBUTES})
  .enchantments(Map.of(Enchantment.DURABILITY, 1, Enchantment.MENDING, 1))
  .build();

Found an issue?

Help us improve the documentation by reporting typos, missing information, or anything confusing.

Don't worry, we will auto-fill most of the annoying fields.

Create GitHub issue

This site and the Vital framework were built with ❤️ by Mike Neumann