Package org.bukkit.inventory.meta
Interface EnchantmentStorageMeta
- All Superinterfaces:
- Cloneable,- ConfigurationSerializable,- ItemMeta,- PersistentDataHolder
EnchantmentMeta is specific to items that can store enchantments, as
 opposed to being enchanted. 
Material.ENCHANTED_BOOK is an example
 of an item with enchantment storage.- 
Method SummaryModifier and TypeMethodDescriptionbooleanaddStoredEnchant(Enchantment ench, int level, boolean ignoreLevelRestriction) Stores the specified enchantment in this item meta.clone()intChecks for the level of the stored enchantment.Gets a copy the stored enchantments in this ItemMeta.booleanChecks if the specified enchantment conflicts with any enchantments in this ItemMeta.booleanhasStoredEnchant(Enchantment ench) Checks for storage of the specified enchantment.booleanChecks for the existence of any stored enchantments.booleanRemove the specified stored enchantment from this item meta.Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializableserializeMethods inherited from interface org.bukkit.inventory.meta.ItemMetaaddAttributeModifier, addEnchant, addItemFlags, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getCustomTagContainer, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAttributeModifiers, setCustomModelData, setDisplayName, setLocalizedName, setLore, setUnbreakable, setVersionMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainer
- 
Method Details- 
hasStoredEnchantsboolean hasStoredEnchants()Checks for the existence of any stored enchantments.- Returns:
- true if an enchantment exists on this meta
 
- 
hasStoredEnchantChecks for storage of the specified enchantment.- Parameters:
- ench- enchantment to check
- Returns:
- true if this enchantment is stored in this meta
 
- 
getStoredEnchantLevelChecks for the level of the stored enchantment.- Parameters:
- ench- enchantment to check
- Returns:
- The level that the specified stored enchantment has, or 0 if none
 
- 
getStoredEnchantsGets a copy the stored enchantments in this ItemMeta.- Returns:
- An immutable copy of the stored enchantments
 
- 
addStoredEnchantStores the specified enchantment in this item meta.- Parameters:
- ench- Enchantment to store
- level- Level for the enchantment
- ignoreLevelRestriction- this 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
- Throws:
- IllegalArgumentException- if enchantment is null
 
- 
removeStoredEnchantRemove the specified stored enchantment from this item meta.- Parameters:
- ench- Enchantment to remove
- Returns:
- true if the item meta changed as a result of this call, false otherwise
- Throws:
- IllegalArgumentException- if enchantment is null
 
- 
hasConflictingStoredEnchantChecks if the specified enchantment conflicts with any enchantments in this ItemMeta.- Parameters:
- ench- enchantment to test
- Returns:
- true if the enchantment conflicts, false otherwise
 
- 
clone
 
-