public interface ItemMeta extends Cloneable, ConfigurationSerializable
An implementation will handle the creation and application for ItemMeta. This class should not be implemented by a plugin in a live environment.
Modifier and Type | Method and Description |
---|---|
boolean |
addEnchant(Enchantment ench,
int level,
boolean ignoreLevelRestriction)
Adds the specified enchantment to this item meta.
|
ItemMeta |
clone() |
String |
getDisplayName()
Gets the display name that is set.
|
int |
getEnchantLevel(Enchantment ench)
Checks for the level of the specified enchantment.
|
Map<Enchantment,Integer> |
getEnchants()
Returns a copy the enchantments in this ItemMeta.
Returns an empty map if none. |
List<String> |
getLore()
Gets the lore that is set.
|
boolean |
hasConflictingEnchant(Enchantment ench)
Checks if the specified enchantment conflicts with any enchantments in
this ItemMeta.
|
boolean |
hasDisplayName()
Checks for existence of a display name.
|
boolean |
hasEnchant(Enchantment ench)
Checks for existence of the specified enchantment.
|
boolean |
hasEnchants()
Checks for the existence of any enchantments.
|
boolean |
hasLore()
Checks for existence of lore.
|
boolean |
removeEnchant(Enchantment ench)
Removes the specified enchantment from this item meta.
|
void |
setDisplayName(String name)
Sets the display name.
|
void |
setLore(List<String> lore)
Sets the lore for this item.
|
serialize
boolean hasDisplayName()
String getDisplayName()
Plugins should check that hasDisplayName() returns true
before calling this method.
void setDisplayName(String name)
name
- the name to setboolean hasLore()
List<String> getLore()
Plugins should check if hasLore() returns true
before
calling this method.
void setLore(List<String> lore)
lore
- the lore that will be setboolean hasEnchants()
boolean hasEnchant(Enchantment ench)
ench
- enchantment to checkint getEnchantLevel(Enchantment ench)
ench
- enchantment to checkMap<Enchantment,Integer> getEnchants()
boolean addEnchant(Enchantment ench, int level, boolean ignoreLevelRestriction)
ench
- Enchantment to addlevel
- Level for the enchantmentignoreLevelRestriction
- this indicates the enchantment should be
applied, ignoring the level limitboolean removeEnchant(Enchantment ench)
ench
- Enchantment to removeboolean hasConflictingEnchant(Enchantment ench)
ench
- enchantment to testItemMeta clone()
Copyright © 2015. All rights reserved.