Check if enchantment is appropriate for the item

I make a plugin to order in which subjects are assigned random enchantments. I need to make a check with which I could sift out those enchantments that are not suitable for the subject.

Can someone suggest a way?

Check the EnchantmentType, there is a function in there that will do the job. The github will show you what function it is

1 Like