How do you enchant randomly without applying max enchants
I want to give an item a random enchantment with an item modifier, but only a single level. Whenever I enchant randomly it gives a max level enchant, whenever I enchant with levels it gives no enchantment at all. I want it to give a single level of a random enchantment, and if it gives the same enchantment twice, simply upgrade that enchantment to one level higher, y'know?