Class ItemBuilder
java.lang.Object
com.shanebeestudios.snippets.item.ItemBuilder
ItemBuilder class to quickly/easily create
ItemStacks
with chained methods-
Method Summary
Modifier and TypeMethodDescriptionaddEnchant
(Enchantment enchantment, int level) Add an enchantment to the itemAdd a line of lore to the itemamount
(int amount) Set the amount of the itemattribute
(Attribute attribute, AttributeModifier modifier) Add an attribute modifier to the itemstatic ItemBuilder
Create a new ItemBuilderstatic ItemBuilder
Create a new ItemBuildercustomModelData
(int model) Set the custom model data of the itemitem()
Get the ItemStack from this builderSet the lore of the itemSet the name of the itemMake the item unbreakable
-
Method Details
-
builder
Create a new ItemBuilderDefaults amount = 1
- Parameters:
material
- Material of Item- Returns:
- Instance of ItemBuilder
-
builder
Create a new ItemBuilder- Parameters:
material
- Material of Itemamount
- Amount of items in stack- Returns:
- Instance of ItemBuilder
-
amount
Set the amount of the item- Parameters:
amount
- Amount of the item- Returns:
- Instance of ItemBuilder
-
name
Set the name of the item- Parameters:
name
- Name of the item- Returns:
- Instance of ItemBuilder
-
addEnchant
Add an enchantment to the item- Parameters:
enchantment
- Enchantment to addlevel
- Level of enchantment to add- Returns:
- Instance of ItemBuilder
-
lore
Set the lore of the item- Parameters:
lores
- Lore to set- Returns:
- Instance of ItemBuilder
-
addLore
Add a line of lore to the item- Parameters:
lore
- Lore to add- Returns:
- Instance of ItemBuilder
-
unbreakable
Make the item unbreakable- Returns:
- Instance of ItemBuilder
-
customModelData
Set the custom model data of the item- Parameters:
model
- Custom model data of the item- Returns:
- Instance of ItemBuilder
-
attribute
Add an attribute modifier to the item- Parameters:
attribute
- Attribute to addmodifier
- Attribute modifier to add- Returns:
- Instance of ItemBuilder
-
item
Get the ItemStack from this builder- Returns:
- ItemStack from builder
-