minecraftminecraft-commands

Can a Minecraft Command Block target selector search for a player in a specific 1-block location?


So far as I can tell, as of Java 1.15.2, there is no way to pinpoint a single block to check for a target, only at minimum a 2x2 area with [distance=..1]. distance=1, distance=0, distance=..0 all seem to do nothing at all. There used to be the (in my opinion, far more intuitive) [r=1] radius option, but that seems to have been relegated to Bedrock edition. How can Minecraft Java not allow you to target a specific location, or am I missing something?


Solution

  • yes. I think this is only possible in bedrock. wait actually its harder but possible!

    1. dig down two blocks where you want to test
    2. place always activating repeat command block with /execute WHILE TESTING FOR @p[dx=0, dy=2, dz=0] while running your chosen command (I dont know how to use execute exactly in java)
    3. cover it up!