Negative Games Wiki
Discord
  • 👋Landing
  • 🎬Projects
    • 👮Punishments
      • 🖋️Commands
      • 📜Configuration
        • main.yml
        • messages.yml
        • Menus
          • history-main.yml
          • history.yml
          • note-delete-confirmation.yml
          • note-editor.yml
          • notes.yml
          • punish-confirm.yml
          • punish.yml
          • records-main.yml
          • records.yml
          • records-single.yml
          • staff-history-main.yml
          • staff-history.yml
          • staff-leaderboard.yml
    • 📑alumina
      • ItemBuilder
      • PotionBuilder
      • InputListener
      • Commands
      • DependencyLoader
      • Events Subscriber
      • Static Logger
Powered by GitBook
On this page

Was this helpful?

  1. Projects
  2. alumina

ItemBuilder

The ItemBuilder class is expansive, allowing you to customize your ItemStack in many ways in a builder environment.

There are over 30 methods in the ItemBuilder for you to use to customize your ItemStack!

Example

In this example, we make a Diamond Sword with a custom name, lore, and enchantments.

ItemStack sword = new ItemBuilder(Material.DIAMOND_SWORD)
    .setName("<red>Amazing Sword") // Names are in MiniMessage format
    //.setName(Component.text("Amazing Sword")) // or alternatively in Component format
                
    .setLore("<gray>It's amazing!") // Lore is in MiniMessage format
    //.setLore(Component.text("It's amazing!")) // or alternatively in Component format

    .addEnchantment(Enchantment.DAMAGE_ALL, 5)
    .addEnchantment(Enchantment.DURABILITY, 3)
    .build();

PreviousaluminaNextPotionBuilder

Last updated 1 year ago

Was this helpful?

🎬
📑