Commands
How to Use the /locate Command
Stop wandering. /locate structure minecraft:village tells the server to find the closest matching structure and hand you its X and Z coordinates plus the distance, one line, no guesswork. Here is the exact syntax, how to read the result, and how to teleport there.
Reading the coordinate output
A successful run prints a single result line shaped like The nearest minecraft:village is at [-312, ~, 488] (1041 blocks away). The first number is X, the tilde is Y (left relative on purpose), and the last number is Z.
The distance in parentheses is straight-line, measured from your current position, handy for deciding whether to walk or teleport. Click the coordinates in chat to copy them, then drop them into /tp @s -312 ~ 488 to jump straight to the spot.
Quick answers
+What is the exact syntax for /locate?
In 1.19+ it is /locate structure <id>for example /locate structure minecraft:village. Older versions used /locate village with no structure keyword.
+Why does the Y coordinate show a tilde?
The tilde (~) means current Y. /locate only resolves horizontal X and Z, so it leaves Y as relative, you climb or dig to the actual surface.
+What can I locate besides villages?
Any structure ID: minecraft:fortress, minecraft:stronghold, minecraft:ancient_city, minecraft:mansion, plus /locate biome and /locate poi for biomes and points of interest.
+Why do I get No structure found nearby?
The structure does not generate within the search radius (often thousands of blocks), or it is disabled in your world settings. Travel further and try again.
+Do I need cheats or op to use it?
Yes. /locate requires permission level 2. Enable cheats in single-player, or have an operator run it on a multiplayer server.
+How do I teleport to the located structure?
Take the X and Z from the result and run /tp @s X ~ Z. The ~ keeps your current height so you arrive on the surface near the structure.