How do I prevent a certain enchantment from being cast on a certain item?

Started by Haxuda_02 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I prevent a certain enchantment from being cast on a certain item?

I've created a very cool sword with 25,000 durability. And I need certain enchantments such as Mending to be banned. How to do this in the procedure? 

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You can't prevent the…
Fri, 02/14/2025 - 03:21

You can't prevent the enchantment being applied without custom code but you can check if it's present using the item's use triggers or inventory tick update and then remove the enchantment.