1

I'm designing a parkour event in a Vanilla world totally organized with command blocks.
What I'm trying to do is:

  1. Teleport a player in a indoor map in the sky
  2. Change his gamemode to Adventure Mod
  3. Set his spawn-point at the beginning of the map
  4. Let him continue the event
  5. At the end of the event teleport him back
  6. Change his gamemode to Survival
  7. Reset his old spawn-point

Well, I can do everything in this list, except for the point 7..
How can I reset his old spawn-point?

  • What exactly do you mean by "Reset his old spawn-point"? – MorbidEntree Jan 22 '15 at 17:10
  • Let's assume that this guy has his spawn-point near his bed at 123/65/456. He starts the parkour event and the CB tps him at 456/100/789. When the event is finished he wants to come back and another CB tps him back. During the event, his spawn-point has been setted there in order to let him re-spawn there in case of death. The spawn-point of the event remains setted even if the event has finished.. What can we do? – hiru Jan 22 '15 at 17:17
2

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.

  • Talk me about this deathCount objective. How can this feature can help me? – hiru Jan 22 '15 at 18:15
  • 1
    @hiru I don't know how much you know about command blocks, but you can use /scoreboard to track statistics (in this case, deaths). Here is a good example of how /scoreboard works. I will add some about it in the answer – xornob Jan 22 '15 at 19:10
  • Let me see if I got it.. First the player deathCount goes to 0, then the CB activates only when the count goes to 1 and if this statement is true, it tps the player at the beginning of the event resetting again the deathCount? – hiru Jan 22 '15 at 19:25
  • We have a prob. When I die, the CB tps me in the right coord, but when I click on the button in order to respawn, I respawn in my original spawn-point and not in the event zone – hiru Jan 22 '15 at 20:54
  • @hiru What command is the button using? Instead of /kill-ing the player, you could just /tp them to the start – xornob Jan 22 '15 at 23:16

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.