0

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.

SuperStormer
  • 4,997
  • 5
  • 25
  • 35

1 Answers1

1

When a command block is impulse, and needs redstone, it will run the command once when it gets powered. It seems you want it to constantly run, so change the first paramater in the command block from Needs redstone to Always active. Also change Impulse to Repeating