Class ItemBuilder

java.lang.Object
de.placeblock.betterinventories.util.ItemBuilder

public class ItemBuilder extends Object
Can be used to create more complex Items easier.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ItemBuilder(ItemBuilder itemBuilder)
    Clones another ItemBuilder
    ItemBuilder(net.kyori.adventure.text.TextComponent title, org.bukkit.Material material)
    Creates a new ItemBuilder
    ItemBuilder(net.kyori.adventure.text.TextComponent title, org.bukkit.Material material, int amount)
    Creates a new ItemBuilder
    ItemBuilder(net.kyori.adventure.text.TextComponent title, org.bukkit.Material material, int amount, boolean hideInfo)
    Creates a new ItemBuilder
    ItemBuilder(org.bukkit.Material material)
    Creates a new ItemBuilder
  • Method Summary

    Modifier and Type
    Method
    Description
    attribute(org.bukkit.attribute.Attribute attribute, double amount, org.bukkit.attribute.AttributeModifier.Operation operation)
    Adds an attribute to the Item
    org.bukkit.inventory.ItemStack
    Builds the ItemStack
    enchantment(org.bukkit.enchantments.Enchantment enchantment, int level)
    Adds an enchantment to the Item
    flag(org.bukkit.inventory.ItemFlag flag)
    Adds a Flag to the Item
    lore(Collection<net.kyori.adventure.text.TextComponent> lore)
    Sets the lore of the Item
    lore(net.kyori.adventure.text.TextComponent... lore)
    Sets the lore of the Item
    skinTexture(URL skinTexture)
    Sets the skin-texture of the Item Only effective when using Material.PLAYER_HEAD as type
    unbreakable(boolean unbreakable)
    Sets the unbreakable tag of the Item

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ItemBuilder

      public ItemBuilder(org.bukkit.Material material)
      Creates a new ItemBuilder
      Parameters:
      material - The Material of the Item
    • ItemBuilder

      public ItemBuilder(net.kyori.adventure.text.TextComponent title, org.bukkit.Material material)
      Creates a new ItemBuilder
      Parameters:
      title - The title of the Item
      material - The Material of the Item
    • ItemBuilder

      public ItemBuilder(net.kyori.adventure.text.TextComponent title, org.bukkit.Material material, int amount)
      Creates a new ItemBuilder
      Parameters:
      title - The title of the Item
      material - The Material of the Item
      amount - The amount
    • ItemBuilder

      public ItemBuilder(net.kyori.adventure.text.TextComponent title, org.bukkit.Material material, int amount, boolean hideInfo)
      Creates a new ItemBuilder
      Parameters:
      title - The title of the Item
      material - The Material of the Item
      amount - The amount
      hideInfo - Whether to hide general Information about the Item
    • ItemBuilder

      public ItemBuilder(ItemBuilder itemBuilder)
      Clones another ItemBuilder
      Parameters:
      itemBuilder - The ItemBuilder to be cloned
  • Method Details

    • lore

      public ItemBuilder lore(net.kyori.adventure.text.TextComponent... lore)
      Sets the lore of the Item
      Parameters:
      lore - The lore
      Returns:
      this
    • lore

      public ItemBuilder lore(Collection<net.kyori.adventure.text.TextComponent> lore)
      Sets the lore of the Item
      Parameters:
      lore - The lore
      Returns:
      this
    • enchantment

      public ItemBuilder enchantment(org.bukkit.enchantments.Enchantment enchantment, int level)
      Adds an enchantment to the Item
      Parameters:
      enchantment - The Enchantment
      level - The level of the Enchantment
      Returns:
      this
    • attribute

      public ItemBuilder attribute(org.bukkit.attribute.Attribute attribute, double amount, org.bukkit.attribute.AttributeModifier.Operation operation)
      Adds an attribute to the Item
      Parameters:
      attribute - The Attribute
      amount - The amount to set
      operation - The operation
      Returns:
      this
    • flag

      public ItemBuilder flag(org.bukkit.inventory.ItemFlag flag)
      Adds a Flag to the Item
      Parameters:
      flag - The Flag
      Returns:
      this
    • unbreakable

      public ItemBuilder unbreakable(boolean unbreakable)
      Sets the unbreakable tag of the Item
      Parameters:
      unbreakable - Whether the Item is unbreakable
      Returns:
      self
    • skinTexture

      public ItemBuilder skinTexture(URL skinTexture)
      Sets the skin-texture of the Item Only effective when using Material.PLAYER_HEAD as type
      Parameters:
      skinTexture - The skin-texture
      Returns:
      this
    • build

      public org.bukkit.inventory.ItemStack build()
      Builds the ItemStack
      Returns:
      The ItemStack