1

This question already has an answer here:

So I am trying to figure out how to teleport someone within a radius, but only when there is one entity left within that radius. I was trying this:

/tp @p[c=1] x y z

But the c is only for how many people you wish to teleport. So my mind jumped to:

/tp @p[entity=1] x y z

But as far as I'm aware you, can't specify entity under @p. I am rather new to command blocks in general. Is it possible, and if yes, how? I would normally like to figure it out myself because I learn better that way, but this is too confusing for me. If it is possible I would rather just be told how to figure it out without giving me the complete answer, but at this point I'll be content with anything.

marked as duplicate by Virusbomb, dly, kalina, Ben, user973 Mar 2 '18 at 13:30

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • I have an idea to use one command block to active another if players within x radius=1. and the second command block just /tp @p x y z r=25 but again i'm new to command blocks and idk if this is doable or how to do it if it is. – iSuccessful Mar 19 '17 at 17:27
  • 1
    I think you need to reform your question to be a little more clear. Are you trying to teleport a mob to a mob or a player to a mob or a mob to a player or a mob to coordinates or a player to coordinates? It's just slightly cunfusing. – Reflexive Mar 19 '17 at 23:18
  • I apologize, idk why i felt the need to keep it vague, i'm making a pvp arena, 4 teams of how many ever players each, 1 member from each team gets randomly selected and tp'ed to the center, when there is 1 player left in the arena alive, tp that player back to his or her starting location and then randomly select another 4 players to tp until there is 1 team left. – iSuccessful Mar 20 '17 at 19:41
  • All right, thanks. Should be able to work on that. – Reflexive Mar 20 '17 at 19:56
0

To do the radius:

/tp @p[c=1,r=3]

Where radius is 3.
You might want to look at this page: Command Selectors

If you could explain this comment I could help you with it.

I have an idea to use one command block to active another if players within x radius=1. and the second command block just /tp @p x y z r=25 but again i'm new to command blocks and idk if this is doable or how to do it if it is.

  • My entire objective is to be able to: /tp <1 player> to <x=a y=b z=c > when <1 entity> is left withing <x-radius>. My idea was to use one command block to check for when one entity was left in the set radius and then to trigger a second command block to tp the last entity to the set location. I however did not know what commands to use nor if it was/is even possible. i'm going to try Dova's method and see if i can get it to work, but if there is an alternate way to do this i would love to know it. – iSuccessful Mar 19 '17 at 22:53
0

You can use a command block to repeatedly /testfor @e[x=a,y=b,z=c,r=radius,c=1] to send a redstone signal when the there is a player within radius distance from a,b,c. The c, as you showed, indicates the number of players, and @e makes it count entities rather than players. If you only want to count players, just return to @a. Then, connect this to a command block that has /teleport @a[x=a,y=b,z=c,r=radius] <x> <y> <z> with the same specifications as earlier, except <x>,<y>,<z> are where you want to teleport the target to.

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