Minecraft – How to set spawnpoint to a player standing on a gold block

minecraft-commandsminecraft-java-edition

I'm making a parkour map and I wanna know how to set a player's spawnpoint who is standing on a gold block. If you could tell me that would be very helpful!

P.S. If this involves a redstone timer then could you please tell me how to make the fastest one?

Thanks in advance! 😀

Best Answer

Run on a clock:

execute @a ~ ~ ~ detect ~ ~-1 ~ gold_block 0 spawnpoint @p ~ ~ ~