![]() You can do this with a pressure pad instead, but this way makes it easier to automate, so you don't have people floating around who aren't in teams (unless you want this). When a new player joins, they land here and it triggers command blocks. This is a large area (the whole of the spawn chunk) laced with tripwires. So the easiest way to do this is to capture players at spawn with a contraption like this: In theory everyone could get assigned to the same team (but that's unlikely). Note: This procedure does not guarantee equally sized teams. ![]() You can for example set these two commands up by putting a pressure plate down that the players should stand on, under that the ground, under that a regular command block pointing down or to the side and where that's pointing a chain command block. You'll probably want to restrict the selector for the armor stands in some way, by location, name, tag or similar. Then, to reset it again: /execute at run setblock ~ ~ ~ air The command to execute a random one of these command blocks is then: /execute at run setblock ~ ~ ~ redstone_block Replace _ in all of them with the coordinates of the block where the players should stand in (the coordinates of the pressure plate for example). Put the commands into the command blocks of which you want to randomly select one: /team join with the different team names in each command block. The armor stands can be invisible, marker, NoAI, NoGravity, small, whatever, they just have to be there. The rotation of the command blocks and the armor stands doesn't matter. For that, firstly put some regular command blocks in a row, each with an armor stand above it, like this: ![]() This task is easiest with a standard randomiser. You can do a variety of optimisations, but this is the basic strategy. ![]() Note: This is a solution that needs a small amount of commands and is easy to explain. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |