
Command reference
Coordinates
Positions in commands are written as numbers separated by spaces. A number can be absolute, relative to the current position with ~, or relative to the facing direction with ^.
| Order | x y z. x runs east and west, y is height, z runs south and north. |
| Relative (~) | ~ adds the number to the current coordinate. ~ alone means no change. ~ and absolute numbers can be mixed freely. |
| Local (^) | ^left ^up ^forward, measured from the feet (or the eyes after /execute anchored eyes) along the direction being faced. ^ alone means 0. |
| Mixing rule | If one coordinate uses ^, all three must use ^. Otherwise the game answers "Cannot mix world and local coordinates". |
| Block positions | Absolute numbers must be whole. With ~ or ^ decimals are allowed and the result is rounded down to the block it lies in. |
| Exact positions | Decimals are allowed. A whole number for x or z without ~ gets .5 added so it points at the middle of the block. y is never changed. Write 10.0 to mean exactly 10. |
| Flat positions (x z) | Used by commands such as /spreadplayers and /worldborder center. Same centering rule. ^ is not allowed. |
| Column positions (x z) | Used by /forceload. Whole numbers or ~. ^ is not allowed. |
| Rotation | Yaw first, then pitch, in degrees. ~ turns from the current angle. ^ is not allowed. |
| Yaw | 0 faces south, 90 west, 180 north, -90 east. |
| Pitch | -90 looks straight up, 0 level, 90 straight down. |
| Axes | Any mix of the letters x, y and z, each at most once, such as xz or xyz. /execute align rounds those coordinates down to whole blocks. |
| 100 | Absolute world coordinate | /tp @s 100 64 -200 |
| ~ | Same as the current position | /tp @s ~ ~10 ~ |
| ~5 or ~-5 | Current position plus or minus the number | /tp @s ~5 64 ~-5 |
| ^ ^ ^5 | 5 blocks in the direction being faced | /tp @s ^ ^ ^5 |
| ^1 ^ ^-5 | 1 block to the left and 5 blocks backward | /tp @s ^1 ^ ^-5 |
| 0.5 | Decimal, exact spot inside a block | /tp @s 0.5 64.0 0.5 |
| Block position | x y z | Required unless ~ or ^ is used | Yes | Yes | /setblock ~ ~-1 ~ minecraft:stone |
| Exact position | x y z | .5 added to x and z | Yes | Yes | /summon minecraft:pig 10 64 10 |
| Flat position | x z | .5 added | Yes | No | /worldborder center 100 -100 |
| Column position | x z | Required unless ~ is used | Yes | No | /forceload add ~-16 ~-16 ~16 ~16 |
| Rotation | yaw pitch | Not changed | Yes | No | /rotate @s ~45 ~ |
| Axes | x, y, z in any combination | /execute align xz run summon minecraft:armor_stand ~0.5 ~ ~0.5 |
| Entity anchor | feet or eyes | /execute anchored eyes run tp @s ^ ^ ^1 |
| Heightmap | world_surface, ocean_floor, motion_blocking, motion_blocking_no_leaves | /execute positioned over motion_blocking run tp @s ~ ~ ~ |
/tp @s 100 64 -200Teleports you to the middle of the block at x 100, z -200, standing at height 64.
/tp @s ~ ~10 ~Moves you 10 blocks straight up.
/tp @s ^ ^ ^5Moves you 5 blocks in the direction you are looking.
/setblock ~ ~-1 ~ minecraft:stonePlaces stone in the block below you.
/tp @s 8 64 8 90 0Teleports you and turns you to face west, looking level.
/execute rotated 0 -90 run tp @s ^ ^ ^3Moves you 3 blocks straight up by pointing the command upward first.
/forceload add ~ ~Keeps the chunk you are standing in loaded.
/execute align xyz run tp @s ~ ~ ~Snaps you to the lower corner of the block you are in.

