4

I have a clock leading to a command block with this command:

/execute @p[r=4] ~ ~ ~ /tp @p ~-20 ~-5 ~

But when I get within 4 blocks nothing happens, the previous output box is blank.
What can I do to fix it?

1
  • 2
    FYI, you should not be using /execute in this manner. /tp has a target selector for you to use. /execute should only be used when the sender or origin needs to change, which is not needed here. It would only serve to increase the number of commands to process: /tp @p[r=4] ~-20 ~-5 ~ Commented Jan 31, 2016 at 17:23

2 Answers 2

2

Just do:

/tp @p[r=5] ~-20 ~-5 ~
2
  • 5
    While this should fix the problem, it would be good if you could add a little explanation. Commented Jan 31, 2016 at 18:27
  • why r=5? shouldn't it be r=4? Commented Mar 10, 2017 at 11:29
-1

Nevermind, the clock I had was too fast, I slowed it down and it works now.

1
  • 8
    Speed is not the cause. Command blocks can be activated at the full 20t/s that the game runs. If you were using a comparator clock, the redstone dust closer to the comparator is not turning off, but rather decreasing in signal strength. You need to extend the signal so that it turns off in order to pulse the command block, rather than send a constant signal. Commented Jan 31, 2016 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.