Making an enchantment that is not in the enchantment table

Is there any way to make an enchantment that can't be enchanted through the table, just books? (a "treasure enchantment")

I don't see anything special in the Mending enchantment JSON that does that...

Continue to help post