Coordinates: numbers, ~, and ^
Commands that place a block in the wrong spot or teleport you into mid-air nearly always come down to picking the wrong coordinate form. This page separates the three
How to read a coordinate
A coordinate is three values separated by spaces: X Y Z, where Y is the height — not the middle value people often assume
- X — East/west; larger values go east
- Y — Height; larger values go up
- Z — North/south; larger values go south
Turn on the coordinate display in game to read your current position — the numbers you see go straight into a command
The three forms, and when to use each
| Form | Measured from | Good for |
|---|---|---|
100 64 -200 |
The world origin — a fixed spot, always | Spawn points, lobbies, structures that never move |
~ ~1 ~ |
Wherever the command runs from | Commands you want to reuse anywhere without editing numbers |
^ ^ ^3 |
The direction you face, in the order left, up, forward | Firing something forward, or placing an object ahead of you regardless of facing |
The real difference between ~ and ^
Both are measured from you, but ~ ignores which way you are facing and ^ does not
-
~ ~ ~5— always 5 blocks south, no matter which way you face, because the Z axis is fixed north/south -
^ ^ ^5— always 5 blocks in front of you, whichever way you happen to be looking
The two forms cannot be mixed within one coordinate — You cannot write ^ ~2 ^. If you use ^ you must use it for all three, because the game needs to know whether the whole position is relative to your facing or to the world axes
Mistakes people actually make
| Symptom | Cause |
|---|---|
| The block appears inside you | You used ~ ~ ~, which is exactly where you stand — nudge it, e.g. ~ ~ ~1 |
| The block ends up under the floor | Forgetting that ~ ~ ~ is foot level, not eye level — use ~ ~1 ~ for eye level |
| The command turns red at the coordinates | The ~ is on the wrong side of the number — it must be ~5, not 5~, and there must be no space between them |
| You teleport and fall to your death | The Y value does not line up with the ground — teleport high first, then work down |
| A command block places things in the wrong spot | Inside a command block, ~ counts from the block itself, not from the player |
Coordinates behave differently in a command block
This is one of the most common points of confusion: the exact same command lands somewhere else once you move it from chat into a command block, because the anchor point changed
- Typed in chat — ~ counts from the player
- In a command block — ~ counts from the command block
To make a command block anchor on the player instead, wrap it in execute at first, then use ~ inside Read about execute
Tools that take coordinates
Other guides to read next
- Minecraft command basics — Start from zero: how to enable cheats, where commands can be typed, and enough about selectors and coordinates to get going
- Target selectors in depth — A deep look at the square-bracket arguments, from type and distance through limit and sort, plus how to work out why a command matched nobody
- Command blocks — Take the commands you generated and run them automatically — once, on repeat, or chained one after another
- Why an old give command stops working — Legacy NBT, 1.20.5 components, and 1.21.5 components side by side — compared using commands built by the generator itself
- Scoreboard basics — Create an objective the game tracks for you — or track it yourself from a command block — then use the score as a condition elsewhere
- The execute command — The most powerful command in the game, taken apart piece by piece — how as differs from at, and why reordering changes the result
- My command does not work — Work back from the error the game shows you, with the usual cause behind each one