Find the nearest village
/locate structure #minecraft:villageGives the distance and coordinates of the closest village of any type.

These commands save time in a survival world: find a village or a biome, get back to your base, keep your items after death or end a storm. They need cheats on, so open your world to LAN with Allow Cheats if you did not turn commands on at creation.
/locate structure #minecraft:villageGives the distance and coordinates of the closest village of any type.
/locate structure minecraft:trial_chambersLocates the nearest trial chambers, with their trial spawners and vaults.
/locate biome minecraft:cherry_groveFinds the nearest Cherry Grove; replace the ID with any biome.
/tp @s 1250 ~ -430Takes you to X 1250 and Z -430, keeping your current height.
/spawnpoint @s ~ ~ ~You respawn exactly where you stand, no bed needed.
/gamerule keep_inventory trueYour inventory and experience stay with you when you die.
/effect give @s night_vision infinite 0 trueSee in caves and under water at any hour, without particles.
/time set dayJumps to morning, before mobs come out again.
/weather clearEnds rain or a thunderstorm right away.
/xp add @s 30 levelsEnough experience for an enchantment at the strongest level.
/seedDisplays the seed, handy to share the world or use a seed map.
Type each command in the chat. /locate answers with the distance and coordinates in green; click them to fill in a teleport. Use /teleport for the trip and /spawnpoint to respawn at your base without a bed. Village and structure locations come from the world seed, which /seed shows.
~, so the teleport keeps your current height: you may land in the air or inside a hill.infinite and true lasts forever and hides the particles.Could not find a structure of type means there is none within the search range, or that it does not exist in this dimension: a village never appears in the Nether. Commands are refused in a world without cheats; turn them on through the LAN menu.
✓ Checked in Java Edition 26.3 · updated 2 November 2026
Advancements still work in Java Edition when you use commands. The world is simply marked as a world where cheats have been used.
Set your respawn point at the base with /spawnpoint, or note its coordinates and use /tp. With keep_inventory on, your items come with you.
/locateFind the nearest structure, biome or POI/teleportTeleport players and entities/spawnpointSet a player's respawn point/gameruleRead or change the game rules of a world/effectGive or clear status effects/timeSet, speed up or pause the world clock/weatherChange the weather: clear, rain or thunder/experienceAdd, set or check experience/seedShow the seed of the current world