Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-274010

Not all items can be used in an enchanting table

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.21
    • None
    • Unconfirmed
    • (Unassigned)

      I noticed while making custom enchantments, that not all items can be used in an enchanting table.

      EX:

      • If I make a custom enchantment for swords, it shows up when putting in a sword
      • If I make a custom enchantment for a stick, it will not show up for the stick in the table

      note:

      • Yes, I did add said custom enchantments to the "in_enchanting_table" tag.

      I noticed in the code for the class EnchantmentHelper, where it looks for available enchantments, there's a method on Item, Item#getEnchantmentValue()
      This by default in Item is 0, whereas some items/weapons/tools have a value over 1
      (such as tiered items, tridents, fishing rods)

      Because this value returns as 0 for all other items, these items are not available to be used in an enchanting table.
      This is quite sad if I want my players to be able to enchant their sticks, or maybe a food item.

      I really hope this was a simple oversight and gets resolved.

      Thank you for reading!

            Unassigned Unassigned
            ShaneBolenback ShaneBee
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: