Minecraft Vanilla elevator

minecraft-commandsminecraft-java-edition

How can I use command blocks to test for whenever a player is standing on a certain block within a certain area, and then teleport them?

Best Answer

I got the answer from Stefnotch from youtube. The command is:

/execute @a ~ ~ ~ detect ~ ~-1 ~ sand -1 tp @a ~ ~-5 ~