Enchantment that can change an entities vertical motion?

I want to add an enchantment that can knock an entity up or down, how would I do this in 24w38a. What's the most optimized method?

Continue to help post