Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.inventory.meta.ItemMeta Interface Reference
Inheritance diagram for org.bukkit.inventory.meta.ItemMeta:
org.bukkit.configuration.serialization.ConfigurationSerializable org.bukkit.inventory.meta.BookMeta org.bukkit.inventory.meta.EnchantmentStorageMeta org.bukkit.inventory.meta.FireworkEffectMeta org.bukkit.inventory.meta.FireworkMeta org.bukkit.inventory.meta.LeatherArmorMeta org.bukkit.inventory.meta.MapMeta org.bukkit.inventory.meta.PotionMeta org.bukkit.inventory.meta.SkullMeta

Public Member Functions

boolean hasDisplayName ()
 
String getDisplayName ()
 
void setDisplayName (String name)
 
boolean hasLore ()
 
List< String > getLore ()
 
void setLore (List< String > lore)
 
boolean hasEnchants ()
 
boolean hasEnchant (Enchantment ench)
 
int getEnchantLevel (Enchantment ench)
 
Map< Enchantment, Integer > getEnchants ()
 
boolean addEnchant (Enchantment ench, int level, boolean ignoreLevelRestriction)
 
boolean removeEnchant (Enchantment ench)
 
boolean hasConflictingEnchant (Enchantment ench)
 
ItemMeta clone ()
 
- Public Member Functions inherited from org.bukkit.configuration.serialization.ConfigurationSerializable
Map< String, Object > serialize ()
 

Detailed Description

This type represents the storage mechanism for auxiliary item data.

An implementation will handle the creation and application for ItemMeta. This class should not be implemented by a plugin in a live environment.

Definition at line 15 of file ItemMeta.java.

Member Function Documentation

boolean org.bukkit.inventory.meta.ItemMeta.addEnchant ( Enchantment  ench,
int  level,
boolean  ignoreLevelRestriction 
)

Adds the specified enchantment to this item meta.

Parameters
enchEnchantment to add
levelLevel for the enchantment
ignoreLevelRestrictionthis indicates the enchantment should be applied, ignoring the level limit
Returns
true if the item meta changed as a result of this call, false otherwise
String org.bukkit.inventory.meta.ItemMeta.getDisplayName ( )

Gets the display name that is set.

Plugins should check that hasDisplayName() returns true before calling this method.

Returns
the display name that is set
int org.bukkit.inventory.meta.ItemMeta.getEnchantLevel ( Enchantment  ench)

Checks for the level of the specified enchantment.

Parameters
enchenchantment to check
Returns
The level that the specified enchantment has, or 0 if none
Map<Enchantment, Integer> org.bukkit.inventory.meta.ItemMeta.getEnchants ( )

Returns a copy the enchantments in this ItemMeta.
Returns an empty map if none.

Returns
An immutable copy of the enchantments
List<String> org.bukkit.inventory.meta.ItemMeta.getLore ( )

Gets the lore that is set.

Plugins should check if hasLore() returns true before calling this method.

Returns
a list of lore that is set
boolean org.bukkit.inventory.meta.ItemMeta.hasConflictingEnchant ( Enchantment  ench)

Checks if the specified enchantment conflicts with any enchantments in this ItemMeta.

Parameters
enchenchantment to test
Returns
true if the enchantment conflicts, false otherwise
boolean org.bukkit.inventory.meta.ItemMeta.hasDisplayName ( )

Checks for existence of a display name.

Returns
true if this has a display name
boolean org.bukkit.inventory.meta.ItemMeta.hasEnchant ( Enchantment  ench)

Checks for existence of the specified enchantment.

Parameters
enchenchantment to check
Returns
true if this enchantment exists for this meta
boolean org.bukkit.inventory.meta.ItemMeta.hasEnchants ( )

Checks for the existence of any enchantments.

Returns
true if an enchantment exists on this meta
boolean org.bukkit.inventory.meta.ItemMeta.hasLore ( )

Checks for existence of lore.

Returns
true if this has lore
boolean org.bukkit.inventory.meta.ItemMeta.removeEnchant ( Enchantment  ench)

Removes the specified enchantment from this item meta.

Parameters
enchEnchantment to remove
Returns
true if the item meta changed as a result of this call, false otherwise
void org.bukkit.inventory.meta.ItemMeta.setDisplayName ( String  name)

Sets the display name.

Parameters
namethe name to set
void org.bukkit.inventory.meta.ItemMeta.setLore ( List< String >  lore)

Sets the lore for this item. Removes lore when given null.

Parameters
lorethe lore that will be set

The documentation for this interface was generated from the following file: