How to make a custom tag only accept specific enchantments?

Started by Dalbfr122 on

Topic category: Help with Minecraft modding (Java Edition)

Joined May 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to make a custom tag only accept specific enchantments?

So, i am making a mod that adds a new type of weapon that doesn't classify as any of the other tool types (including multitool), so i decided to set the tool as a ''special'' tool, the problem is that now my weapon can get enchantments like efficiency, which is completely useless for this tool.

Going straight to the point, how can i make it so a custom tag (that my item is tagged as) makes it so only specific enchantments can appear in the crafting table UI for items with that tag? (i do know how to make the tool unable to have the enchantment, but them appearing on the enchanting table is the bigger issue for me)

I'm fine with custom coding as long as its nothing very complex