public final class ItemBuilder extends Object
| Constructor and Description |
|---|
ItemBuilder(@NotNull org.bukkit.inventory.ItemStack itemStack)
Deprecated.
Use
from(ItemStack) instead, it's more idiomatic for a builder |
ItemBuilder(org.bukkit.Material material)
Deprecated.
Use
from(Material) instead, it's more idiomatic for a builder |
| Modifier and Type | Method and Description |
|---|---|
ItemBuilder |
addEnchantment(@NotNull org.bukkit.enchantments.Enchantment enchantment)
Add enchantment to an item
|
ItemBuilder |
addEnchantment(@NotNull org.bukkit.enchantments.Enchantment enchantment,
int level)
Add enchantment to an item
|
ItemBuilder |
addEnchantment(@NotNull org.bukkit.enchantments.Enchantment enchantment,
int level,
boolean ignoreLevelRestriction)
Add enchantment to an item
|
ItemBuilder |
addItemFlags(org.bukkit.inventory.ItemFlag... flags)
Add a custom
ItemFlag to the item |
GuiItem |
asGuiItem() |
GuiItem |
asGuiItem(@NotNull GuiAction<org.bukkit.event.inventory.InventoryClickEvent> action) |
org.bukkit.inventory.ItemStack |
build()
Builds the item into
ItemStack |
static ItemBuilder |
from(@NotNull org.bukkit.inventory.ItemStack itemStack)
Main method to create
ItemBuilder |
static ItemBuilder |
from(@NotNull org.bukkit.Material material)
Alternative method to create
ItemBuilder |
ItemBuilder |
glow(boolean glow)
Makes the Item glow
|
ItemBuilder |
removeEnchantment(@NotNull org.bukkit.enchantments.Enchantment enchantment)
Removes a certain
Enchantment from the item |
ItemBuilder |
setAmount(int amount)
Sets the amount of items
|
ItemBuilder |
setLore(@NotNull List<String> lore)
Set the lore lines of an item
|
ItemBuilder |
setLore(String... lore)
Set the lore lines of an item
|
ItemBuilder |
setName(@NotNull String name)
Set display name of the item
|
ItemBuilder |
setNbt(@NotNull String key,
@NotNull String value)
Sets NBT tag to the
ItemStack |
ItemBuilder |
setSkullOwner(@NotNull org.bukkit.OfflinePlayer player)
Sets skull owner via bukkit methods
|
ItemBuilder |
setSkullTexture(@NotNull String texture)
Sets the skull texture
|
ItemBuilder |
setUnbreakable(boolean unbreakable)
Sets the item as unbreakable
|
@Deprecated public ItemBuilder(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
from(ItemStack) instead, it's more idiomatic for a builderitemStack - The ItemStack of the item@Deprecated public ItemBuilder(org.bukkit.Material material)
from(Material) instead, it's more idiomatic for a builderMaterialmaterial - The Material of the ItemStackpublic static ItemBuilder from(@NotNull @NotNull org.bukkit.inventory.ItemStack itemStack)
ItemBuilderitemStack - The ItemStack you want to editItemBuilderpublic static ItemBuilder from(@NotNull @NotNull org.bukkit.Material material)
ItemBuildermaterial - The Material you want to create an item fromItemBuilderpublic org.bukkit.inventory.ItemStack build()
ItemStackItemStackpublic GuiItem asGuiItem()
public GuiItem asGuiItem(@NotNull @NotNull GuiAction<org.bukkit.event.inventory.InventoryClickEvent> action)
public ItemBuilder setName(@NotNull @NotNull String name)
name - the display name of the itemItemBuilderpublic ItemBuilder setAmount(int amount)
amount - the amount of itemsItemBuilderpublic ItemBuilder setLore(@NotNull String... lore)
lore - the lore lines to setItemBuilderpublic ItemBuilder setLore(@NotNull @NotNull List<String> lore)
lore - A List with the lore linesItemBuilderpublic ItemBuilder addEnchantment(@NotNull @NotNull org.bukkit.enchantments.Enchantment enchantment, int level, boolean ignoreLevelRestriction)
enchantment - the Enchantment to addlevel - the level of the EnchantmentignoreLevelRestriction - If should or not ignore itItemBuilderpublic ItemBuilder addEnchantment(@NotNull @NotNull org.bukkit.enchantments.Enchantment enchantment, int level)
enchantment - the Enchantment to addlevel - the level of the EnchantmentItemBuilderpublic ItemBuilder addEnchantment(@NotNull @NotNull org.bukkit.enchantments.Enchantment enchantment)
enchantment - the Enchantment to addItemBuilderpublic ItemBuilder removeEnchantment(@NotNull @NotNull org.bukkit.enchantments.Enchantment enchantment)
Enchantment from the itemenchantment - The Enchantment to removeItemBuilderpublic ItemBuilder addItemFlags(@NotNull org.bukkit.inventory.ItemFlag... flags)
ItemFlag to the itemflags - the ItemFlag to addItemBuilderpublic ItemBuilder setUnbreakable(boolean unbreakable)
unbreakable - If should or not be unbreakableItemBuilderpublic ItemBuilder glow(boolean glow)
glow - Should the item glowItemBuilderpublic ItemBuilder setSkullTexture(@NotNull @NotNull String texture)
texture - The base64 textureItemBuilderpublic ItemBuilder setSkullOwner(@NotNull @NotNull org.bukkit.OfflinePlayer player)
player - OfflinePlayer to set skull ofItemBuilderpublic ItemBuilder setNbt(@NotNull @NotNull String key, @NotNull @NotNull String value)
ItemStackkey - The NBT keyvalue - The NBT valueItemBuilderCopyright © 2020. All rights reserved.