In my game called Void Wars, when a player dies they are sent to the lobby (they can't spectate). I need a command block to recognize when a winner is claimed aka after one person is left. Does anyone know a vanilla or Bukkit command to do this? Thanks in advance!

  • I think Command Blocks that function blocks in certain areas that detect players would work. – Jim Jones Feb 25 '17 at 3:52
  • 2
    Have you made any attempt to solve this yourself? Arqade works better when askers show effort to solve their own problems; we see that you have a problem you've worked on, and answerers respond to that. You also get a more specific answer that's tailored exactly to the part you're stuck, and Arqade gets a very specific question. Everybody wins! – Frank Feb 25 '17 at 4:06
  • I have made some attempts, but I'm not what you would call a command block master. I have been brainstorming ideas that could solve my problem for a while now though and I am stuck so I turned here for help. – GameChanger Feb 25 '17 at 4:16
  • Do you think you might be able to show us some of those attempts? It would go a long way to us being able to see where it is you're stuck. – Frank Feb 25 '17 at 5:45
  • As far as vanilla goes for a "last player in area" scenario, see here. – Skylinerw Feb 25 '17 at 7:09

This would be a little glitchy but if you managed to keep a chunk loaded with the following command block it could work. Also, the lobby in question has to be very far away or in a different world for this to work:

Place a repeating command block in the middle of the arena underground or someplace it's not bothering someone. The put in this command:

/testfor @a[r=5000]

You can change 5000 to what you like as long as the lobby isn't within its range. The rest should look like this: The Machin

The Detects command block has the command that I showed you. The torch, comparator, and Redstone wire filters the amount of players. And the Impulse command block is up to you. You have to go from there to trigger that someone's won.

| improve this answer | |
  • Hey, thanks! This really helps! Will tell this post when my server is up so you can join if you want. – GameChanger Feb 25 '17 at 19:01
  • @GameChanger consider marking the answer as accepted if it solve your problem. – Jouramie Feb 25 '17 at 20:28

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