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:
- 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)
- 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)