How do i limit what level of enchants can appear in chests

i made a blooper, i made it so enchants max level is 255 and i didnt relies they would apear as loot in chests, ive got someone in my server now running around with thorns 205 lmaooo, how do i make it so enchant level doesnt spawn as loot above a level
Continue to help post