Almost all the current custom enchantment plugins are based on BS-ness (they check for easily-modifiable tags such as item name, item damage...). I'm planning on making one soon. You can follow me on GitHub till then.
https://github.com/MCPEPIG/PiggyCus...er/src/PiggyCustomEnchants/Main.php#L92-#L108 I used to do it that way too lol, stackoverflow has pretty neat answers. Refer this.