I'm working on a parkour map of sorts and the basic lobby system I have currently harms the player. To work around this, I inserted a repeating command block underneath the spawn area so that when players try to get off, they have the "Slow Falling" potion effect.
This is the command I used:
/execute as @p[distance=..5] if entity @s[y=20] run effect give @s slow_falling 2 1
My issue is that the only "selector" options I could get to work was distance one. Why this is an issue is because players on the bottom can get the potion effect again and players on the top get moon gravity. All I want is for the player to be prompted the potion effect when they leave the spawn area; no sooner, no later.
Yellow Panes: Region of effect
White Panes: No effect
The command block you can see in the center underneath the yellow panes.
Irrelevant to the topic, but to be honest they really need to tune down the coding scene. We're all waiting for the rework of the combat system, but honestly I think they should be funneling some of that dev team effort into making mapping easier and not more malleable.