Hi! I'm currently trying to make an event in a minecraft server using commandblocks.
I want to spawn something in once there is a player in the area. I tested the command to make sure it works. but it doesn't. here is the command:
/execute if entity @a[distance=5] run say hey, someone is near me
This does not do anything, but if i remove the distance and use this:
/execute if entity @a run say hey, someone is near me
It does work! I am in the end, so maybe i cant look for a player in a radius in the end? Please help!
I'm assuming this is Minecraft Java. I don't know much about the distance tag, but if you do /execute if entity @p[dx=5,dy=5,dz=5] run say hey then it should work. I'm unsure why dx dy and dz works but "distance" doesn't, but there you go.
Try adding ".." before distance. And after if before doesn't work
Or try adding .. after the 5 then the distance have to be bigger than 5 and add a .. befor the 5 than the distance have to be smaller than 5