public interface EnchantmentStorageMeta extends ItemMeta
Material.ENCHANTED_BOOK
is an example
of an item with enchantment storage.ItemMeta.Spigot
Modifier and Type | Method and Description |
---|---|
boolean |
addStoredEnchant(Enchantment ench,
int level,
boolean ignoreLevelRestriction)
Stores the specified enchantment in this item meta.
|
EnchantmentStorageMeta |
clone() |
int |
getStoredEnchantLevel(Enchantment ench)
Checks for the level of the stored enchantment.
|
Map<Enchantment,Integer> |
getStoredEnchants()
Gets a copy the stored enchantments in this ItemMeta.
|
boolean |
hasConflictingStoredEnchant(Enchantment ench)
Checks if the specified enchantment conflicts with any enchantments in
this ItemMeta.
|
boolean |
hasStoredEnchant(Enchantment ench)
Checks for storage of the specified enchantment.
|
boolean |
hasStoredEnchants()
Checks for the existence of any stored enchantments.
|
boolean |
removeStoredEnchant(Enchantment ench)
Remove the specified stored enchantment from this item meta.
|
addAttributeModifier, addEnchant, addItemFlags, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCanDestroy, getCanPlaceOn, getCustomModelData, getCustomTagContainer, getDestroyableKeys, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, getPlaceableKeys, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDestroyableKeys, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, hasPlaceableKeys, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeItemFlags, setAttributeModifiers, setCanDestroy, setCanPlaceOn, setCustomModelData, setDestroyableKeys, setDisplayName, setLocalizedName, setLore, setPlaceableKeys, setUnbreakable, setVersion, spigot
serialize
getPersistentDataContainer
boolean hasStoredEnchants()
boolean hasStoredEnchant(@NotNull Enchantment ench)
ench
- enchantment to checkint getStoredEnchantLevel(@NotNull Enchantment ench)
ench
- enchantment to check@NotNull Map<Enchantment,Integer> getStoredEnchants()
boolean addStoredEnchant(@NotNull Enchantment ench, int level, boolean ignoreLevelRestriction)
ench
- Enchantment to storelevel
- Level for the enchantmentignoreLevelRestriction
- this indicates the enchantment should be
applied, ignoring the level limitIllegalArgumentException
- if enchantment is nullboolean removeStoredEnchant(@NotNull Enchantment ench) throws IllegalArgumentException
ench
- Enchantment to removeIllegalArgumentException
- if enchantment is nullboolean hasConflictingStoredEnchant(@NotNull Enchantment ench)
ench
- enchantment to test@NotNull EnchantmentStorageMeta clone()
Copyright © 2022. All rights reserved.