-2

I want to make a map with some commands, one being when the player gets within ten blocks of a command block, a door is revealed or a boss is summoned. I couldn't figure out how to do it. Can someone please help? Thanks. I might have figured out the problem.

  • 1
    Possible duplicate of Why is =! not working in testfor command? – dly Sep 24 '16 at 1:41
  • no it is not5 a duplicate mine is completely different – Geoplayer123 Sep 24 '16 at 13:48
  • Definitely not a duplicate. but, @Geoplayer123, please mark the answer below as accepted if it helped you figure out the problem. – Ethan Chapman Sep 24 '16 at 16:34
  • The answer lies within... no jk but the answer is in the "this duplicate" post – Geoplayer123 Sep 25 '16 at 19:42
1

You can do that in one command block:

/testfor @e[r=10,type=Player]

Put a comparator next to it with the input side facing the comparator, and then you have to trigger that command block all the time.

When there is a player within a radius of 10 (10 from each side) the comparator gets activated. Then you can make that redstone signal do anything.

  • 1
    You don't have to use a comparator anymore, as they take a redstone tick to activate. If you want everything to be done at the same time, consider using chain conditional command blocks, where they will only activate if the chain command block before them has been successful with its command (ie, if it would produce a comparator signal). – Oliver Sep 24 '16 at 10:43
  • no it doesnt work. – Geoplayer123 Sep 24 '16 at 13:58
  • You need to activate it all the time. You can now set the command block to be Always Active or use any clock. – ramidzkh Feb 18 '17 at 4:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.