Cloneable
, ConfigurationSerializable
, ItemMeta
, PersistentDataHolder
public interface EnchantmentStorageMeta extends ItemMeta
Material.ENCHANTED_BOOK
is an example
of an item with enchantment storage.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.
|
serialize
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
getPersistentDataContainer
boolean hasStoredEnchants()
boolean hasStoredEnchant(@NotNull @NotNull Enchantment ench)
ench
- enchantment to checkint getStoredEnchantLevel(@NotNull @NotNull Enchantment ench)
ench
- enchantment to check@NotNull @NotNull Map<Enchantment,Integer> getStoredEnchants()
boolean addStoredEnchant(@NotNull @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 @NotNull Enchantment ench) throws IllegalArgumentException
ench
- Enchantment to removeIllegalArgumentException
- if enchantment is nullboolean hasConflictingStoredEnchant(@NotNull @NotNull Enchantment ench)
ench
- enchantment to test@NotNull @NotNull EnchantmentStorageMeta clone()
Copyright © 2020. All rights reserved.