ItemBuilder

An item builder class. The only required parameter to initialize this is material, then you can use the methods in the builder to build the item.
class ItemBuilder(material: Material,amount: Int,damage: Int,name: String?,lore: MutableList<String>,enchantments: MutableMap<Enchantment, Int>,glow: Boolean,unbreakable: Boolean,itemflags: MutableList<ItemFlag>) : Supplier

See also

createItem
Link copied to clipboard

Constructors

<init>
Link copied to clipboard
fun <init>(material: Material, amount: Int, damage: Int, name: String?, lore: MutableList<String>, enchantments: MutableMap<Enchantment, Int>, glow: Boolean, unbreakable: Boolean, itemflags: MutableList<ItemFlag>)

Functions

addEnchantment
Link copied to clipboard
Add a single enchantment to an item
fun addEnchantment(newenchantment: Enchantment, level: Int): ItemBuilder
addEnchantments
Link copied to clipboard
Add a map of newenchantments the enchantment map to add
fun addEnchantments(newenchantments: Map<Enchantment, Int>): ItemBuilder
addItemFlag
Link copied to clipboard
Add a single item flag to an item
fun addItemFlag(newitemflag: ItemFlag): ItemBuilder
addItemFlags
Link copied to clipboard
Add a list of item flags to an item
fun addItemFlags(newitemflags: List<ItemFlag>): ItemBuilder
addLore
Link copied to clipboard
Add a list of lores to an item
fun addLore(newlores: List<String>): ItemBuilder
Add a single line lore to the item
fun addLore(newlore: String): ItemBuilder
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
get
Link copied to clipboard
open override fun get(): ItemStack
hashCode
Link copied to clipboard
open override fun hashCode(): Int
setAmount
Link copied to clipboard
Set a new amount for the item
fun setAmount(newamt: Int): ItemBuilder
setDamage
Link copied to clipboard
Set the damage for the item
fun setDamage(newdamage: Int): ItemBuilder
setGlow
Link copied to clipboard
Set the item to glow or not
fun setGlow(newglow: Boolean): ItemBuilder
setName
Link copied to clipboard
Set the name for the item
fun setName(newname: String): ItemBuilder
setUnbreakable
Link copied to clipboard
Set if the item should be unbreakable or not
fun setUnbreakable(newunbreakable: Boolean): ItemBuilder
toString
Link copied to clipboard
open override fun toString(): String