Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheatsAll commands

Switch game

23 Wikis · pick your game
Coordinates

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 ^.

Details

Orderx 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 ruleIf one coordinate uses ^, all three must use ^. Otherwise the game answers "Cannot mix world and local coordinates".
Block positionsAbsolute numbers must be whole. With ~ or ^ decimals are allowed and the result is rounded down to the block it lies in.
Exact positionsDecimals 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.
RotationYaw first, then pitch, in degrees. ~ turns from the current angle. ^ is not allowed.
Yaw0 faces south, 90 west, 180 north, -90 east.
Pitch-90 looks straight up, 0 level, 90 straight down.
AxesAny 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.

Ways to write a coordinate

100Absolute world coordinate/tp @s 100 64 -200
~Same as the current position/tp @s ~ ~10 ~
~5 or ~-5Current position plus or minus the number/tp @s ~5 64 ~-5
^ ^ ^55 blocks in the direction being faced/tp @s ^ ^ ^5
^1 ^ ^-51 block to the left and 5 blocks backward/tp @s ^1 ^ ^-5
0.5Decimal, exact spot inside a block/tp @s 0.5 64.0 0.5

Kinds of position

Block positionx y zRequired unless ~ or ^ is usedYesYes/setblock ~ ~-1 ~ minecraft:stone
Exact positionx y z.5 added to x and zYesYes/summon minecraft:pig 10 64 10
Flat positionx z.5 addedYesNo/worldborder center 100 -100
Column positionx zRequired unless ~ is usedYesNo/forceload add ~-16 ~-16 ~16 ~16
Rotationyaw pitchNot changedYesNo/rotate @s ~45 ~

Related arguments

Axesx, y, z in any combination/execute align xz run summon minecraft:armor_stand ~0.5 ~ ~0.5
Entity anchorfeet or eyes/execute anchored eyes run tp @s ^ ^ ^1
Heightmapworld_surface, ocean_floor, motion_blocking, motion_blocking_no_leaves/execute positioned over motion_blocking run tp @s ~ ~ ~

Examples

/tp @s 100 64 -200

Teleports 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 ^ ^ ^5

Moves you 5 blocks in the direction you are looking.

/setblock ~ ~-1 ~ minecraft:stone

Places stone in the block below you.

/tp @s 8 64 8 90 0

Teleports you and turns you to face west, looking level.

/execute rotated 0 -90 run tp @s ^ ^ ^3

Moves 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.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)