⭐
StarAPI Documentation
  • ⭐API Information
    • ❔About Our API's
    • ⬇️Installing Our API
  • 🌟StarAPI (Spigot/Paper)
    • 📂Abilities
      • ⏳Transmition
      • 🤯Implosion
      • 🏹MultiShot
    • 📂Builders
      • 👕Armor Builder
      • 📊Bossbar Builder
      • ☄️Command Builder
      • ⚔️Item Builder
      • 🧟‍♂️Mob Builder
      • 💯Scoreboard Builder
      • 🔗Webhook Builder
      • 🔨Message Builder
      • 🏗️Actionbar Builder
    • 📂Files
      • 📃Create Files
      • 📁Create Folders
      • 📖Read Files
      • 🖊️Write Files
    • 📂Inventory Utilities
      • 💎Animated Items
      • 📖Book Content
      • 📔Book GUI
      • 🎞️Filler
      • 🪁Inventory Items
      • 📝Inventory Name
      • 💀Inventory Skulls
    • 📂Message Utilities
      • 🤖Auto Responses
      • 🎨Message Colors
    • 📂Recipes
      • ⚒️Crafting Recipes
      • 🧑‍🍳Furnace Recipes
    • 📂Timers
      • 🕙Active Timers
      • ❌Cancel Timers
      • 🕙Delayed Timers
      • 🕐Create Timers
    • 📂Misc
      • 💀Give Skulls
      • 📈Progress Bars
      • ⬛Block Placer
Powered by GitBook
On this page
  • Overview
  • Constructor
  • Methods
  • Notes
  1. StarAPI (Spigot/Paper)
  2. Builders

Item Builder

Create items with ease with this builder.

Overview

The ItemBuilder class simplifies the construction of custom ItemStacks in a Minecraft Bukkit server environment. It provides methods for setting properties such as amount, display name, lore, enchantments, attributes, and item flags, allowing for flexible and convenient item customization.

Constructor

ItemBuilder

public ItemBuilder(Material material)

Initializes a new instance of the ItemBuilder class with the specified material type.

Parameters

  • material: The material type of the item to be constructed.

Methods

amount

public ItemBuilder amount(int amount)

Sets the amount of the item.

displayName

public ItemBuilder displayName(String displayName)

Sets the display name of the item.

lore

public ItemBuilder lore(String... lore)

Sets the lore of the item.

enchant

public ItemBuilder enchant(Enchantment enchantment, int level)

Enchants the item with the specified enchantment and level.

attribute

public ItemBuilder attribute(Attribute attribute, AttributeModifier modifier)

Sets an attribute modifier for the item.

flags

public ItemBuilder flags(ItemFlag... flags)

Sets item flags for the item.

build

public ItemStack build()

Builds and returns the constructed ItemStack.

Notes

  • The ItemBuilder class allows for the creation of custom ItemStacks with various properties and attributes.

  • Developers can easily configure the amount, display name, lore, enchantments, attributes, and flags of the item using the provided methods.

  • Custom ItemStacks created using this builder pattern can enhance gameplay by providing players with unique and tailored items for use in the game.

PreviousCommand BuilderNextMob Builder

Last updated 1 year ago

🌟
📂
⚔️