Is it possible to limit the number of enchantments on an object?

Started by swelkinn_n on

Topic category: Help with Minecraft modding (Java Edition)

Joined Oct 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is it possible to limit the number of enchantments on an object?

I want to add a set of items with a unique set of enchantments, but most of them can only have a limited amount of those enchantments at a time. Is there a way to detect how many enchantments are on an item, and remove them if there are too many? I'm aware you can have incompatible enchantments, but that's not quite what I want, as I mentioned earlier I wanted to have one item in the set be able to hold all the enchantments while having a limit placed on all the others.