Class ItemBuilder
java.lang.Object
de.placeblock.betterinventories.util.ItemBuilder
Can be used to create more complex Items easier.
-
Constructor Summary
ConstructorsConstructorDescriptionItemBuilder(ItemBuilder itemBuilder) Clones another ItemBuilderItemBuilder(net.kyori.adventure.text.TextComponent title, org.bukkit.Material material) Creates a new ItemBuilderItemBuilder(net.kyori.adventure.text.TextComponent title, org.bukkit.Material material, int amount) Creates a new ItemBuilderItemBuilder(net.kyori.adventure.text.TextComponent title, org.bukkit.Material material, int amount, boolean hideInfo) Creates a new ItemBuilder -
Method Summary
Modifier and TypeMethodDescriptionattribute(org.bukkit.attribute.Attribute attribute, double amount, org.bukkit.attribute.AttributeModifier.Operation operation) Adds an attribute to the Itemorg.bukkit.inventory.ItemStackbuild()Builds the ItemStackenchantment(org.bukkit.enchantments.Enchantment enchantment, int level) Adds an enchantment to the Itemflag(org.bukkit.inventory.ItemFlag flag) Adds a Flag to the Itemlore(Collection<net.kyori.adventure.text.TextComponent> lore) Sets the lore of the Itemlore(net.kyori.adventure.text.TextComponent... lore) Sets the lore of the ItemskinTexture(URL skinTexture) Sets the skin-texture of the Item Only effective when usingMaterial.PLAYER_HEADas typeunbreakable(boolean unbreakable) Sets the unbreakable tag of the Item
-
Constructor Details
-
ItemBuilder
public ItemBuilder(net.kyori.adventure.text.TextComponent title, org.bukkit.Material material) Creates a new ItemBuilder- Parameters:
title- The title of the Itemmaterial- 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 Itemmaterial- The Material of the Itemamount- 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 Itemmaterial- The Material of the Itemamount- The amounthideInfo- Whether to hide general Information about the Item
-
ItemBuilder
Clones another ItemBuilder- Parameters:
itemBuilder- The ItemBuilder to be cloned
-
-
Method Details
-
lore
Sets the lore of the Item- Parameters:
lore- The lore- Returns:
- this
-
lore
Sets the lore of the Item- Parameters:
lore- The lore- Returns:
- this
-
enchantment
Adds an enchantment to the Item- Parameters:
enchantment- The Enchantmentlevel- 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 Attributeamount- The amount to setoperation- The operation- Returns:
- this
-
flag
Adds a Flag to the Item- Parameters:
flag- The Flag- Returns:
- this
-
unbreakable
Sets the unbreakable tag of the Item- Parameters:
unbreakable- Whether the Item is unbreakable- Returns:
- self
-
skinTexture
Sets the skin-texture of the Item Only effective when usingMaterial.PLAYER_HEADas type- Parameters:
skinTexture- The skin-texture- Returns:
- this
-
build
public org.bukkit.inventory.ItemStack build()Builds the ItemStack- Returns:
- The ItemStack
-