Commands/locate

Displays the coordinates for the closest generated structure of a given type in the chat for the player who executed the command.

Syntax

 * Java Edition


 * Bedrock Edition

Arguments

 * lit. ''
 * Specifies the structure to locate. Must be one of the following:
 * {| class="wikitable sortable"
 * {| class="wikitable sortable"

! Feature name || Java Edition || Bedrock Edition || Dimension
 * || || || The Nether
 * || || || Overworld
 * || || || The End
 * || || || The Nether
 * || || || Overworld
 * || || || Overworld
 * || || || Overworld
 * || || — || The Nether
 * || || || Overworld
 * || || || Overworld
 * || || || Overworld, The Nether
 * || || || Overworld
 * || || || Overworld
 * || || rowspan=4 | || rowspan=4 | Overworld
 * || Overworld
 * }
 * $$, the structure type is case-sensitive.
 * || || || Overworld
 * || || || Overworld
 * || || || Overworld, The Nether
 * || || || Overworld
 * || || || Overworld
 * || || rowspan=4 | || rowspan=4 | Overworld
 * || Overworld
 * }
 * $$, the structure type is case-sensitive.
 * || || rowspan=4 | || rowspan=4 | Overworld
 * || Overworld
 * }
 * $$, the structure type is case-sensitive.
 * || Overworld
 * }
 * ⇭⇭⇭, the structure type is case-sensitive.
 * || Overworld
 * }
 * ⇭⇭⇭, the structure type is case-sensitive.
 * || Overworld
 * }
 * ⇭⇭⇭, the structure type is case-sensitive.

Note
The vertical coordinate of the structure is ignored when finding.

⇭⇭⇭, structures in the Anvil chunk region of the command's execution are prioritized over others due to a bug, meaning the found structure is not necessarily the closest.

If successful, ⇭⇭⇭, the following message is sent to chat: "The nearest  is at [ ~ ] ( blocks away) ", in which  is the horizontal distance between the executor and the structure feature. And the coordinates can be clicked, which can put the command in the chat box. The command can then be executed, and the player will be sent to those coordinates.

Examples

 * To obtain the coordinates of the nearest woodland mansion: