With this small API you can create vanilla (Datapack-Like) Enchantments that work like vanilla Enchantments.
Some features are missing but the main part already works.
For more information see:
Minecraft Wiki:Adding custom Enchantments
With the EnchantmentModifier-Class you can now use the Methods:
- setEnchantmentDefinition(Enchantment, EnchantmentBuilder)
(Replaces only valid Fields from the EnchantmentBuilder to the existing Enchantment)
and
- setMaximumLevel(Enchantment, int)
(Replaces the maximum level of the existing Enchantment