What I would do:
Don't set their spawn in the sky, instead make a deathCount
objective, and at the beginning of the 'event', set it to 0 for all players. When a player dies, teleport them back to the beginning, then set their deathCount
to 0.
If you are doing a single player map, you could, instead of using beds for spawns, have a button that summons an invisible invincible armor stand, and then use that for the 'resetting' part.
If you are doing this with multiple people on a server, you could also at the beginning of the event, kill all players, then summon an armor stand at each player with a custom name, then use those to set the spawns back.
How to use /scoreboard
First, make the objective:
/scoreboard objectives add abc deathCount
Then, make a clock going to two command blocks.
In the first block, put
/tp @a[score_abc_min=1] <x> <y> <z> (coords of intended spawn)
The second block should have
/scoreboard players set @a abc 0
abc can be replaced with whatever you want
New answser:
Use a command block close to the middle of the room, (could be on roof or in floor) on a relatively quick timer. Use
/tp @a[rm=?] <x> <y> <z>
to teleport everyone at least ?
blocks from the command block to x y z.
First of all, in my research there is no way to move the worldspawn back to where it first was unless you took note of the cords. Secondly if you want to move the worldspawn you can do so with /setworldspawn
. When ever you set the worldspawn to a location the spawn chunks will be moved with it. Judging by your answer you want the spawn chunks to load command blocks, so all you need to do is go to the command blocks and set the world spawn. In the event that you accidentally did /spawnpoint
(this will set your spawnpoint and not the world spawn point) to remove your spawn point you can sleep in a bed, then destroy it.
Just a note the spawn chunks will only be loaded if someone is in the overworld. (this is applies to single player and I have no idea if the rule is the same on a server.)
If you want to read up more stuff on the spawn chunks you can do so here
Best Answer
Try using the a repeater with a command block that states: "
/spawnpoint @a[r=<size of spawn from the center, outwards>] <x> <y> <z>
" This will ensure that people within the specified area (within the[r=<>]
circle) will have their spawnpoints set to the coordinates and as soon as they leave the range, they can set their spawnpoint anywhere else. No pressure plates or tripwires required.