Package org.bukkit.inventory.meta

# Interface EnchantmentStorageMeta

All Superinterfaces:
  `Cloneable`, `ConfigurationSerializable`, `ItemMeta`, `PersistentDataHolder`

public interface EnchantmentStorageMeta extends ItemMeta
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 Summary

Modifier and Type
Method
Description
`boolean`
`addStoredEnchant(@NotNull Enchantment ench, int level, boolean ignoreLevelRestriction)`
Stores the specified enchantment in this item meta.
`@NotNull EnchantmentStorageMeta`
`clone()`
`int`
`getStoredEnchantLevel(@NotNull Enchantment ench)`
Checks for the level of the stored enchantment.
`@NotNull Map<Enchantment,Integer>`
`getStoredEnchants()`
Gets a copy the stored enchantments in this ItemMeta.
`boolean`
`hasConflictingStoredEnchant(@NotNull Enchantment ench)`
Checks if the specified enchantment conflicts with any enchantments in this ItemMeta.
`boolean`
`hasStoredEnchant(@NotNull Enchantment ench)`
Checks for storage of the specified enchantment.
`boolean`
`hasStoredEnchants()`
Checks for the existence of any stored enchantments.
`boolean`
`removeStoredEnchant(@NotNull Enchantment ench)`
Remove the specified stored enchantment from this item meta.

### Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializable

`serialize`

### Methods inherited from interface org.bukkit.inventory.meta.ItemMeta

`addAttributeModifier, addEnchant, addItemFlags, displayName, displayName, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCanDestroy, getCanPlaceOn, getCustomModelData, getCustomTagContainer, getDestroyableKeys, getDisplayName, getDisplayNameComponent, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, getLoreComponents, getPlaceableKeys, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDestroyableKeys, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, hasPlaceableKeys, isUnbreakable, lore, lore, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeItemFlags, setAttributeModifiers, setCanDestroy, setCanPlaceOn, setCustomModelData, setDestroyableKeys, setDisplayName, setDisplayNameComponent, setLocalizedName, setLore, setLoreComponents, setPlaceableKeys, setUnbreakable, setVersion`

### Methods inherited from interface org.bukkit.persistence.PersistentDataHolder

`getPersistentDataContainer`

## Method Details

### hasStoredEnchants

boolean hasStoredEnchants()
Checks for the existence of any stored enchantments.

Returns:
  true if an enchantment exists on this meta

### hasStoredEnchant

boolean hasStoredEnchant(@NotNull @NotNull Enchantment ench)
Checks for storage of the specified enchantment.

Parameters:
  `ench` - enchantment to check
Returns:
  true if this enchantment is stored in this meta

### getStoredEnchantLevel

int getStoredEnchantLevel(@NotNull @NotNull Enchantment ench)
Checks 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

### getStoredEnchants

@NotNull @NotNull Map<Enchantment,Integer> getStoredEnchants()
Gets a copy the stored enchantments in this ItemMeta.

Returns:
  An immutable copy of the stored enchantments

### addStoredEnchant

boolean addStoredEnchant(@NotNull @NotNull Enchantment ench, int level, boolean ignoreLevelRestriction)
Stores 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

### removeStoredEnchant

boolean removeStoredEnchant(@NotNull @NotNull Enchantment ench) throws IllegalArgumentException
Remove 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

### hasConflictingStoredEnchant

boolean hasConflictingStoredEnchant(@NotNull @NotNull Enchantment ench)
Checks 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

@NotNull @NotNull EnchantmentStorageMeta clone()

Specified by:
  `clone` in interface `ItemMeta`