How to teleport someone somewhere else when they stand at a specific location, with the command block somewhere out of sight
Solution 1:
- Give yourself a command block.
/give @s command_block
- To avoid having your chat being over run by messages, set the game rule
CommandBlockOutput
to false.
/gamerule commandBlockOutput false
- Go to the purple block and stand on top of it. Once you are standing on the block, press F3 (Fn + F3 on some keyboards) to find your coordinates. These will be referred to as x1, y1, and z1
(Optional) Type your coordinates into chat to help you remember them.
-
Now, go to the red block, and repeat step 3. These will be referred to as x2, y2, and z2.
-
Now, go to where you want the command block to be placed, and place it there.
-
Right-click your mouse on it, and change
Impulse
toRepeat
. -
Now change
Needs Redstone
toAlways Active
.
1.13+
Enter the text:
tp @a[x=X1, y=Y1, z=Z1, distance=..0.5] X2 Y2 Z2
into the area that says Console Command
.
1.12.2-
Enter the text:
tp @a[x=X1,y=Y1,z=Z1,r=1] X2 Y2 Z2
into the area that says Console Command
.
- Hit the button labeled
Done
.