From Minecraft Wiki
Displays the coordinates for the closest structure of a given type in the chat for the player who executed the command.
- Java Edition
- Bedrock Edition
locate <feature: Feature>
- StructureType / Feature
- Specifies the structure to locate. Must be one of the following:
Feature name Java Edition Bedrock Edition
The structure type is case-sensitive.
- Fails if the arguments are not specified correctly, or if unable to locate the requested feature (for example, if it's in a different dimension).
- If successful, displays the coordinates for the closest structure of the given type in the chat, for the player who executed the command. Will display the Y coordinate as
(y?)for some structures. (All structures in Bedrock Edition)
- To obtain the coordinates of the nearest woodland mansion: