I'm trying to make a minigame type thing. When the game starts, I want to teleport everyone to the same random position in the world and have the world border appear around them. Currently I can move an armour stand to a random spot with /spreadplayers and then I set that as the world border center and then kill everyone.

That works but only if I set the range to like 100 and I want it at like 10000000.

How do I fix this issue or do it in another way?

1 Answer 1


Your problem is probably because the chunk that the armor_stand is in isn't loaded by a player. You could fix that issue by affecting a player instead.

I made this command sequence that does what I think you want: Command chain

You would simply power the bottom command block once. The first command:

execute as @r run tag @s add spread

Adds the tag spread to a random player.

Second command:

execute as @a[tag=spread] at @s run spreadplayers ~ ~ 1 10000000 true @s

Spreads that player somewhere within 10000000 blocks, using the tag to target the player.

Third command:

execute as @a[tag=spread] at @s run worldborder center ~ ~

Sets the world border center where that player is.

Fourth command:

execute as @a[tag=spread] at @s run worldborder set 100 0

Sets the border size.

You could also add a fifth command with:

execute as @e[tag=spread] run tag @s remove spread

To remove the spread tag, if you'd like to repeat the command then this will make it so no more than one player has the tag because it is removed at the end.

If you'd like to tp all players instead of killing them you could use:

/execute as @a[tag=!spread] run tp @a[tag=spread]

This would need to come before the tag-remove command, otherwise, there would be no one with the tag.

  • ooooh i think i get it thank you
    – Frog
    Feb 28, 2023 at 5:12

You must log in to answer this question.

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