1

I am currently working on a mini game that involves two teams. I'm wondering if I can make a random team generator in Minecraft that varies with the amount of players that are in the game. For example if I had 8 players, I could have the two teams have 4 players on each. But if I had 10 players, I could have 5 players on each team. Can this be done with command blocks? I know how to make teams and assign people to them already with the scoreboard command, but I don't know how I can make a player amount varied team generator.

Thanks,

TechnoSlamm

  • 1
    You could just evenly split them until there isn't anyone left. – Jon Aug 1 '14 at 21:05
1

I did something like this once. I had a command block on a timer that would look for players not on a team and then teleport them to a room. Any player in that room would be assigned to either red or blue team, using a t flip flop to determine what team to put them on. The flip flop would be switched for every person assigned, so it would go red blue red blue and so on. As soon as they were assigned I'd teleport them out to the team base with another command block.

This was a LONG time ago and I can't remember any more details than that, and there might be more efficient ways to do it now. I just wish mojang would include a scripting language to command blocks because trying to tie the programming into redstone and everything is way harder than it should be and variables can't be moved between blocks. That's why I had to teleport players to a separate room to assign stuff to them.

  • Interesting, I do wish Mojang would come out with a command block coding guide too. I'm no redstone/command block genius so programming this mini-game is hard work. Thanks for your reply though! – TechnoSlamm Aug 2 '14 at 21:28
  • @TechnoSlamm if you found the answer useful, please consider upvoting it. – MrLemon Aug 4 '14 at 13:00
  • The room is not actually needed. You can directly assign a team to @p[team=!red, team=!blue] (assuming teamnames red and blue of course), i.e. someone without a team. – MrLemon Aug 4 '14 at 13:08
  • That command doesn't work – TechnoSlamm Aug 4 '14 at 15:19

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.