Row 1
1. [impulse] /scoreboard objectives add jump minecraft.custom:minecraft.jump
Row 2
2. [impulse] /scoreboard objectives add playerRot dummy
Row 3
3. [repeat] /execute as @a at @s store result score @s playerRot run data get entity @s Rotation[1]
4. [chain] /execute as @a at @s if score @s playerRot matches -90..-60 if score @s jump matches 1.. rotated ~ 0 unless block ^ ^2 ^1 air if block ^ ^3 ^1 air if block ^ ^4 ^1 air run effect give @s minecraft:levitation 1 1 true
5. [chain] /execute as @a at @s if score @s playerRot matches -90..-70 if score @s jump matches 1.. rotated ~ 0 unless block ^ ^3 ^1 air if block ^ ^4 ^1 air if block ^ ^5 ^1 air run effect give @s minecraft:levitation 1 2 true
6. [chain] /execute as @a at @s run scoreboard players reset @s jump