Minecraft – 1.12 Checkpoint System

minecraft-commandsminecraft-java-edition

Note: This is not for 1.13, but 1.12

I want to create a checkpoint system for my Parkour map, but I fail everytime.
When a player stands on an emerald block, this should be his checkpoint. If he needs to get back, he should use an item (like Carrot on a Stick) to get back to his latest checkpoint. There will be more than 1 emerald block and this should be multiplayer friendly (for up to 4 players).

What I did:

  1. Set up a scoreboard that checks if a carrot on a stick gets
    rightclicked, and on what team the player is (only 1 player per
    team)
  2. An execute command that checks if the player stands on an command block. If it's true, an already summoned armor stand with the name will teleport to the player, while the command block is active.

When the player now fails, he can right click his carrot on a stick, to get teleported to the Armor stand (I don't have this command, because when the other thing don't works, it's useless anyways)

/summon armor_stand ~ ~ ~ {Invisible:1b,Invulnerable:1b,PersistenceRequired:1b,NoGravity:1b,Small:1b,Marker:1b,CustomName:"P1CP",DisabledSlots:2039583}
/execute @p[score_P1=1,score_P1_min=1] ~ ~ ~ detect ~ ~-1 ~ minecraft:emerald_block 0 tp @e[Name:P1CP] @p

P1CP = Name of Armorstand (P1 = player 1; CP = checkpoint)

Best Answer

Answer:

  1. Create an scoreboard named "carrot" /scoreboard objectives add carrot stat.useItem.minecraft.carrot_on_a_stick
  2. For multiplayer compatibility add a scoreboard named "P1" (for Player 1; needs Team selection) /scoreboard objectives add P1 dummy
  3. In a command block put this command to summon the armor stand that is required to use this system /summon armor_stand 151 102 -188 {Invisibility:1b,Invulnerable:1b,Small:1b,Marker:1b,CustomName:"P1CP",DisabledSlots:2039583}
  4. In a clock-command block place this command to test for the P1 player, that right clicked the carrot-rod /testfor @p[score_P1=1,score_P1_min=1,score_carrot=1,score_carrot_min=1]
  5. Place three chain command blocks on conditional mode right behind the violet one (repeatable command block;violet = default Resource Pack) and put this command into the first tp @p[score_P1=1,score_P1_min=1] @e[name=P1CP]
  6. In the second command block set this command tp @p[score_P1=1,score_P1_min=1] ~ ~ ~ ~ 0
  7. In the last set this scoreboard players set @p[score_carrot=1,score_carrot_min=1] carrot 0
  8. At last, place this command into an another clock-command block to actually let it happen /execute @p[score_P1=1,score_P1_min=1] ~ ~ ~ detect ~ ~-1 ~ minecraft:emerald_block 0 tp @e[name=P1CP] @p[score_P1=1,score_P1_min=1]

The scoreboard names "carrot" and "P1" and the armor stand name "P1CP" can be changed, but don't forget to change the name in every command block that has the names in it. "minecraft:emerald_block" can be changed into a block of your choice. Make sure your command blocks are in the spawn chunks, so when you can't see the command block's chunks, it will still work.