I would like to detect the player with a command block when he is near or at X coordinates so:
/execute if entity @a positioned ~ ~2 ~ run say hello
but it doesn't work. I also tried:
/execute if entity @a[x=903,y=190,z=-2674,dx=906,dy=190,dz=-2076] run minecraft:music.creative
and
/execute if entity @a[x=907,y=194,z=-2679,distance=..2] run playsound minecraft:block.portal.travel master @p ~ ~ ~ 2 0.5
and many others, trying to make it easier.
When chained they work, but not once.
What else can I try? I tried enabling "always active", removing gamemode 1, changing region, etc, but it still doesn't work.