Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-4985

Enchantment.canEnchantItem always return false on a Book

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • None
    • 1.14.1-R0.1-SNAPSHOT
    • Yes

      Hey,

      The method Enchantment.canEnchantItem return always false on a book itemstack. However the book can accept almost all (if not all ?) enchantements.

      Reproduction:

      if(Enchantment.ARROW_DAMAGE.canEnchantItem(new ItemStack(Material.BOOK))) {
      getLogger().info("Can enchant a book.");
      } else {
      getLogger().info("Cannot enchant a book");
      }

      display: "Cannot enchant a book." This is reproductible with any enchantment.

            Unassigned Unassigned
            Kuinox Kuinox
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: