mojira.dev
MC-274010

Not all items can be used in an enchanting table

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!

Linked issues

Comments 1

Thank you for your report!
We're tracking this issue in MC-272019, so this ticket is being resolved and linked as a duplicate.

If you would like to add a vote and any extra information to the main ticket it would be appreciated.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.

ShaneBee

(Unassigned)

Unconfirmed

(Unassigned)

1.21

Retrieved