接口 EnchantmentStorageMeta

所有超级接口:
Cloneable, ConfigurationSerializable, ItemMeta

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.
  • 方法详细资料

    • hasStoredEnchants

      boolean hasStoredEnchants()
      检测是否存在任何附魔.

      原文:Checks for the existence of any stored enchantments.

      返回:
      这个meta是否存在一个附魔
    • hasStoredEnchant

      boolean hasStoredEnchant(Enchantment ench)
      Checks for storage of the specified enchantment.
      参数:
      ench - enchantment to check
      返回:
      true if this enchantment is stored in this meta
    • getStoredEnchantLevel

      int getStoredEnchantLevel(Enchantment ench)
      Checks for the level of the stored enchantment.
      参数:
      ench - enchantment to check
      返回:
      The level that the specified stored enchantment has, or 0 if none
    • getStoredEnchants

      Map<Enchantment,Integer> getStoredEnchants()
      获取在ItemMeta存储的附魔的副本.

      原文:Gets a copy the stored enchantments in this ItemMeta.

      返回:
      一个不可变的存储的附魔的副本
    • addStoredEnchant

      boolean addStoredEnchant(Enchantment ench, int level, boolean ignoreLevelRestriction)
      Stores the specified enchantment in this item meta.
      参数:
      ench - Enchantment to store
      level - Level for the enchantment
      ignoreLevelRestriction - this indicates the enchantment should be applied, ignoring the level limit
      返回:
      true if the item meta changed as a result of this call, false otherwise
      抛出:
      IllegalArgumentException - if enchantment is null
    • removeStoredEnchant

      boolean removeStoredEnchant(Enchantment ench) throws IllegalArgumentException
      Remove the specified stored enchantment from this item meta.
      参数:
      ench - Enchantment to remove
      返回:
      true if the item meta changed as a result of this call, false otherwise
      抛出:
      IllegalArgumentException - if enchantment is null
    • hasConflictingStoredEnchant

      boolean hasConflictingStoredEnchant(Enchantment ench)
      检测指定的附魔是否与任何ItemMeta里的附魔冲突.

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

      参数:
      ench - 要检测的附魔
      返回:
      附魔是否与任何ItemMeta里的附魔冲突
    • clone

      指定者:
      clone 在接口中 ItemMeta