public abstract class ItemBuilder extends Object
Constructor and Description |
---|
ItemBuilder() |
Modifier and Type | Method and Description |
---|---|
abstract ItemBuilder |
addToLore(String... loreToAdd)
Add lore to current item
|
abstract ItemBuilder |
amount(int amount)
Set the amount of the item.
|
abstract ItemStack |
build()
Build the item.
|
static ItemBuilder |
Builder(ItemStack item)
Create an ItemBuilder with a default item.
|
static ItemBuilder |
Builder(Material type)
Create an ItemBuilder with a material.
|
static ItemBuilder |
Builder(OfflinePlayer owner)
Create an ItemBuilder for SkullItem
|
static ItemBuilder |
Builder(Player owner)
Create an ItemBuilder for SkullItem
|
static ItemBuilder |
Builder(String type)
Create an ItemBuilder with a material's name.
|
abstract ItemBuilder |
color(DyeColor color)
Edit the color
Work only with colorable item like leather
|
abstract ItemBuilder |
displayName(@Nullable String displayName)
Set the display name of the item
If the display name is null, the item will take the basic minecraft name
|
abstract ItemBuilder |
enchant(Enchantment enchantment,
int level)
Add enchant to item
|
ItemBuilder |
enchantIf(boolean b)
(unsafe) Enchant the item if the condition success and hide it
|
ItemBuilder |
enchantIf(Enchantment enchant,
int level,
boolean b)
(unsafe) Enchant the item if the condition success and hide it
|
static ItemStack |
getSkullItem(OfflinePlayer cible) |
static ItemStack |
getSkullItem(Player cible)
Get the skull item showed in negativity's inventory
Display name and lore are already set, and are according to the given player cible
|
abstract ItemBuilder |
itemFlag(ItemFlag... itemFlag)
Add enchant to item
|
abstract ItemBuilder |
lore(List<String> lore)
Set lore to current item
|
abstract ItemBuilder |
lore(String... lore)
Set lore to current item
|
abstract ItemBuilder |
resetDisplayName()
Reset display name.
|
abstract ItemBuilder |
unsafeEnchant(Enchantment enchantment,
int level)
Add enchant to item without checking if it exist
As essentials, this method allow you to add enchant with level at more than max allowed by default
|
public abstract ItemBuilder displayName(@Nullable String displayName)
displayName
- the new namepublic abstract ItemBuilder resetDisplayName()
displayName(java.lang.String)
if you set a null namepublic abstract ItemBuilder enchant(Enchantment enchantment, int level)
enchantment
- the enchant namelevel
- the level of the enchantpublic abstract ItemBuilder itemFlag(ItemFlag... itemFlag)
enchantment
- the enchant namelevel
- the level of the enchantpublic abstract ItemBuilder unsafeEnchant(Enchantment enchantment, int level)
enchantment
- the enchant namelevel
- the level of the enchantpublic ItemBuilder enchantIf(boolean b)
b
- if the enchant should be appliedpublic ItemBuilder enchantIf(Enchantment enchant, int level, boolean b)
enchant
- the enchant to applylevel
- the level of the enchantb
- if the enchant should be appliedpublic abstract ItemBuilder amount(int amount)
amount
- the new amount of itempublic abstract ItemBuilder color(DyeColor color)
color
- the new item colorpublic abstract ItemBuilder lore(List<String> lore)
lore
- the new lore listpublic abstract ItemBuilder lore(String... lore)
lore
- the new lore listpublic abstract ItemBuilder addToLore(String... loreToAdd)
loreToAdd
- Lore lines which must to be addedpublic abstract ItemStack build()
public static ItemBuilder Builder(Material type)
type
- the material of the itempublic static ItemBuilder Builder(ItemStack item)
item
- the beginning itempublic static ItemBuilder Builder(String type)
type
- the type descriptor for the desired materialpublic static ItemBuilder Builder(Player owner)
owner
- the owner of the skullpublic static ItemBuilder Builder(OfflinePlayer owner)
owner
- the owner of the skullpublic static ItemStack getSkullItem(Player cible)
cible
- the owner of the skull itempublic static ItemStack getSkullItem(OfflinePlayer cible)