2

Let's say I have a 18x18 circle, surrounded by a 3x3 ring of a different material. I want to teleport players randomly along the 3x3 ring all the way along the outside. I have tried experimenting with the

/spreadplayers

command, as I have used it to teleport players randomly along a line, like so:

tp @a -317 35 58

spreadplayers -317 -58 1 11 false @a

tp @a ~ 35 58

however, I can't seem to think how you would apply this logic to a ring. I understand that I can set the 'x' and 'z' as the centerpoint, but there is no mixrange argument, only maxrange, so how would I ensure that the players are a minimum of 18 blocks and a maximum of 21 blocks from the centerpoint?

1
  • Since /spreadplayers has many extra features (like not teleporting you into lava etc.), I would just put it on a loop and have it spread out all players in the inner circle. Run for five seconds and the probability of someone being left in the inner circle is astronomically tiny. Jul 23, 2018 at 23:29

2 Answers 2

1

The easiest way to do this would be to repeat the command a few times and target all players who are either within the inner circle or outside of the outer circle (which is possible due to /spreadplayers' spread area being a square). If you let this run for 5 seconds in a repeating command block, you have 100 attempts to get them out, which should make it sure enough that nobody's left there.

If you know the number of players (or teams), you can also play around with the spreadDistance parameter by setting it high enough that players can only end up in a ring. For example the command /spreadplayers ~ ~ 11 9 false @e[type=armor_stand] does a pretty good job of spreading five armor stands evenly in a ring.

-1

If it is a circle it is easy, run a command_block when you want people out of the middle and inside just the outer ring put the command block on repeat with this command, instead of 0 put chord of the y of your 18x18 circle /execute if entity @a[x=-317,y=0,z=-58,distance=18..] run a commparator out of it with a commandblock on repeat, needs redstone, it must say: /spreadplayers -317 -58 1 11 false @a[x=-317,y=0,z=-58,distance=..18]

1
  • Please format your post. Also, I can already see that the syntax of the command is wrong without even trying it. Jul 23, 2018 at 23:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .