For example: I have a chain of blocks. The first block is a repeater, it determines the presence of a player on a specific place.

He has next command: /execute positioned ~-2 ~-0.5 ~1 run execute if entity @p[distance=0..0.5] (it's coordinates of lime block)

The next block in this chain - chain, he writes a message to the player.

He has next command: /tell @p you got diamond

The third block, also the chain, he gives the player thing.

He has next command: /give @p minecraft:diamond 1

But the problem is that the message command and the issuing command do not depend on the coordinates of the player’s detection. How to solve this problem so that subsequent commands pay attention to the coordinates of the repeater block? enter image description here

I ask this, because the /tell and the /give can happen not for the right player, but for what is closer to the command block.

  • Could you make them vertically aligned? then you might negate this issue, if the repeater is the top. – Riker Dec 30 '18 at 17:40
  • Try using this execute command instead: /execute positioned ~-2 ~-0.5 ~1 if entity @p[distance=0..0.5] run <command to run> – SpiceWeasel Dec 30 '18 at 21:43

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.