Find a structure
Locate a village, a stronghold, an ocean monument and other structures with the /locate command.
Commands
/locate structure minecraft:village_plains Finds the nearest plains village
/locate structure minecraft:stronghold Finds the nearest stronghold (with an End portal)
/locate structure minecraft:monument Finds the nearest ocean monument
/locate structure minecraft:ancient_city Finds the nearest ancient city
/locate structure minecraft:trial_chambers Finds the nearest trial chambers (1.21+)
/locate biome minecraft:mushroom_fields Finds the nearest mushroom fields biome
How it works
The /locate command is the most powerful exploration tool in Minecraft. It finds the nearest structure of the type you choose and shows its coordinates. In Java Edition the syntax is /locate structure structure_name, and in Bedrock it's /locate structure name. The command is invaluable for finding strongholds, since they're the only structures with an End portal. Structures you can find include village, stronghold, monument (ocean monument), mansion (woodland mansion), ancient_city, trial_chambers, fortress (Nether fortress) and bastion_remnant. The /locate biome command also finds a specific biome, which is handy when you're looking for mushroom fields or a cherry grove. In Java Edition the result is clickable in chat: clicking it automatically fills in a /tp command to the coordinates it found.
Practical tips
In Java Edition, click the result in chat to fill in a teleport command automatically.
In Bedrock, the syntax is /locate structure stronghold (without the minecraft: prefix).
/locate biome finds a specific biome, which is handy for tracking down rare biomes.
In Java Edition, the nearest stronghold lies in a ring 1,408-2,688 blocks from spawn.