Class Items
- java.lang.Object
-
- me.bimmr.bimmcore.items.Items
-
public class Items extends java.lang.Object
A Utilities class for easy to manage Items
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
INVALID_ITEM
-
Method Summary
Modifier and Type Method Description Items
addAttribute(java.lang.String attribute, java.lang.String slot, double level, java.lang.String operation)
Add Item AttributeItems
addAttribute(AttributeType attribute, Slot slot, double level, Operation operation)
Add Item Attribute using BimmCoreItems
addAttribute(org.bukkit.attribute.Attribute attribute, org.bukkit.inventory.EquipmentSlot slot, double level, org.bukkit.attribute.AttributeModifier.Operation operation)
Add Item Attribute using BukkitItems
addBannerPattern(org.bukkit.block.banner.Pattern pattern)
Add Banner PatternItems
addEnchantment(org.bukkit.enchantments.Enchantment value, int level)
Add EnchantmentItems
addFireworkEffect(org.bukkit.FireworkEffect fireworkEffect)
Add FireworkEffectItems
addFlag(org.bukkit.inventory.ItemFlag flag)
Add a Flag to an ItemItems
addGlow()
Add Item glowItems
addLore(java.lang.String value)
Add Item to Lore CallsaddLore(String...)
Items
addLore(java.lang.String... value)
Add Item to LoreItems
addPage(java.lang.String value)
Add Item to PagesItems
addPotionEffect(org.bukkit.potion.PotionEffect value)
Add PotionEffectboolean
equals(Items item, boolean useLore)
Check if 2 items are equalItems
fromString(java.lang.String string)
Load the item from a stringorg.bukkit.inventory.ItemStack
getItem()
Gets item.org.bukkit.inventory.meta.ItemMeta
getItemMeta()
Gets item meta.java.lang.String
getTexture()
boolean
hasItemMeta()
Has item meta boolean.Items
setAmount(int value)
Set AmountItems
setBookAuthor(java.lang.String value)
Set Book AuthorItems
setBookTitle(java.lang.String value)
Set Book TitleItems
setDamage(int value)
Set DamageItems
setDisplayName(java.lang.String value)
Set Item Display NameItems
setDurability(int value)
Deprecated.void
setItemMeta(org.bukkit.inventory.meta.ItemMeta itemMeta)
Set the Item MetaItems
setLeatherColor(int value)
Set Leather ColorItems
setLeatherColor(int red, int green, int blue)
Set Leather ColorItems
setLore(java.lang.String... value)
Ste Item Lore CallssetLore(List)
Items
setLore(java.util.List<java.lang.String> value)
Set Item LoreItems
setMaterial(org.bukkit.Material material)
Set the materialItems
setPages(java.lang.String... value)
Set Item Pages CallssetPages(List)
Items
setPages(java.util.List<java.lang.String> value)
Set Item PagesItems
setSkullOwner(java.lang.String value)
Set Skull Owner (Supports UUID and Names)Items
setSkullOwner(java.util.UUID value)
Set Skull Owner CallssetSkullOwner(String)
Items
setSplashPotion()
Sets the item to be a splash potionItems
setUnbreakable(boolean value)
Set Item unbreakable Only supports versions since MC 1.12java.lang.String
toString()
Get the item as a string
-
-
-
Constructor Detail
-
Items
public Items(org.bukkit.inventory.ItemStack stack)
Instantiates a new Items.- Parameters:
stack
- the stack
-
Items
public Items(java.lang.String string)
Instantiates a new Items.- Parameters:
string
- the string
-
Items
public Items(org.bukkit.Material material)
Instantiates a new Items.- Parameters:
material
- the material
-
Items
public Items()
Instantiates a new Items.
-
-
Method Detail
-
fromString
public Items fromString(java.lang.String string)
Load the item from a stringitem:TYPE | gun:GUNNAME
amount:AMOUNT
damage:DAMAGE
name:NAME
lore:LORE
enchantment:ENCHANTMENT,VALUE
flag:FLAG
display:DISPLAY
attribute:ATTRIBUTE,SLOT,VALUE,OPERATION
potion:POTION,[DURATION|EXTENDED],[STRENGTH|UPGRADED]
leather-colour:RRR,GGG,BBB
book-author:BOOK_AUTHOR
book-title:BOOK_TITLE
book-page:BOOK_PAGE
banner:PATTERN,COLOR
firework:FIREWORK,TRAIL,FLICKER
firework-color:RRR,GGG,BBB
firework-fade-color:RRR,GGG,BBB
owner:[OWNER|UUID|URL]
stored-enchantment:STORED_ENCHANTMENT,VALUE
tropical-fish:COLOR,PATTERN,PATTERN_COLOR
unbreakable
glow- Parameters:
string
- The Item Code- Returns:
- Items items
-
setMaterial
public Items setMaterial(org.bukkit.Material material)
Set the material- Parameters:
material
- The Material- Returns:
- The Item
-
getItem
public org.bukkit.inventory.ItemStack getItem()
Gets item.- Returns:
- Get the item
-
getItemMeta
public org.bukkit.inventory.meta.ItemMeta getItemMeta()
Gets item meta.- Returns:
- Get the item meta
-
setItemMeta
public void setItemMeta(org.bukkit.inventory.meta.ItemMeta itemMeta)
Set the Item Meta- Parameters:
itemMeta
- The ItemMeta
-
hasItemMeta
public boolean hasItemMeta()
Has item meta boolean.- Returns:
- Get if ItemMeta is valid
-
addFireworkEffect
public Items addFireworkEffect(org.bukkit.FireworkEffect fireworkEffect)
Add FireworkEffect- Parameters:
fireworkEffect
- FireworkEffect- Returns:
- Items items
-
addBannerPattern
public Items addBannerPattern(org.bukkit.block.banner.Pattern pattern)
Add Banner Pattern- Parameters:
pattern
- Pattern- Returns:
- Items items
-
addPage
public Items addPage(java.lang.String value)
Add Item to Pages- Parameters:
value
- Page as a string- Returns:
- Items items
-
setPages
public Items setPages(java.util.List<java.lang.String> value)
Set Item Pages- Parameters:
value
- Pages as a list- Returns:
- Items pages
-
setPages
public Items setPages(java.lang.String... value)
Set Item Pages CallssetPages(List)
- Parameters:
value
- Pages as an array- Returns:
- Items pages
-
setBookTitle
public Items setBookTitle(java.lang.String value)
Set Book Title- Parameters:
value
- The book's title- Returns:
- Items book title
-
setBookAuthor
public Items setBookAuthor(java.lang.String value)
Set Book Author- Parameters:
value
- The book's author- Returns:
- Items book author
-
setUnbreakable
public Items setUnbreakable(boolean value)
Set Item unbreakable Only supports versions since MC 1.12- Parameters:
value
- Boolean- Returns:
- Items unbreakable
-
setLeatherColor
public Items setLeatherColor(int red, int green, int blue)
Set Leather Color- Parameters:
red
- The redgreen
- The greenblue
- The blue- Returns:
- Items leather color
-
setLeatherColor
public Items setLeatherColor(int value)
Set Leather Color- Parameters:
value
- The RGB Color- Returns:
- Items leather color
-
setAmount
public Items setAmount(int value)
Set Amount- Parameters:
value
- The amount- Returns:
- Items amount
-
addEnchantment
public Items addEnchantment(org.bukkit.enchantments.Enchantment value, int level)
Add Enchantment- Parameters:
value
- Enchantmentlevel
- The level- Returns:
- Items items
-
addPotionEffect
public Items addPotionEffect(org.bukkit.potion.PotionEffect value)
Add PotionEffect- Parameters:
value
- PotionEffect- Returns:
- Items items
-
addGlow
public Items addGlow()
Add Item glow- Returns:
- Items items
-
addLore
public Items addLore(java.lang.String value)
Add Item to Lore CallsaddLore(String...)
- Parameters:
value
- Lore as a String- Returns:
- Items items
-
addLore
public Items addLore(java.lang.String... value)
Add Item to Lore- Parameters:
value
- Lore as an Array- Returns:
- Items items
-
setLore
public Items setLore(java.util.List<java.lang.String> value)
Set Item Lore- Parameters:
value
- Lore as a list- Returns:
- Items lore
-
setLore
public Items setLore(java.lang.String... value)
Ste Item Lore CallssetLore(List)
- Parameters:
value
- Lore as an array- Returns:
- Items lore
-
addAttribute
public Items addAttribute(java.lang.String attribute, java.lang.String slot, double level, java.lang.String operation)
Add Item Attribute- Parameters:
attribute
- Attribute's Nameslot
- Attribute's Slotlevel
- Attribute's Leveloperation
- Attribute's Operation- Returns:
- Items items
-
setSplashPotion
public Items setSplashPotion()
Sets the item to be a splash potion- Returns:
- Items
-
addAttribute
public Items addAttribute(AttributeType attribute, Slot slot, double level, Operation operation)
Add Item Attribute using BimmCore- Parameters:
attribute
- AttributeTypeslot
- Attribute's Slotlevel
- Attribute's leveloperation
- Attribute's Operation- Returns:
- Items items
-
addAttribute
public Items addAttribute(org.bukkit.attribute.Attribute attribute, org.bukkit.inventory.EquipmentSlot slot, double level, org.bukkit.attribute.AttributeModifier.Operation operation)
Add Item Attribute using Bukkit- Parameters:
attribute
- Attributeslot
- Attribute's EquipmentSlotlevel
- Attribute's leveloperation
- Attribute's Operation- Returns:
- Items items
-
setSkullOwner
public Items setSkullOwner(java.lang.String value)
Set Skull Owner (Supports UUID and Names)- Parameters:
value
- The Owner's name or UUID- Returns:
- Items skull owner
-
setSkullOwner
public Items setSkullOwner(java.util.UUID value)
Set Skull Owner CallssetSkullOwner(String)
- Parameters:
value
- Owner's UUID- Returns:
- Items skull owner
-
setDurability
@Deprecated public Items setDurability(int value)
Deprecated.Set Item Durability UsesetDamage(int)
instead- Parameters:
value
- durability- Returns:
- Items durability
-
setDamage
public Items setDamage(int value)
Set Damage- Parameters:
value
- damage- Returns:
- Items damage
-
setDisplayName
public Items setDisplayName(java.lang.String value)
Set Item Display Name- Parameters:
value
- Name- Returns:
- Items display name
-
addFlag
public Items addFlag(org.bukkit.inventory.ItemFlag flag)
Add a Flag to an Item- Parameters:
flag
- ItemFlag to add- Returns:
- Items items
-
equals
public boolean equals(Items item, boolean useLore)
Check if 2 items are equal- Parameters:
item
- Items to check againstuseLore
- check using item's lore- Returns:
- If the items match
-
toString
public java.lang.String toString()
Get the item as a stringitem:TYPE | gun:GUNNAME
amount:AMOUNT
damage:DAMAGE
name:NAME
lore:LORE
enchantment:ENCHANTMENT,VALUE
flag:FLAG
display:DISPLAY
attribute:ATTRIBUTE,SLOT,VALUE,OPERATION
potion:POTION,[DURATION|EXTENDED],[STRENGTH|UPGRADED]
leather-colour:RRR,GGG,BBB
book-author:BOOK_AUTHOR
book-title:BOOK_TITLE
book-page:BOOK_PAGE
banner:PATTERN,COLOR
firework:FIREWORK,TRAIL,FLICKER
firework-color:RRR,GGG,BBB
firework-fade-color:RRR,GGG,BBB
owner:[OWNER|UUID|URL]
stored-enchantment:STORED_ENCHANTMENT,VALUE
tropical-fish:COLOR,PATTERN,PATTERN_COLOR
unbreakable
glow- Overrides:
toString
in classjava.lang.Object
- Returns:
- Get the item as a string
-
getTexture
public java.lang.String getTexture()
-
-