I want to make a sort of elevator in Minecraft with a command block. You step into a small room, press the button and get sent a few blocks up to a room above the current room.
Is there a way to send the player a few blocks up or down?
Arqade is a question and answer site for passionate videogamers on all platforms. It only takes a minute to sign up.Sign up to join this community
You can use a simple
/tp command, you either use absolute values, to teleport the player to
100 64 100 you would use this:
/tp @p 100 64 100
Or relative values, for 3 blocks up that would look like this:
/tp @p ~ ~3 ~
Note that this will teleport the player relative to the command block, to teleport the player relative to the current loaction you would use:
/execute at @p run tp @p ~ ~3 ~
on the command block in the room down, input the following command:
/tp @p ~ ~9 ~
and on the command block in the room up, input the following command:
/tp @p ~ ~-9 ~
these two should teleport the nearest player in the same x and z coordinate, but +9 or -9 from the command block's y coordinate from the command block initiating the command (respectively)