Minecraft – How to teleport players in half-block increments

minecraft-commandsminecraft-java-edition

I am currently working on a map. There is an intro of the map where I want to let players to get teleported half block at a time, following a route to get a preview of the map. If they try to move, they will get teleported back to the route.

How can I make the player be teleported half (or less), not whole blocks at a time?

Best Answer

Ok, use the /tp command to tp the Player:

/tp @a ~ ~ ~+0.5

for teleporting half block in +z.

/tp @a ~ ~ ~-0.5

for -z, and so on - the first squigly line is the x coordinate, 2nd is the y coordinate and 3rd one stands for z.

For teleporting a Player into +x and +z (or any other coordinates) at once a total of 0.5 Blocks, use this (via the Pythagorean stuff):

/tp a ~+0.35355 ~ ~+0.35355

For teleporting into +x, +y, and +z at once, use the following:

/tp @a ~+0.2887 ~+0.2887 ~+0.2887