Minecraft 1.15.2 command / execute positioned ~ ~ 2 ~ if entity @p [distance = .1] run how do I get this to work?

Cl
- in Worlds
3

Hi

I want something to happen when the player is on the block that was placed on the command block.

There are many such sensor locations in the world, wherever there's a command block underneath.

So I want to work with relative locations and not with fixed values.

Then I would only have to copy the command unchanged into each block and would not always have to find the exact values of the position.

I tried this here:

/ execute positioned ~ ~ 2 ~ if entity @p [distance = .1] run

The command block is set to "Repeat", "Absolutely" and "Always active"

The command is shown completely in gray.

But further command blocks or redstone constructs connected by comparator are not activated when I take the desired position.

Even if I increase the distance value to enlarge the test room, it doesn't work.

What do I have to change?

Be

You have to take the run away

Ma

Try this here:

/ execute if entity @p [distance = .1.7] positioned ~ ~ 2 ~ run

Cl

Now it works