Minecraft – How to Teleport Players When They Enter a Certain Area/Coordinates

minecraft-commandsminecraft-java-edition

I am trying to teleport a player to certain coordinates once they enter an area.

The idea is that they walk into a really small building, but once they turn a corner, they get teleported into a larger building.

Please refer to the adventure map named '5 Cubed', if you need help understanding what I am asking.

Best Answer

1.9 Solution

Place the following command in a repeating command block set to always active:

/execute @a[x=a,y=b,z=c,r=d] ~ ~ ~ tp @p e f g

Where:

  • a, b, and c are the XYZ co-ordinates that you want to teleport players from
  • d is the radius in blocks around that point where players will be selected (min 1)
  • e, f, and g are the XYZ co-ordinates that you want to teleport players to (i.e. the destination)

1.8 Solution

Use the same command as above, but since no repeating command blocks exist, place the command block on a fill clock.