/locate
/locate| Permission level required |
|
|---|---|
| Restrictions |
Cheat only |
{
"title": "<code>/locate</code>",
"rows": [
{
"field": "\n* 2 <sup class=\"noprint nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Java Edition\">(link to Java Edition article, displayed as JE) only</span></i>]</sup>\n* 1 <sup class=\"noprint nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as BE) only</span></i>]</sup>",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "(link to Options article, displayed as Cheat) only<sup class=\"noprint nowrap Inline-Template \" title=\"\">[<i><span title=\"This statement only applies to Bedrock Edition\">(link to Bedrock Edition article, displayed as BE) only</span></i>]</sup>",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
Displays the coordinates for the closest generated structure or biomes of a given type in the chat for the player who executed the command. In Java Edition, it can also display for the closest points of interest.
Usage
For /locate structure ..., the vertical coordinate of structure is ignored when finding. In Java Edition, the horizonal search range is 201x201 units of the Structure's spacing (see Default structure sets for values). For example, Mansions have a spacing of 80 chunks, so it can search out ±128,000 blocks before failure. For concentric ring structures like Strongholds, there is no set max distance. 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.[1]
For /locate biome ..., the horizonal search resolution is 32 blocks, and vertical resolution is 64 blocks, which means biomes that are too narrow may not be found. The horizonal search range is 12801×12801 blocks in Java Edition.
In Java Edition, for /locate poi ..., the search range is a sphere with a radius of 256 blocks.
When locating structure or POI, if successful, the following message is sent to chat: "The nearest <requested thing(s)> is at [<x> ~ <z>] (<distance> blocks away)", in which <distance> is the horizontal distance from the executor.
When locating biome, if successful, the following message is sent to chat: "The nearest <requested biome(s)> is at [<x> <y> <z>] (<distance> blocks away)", in which <distance> is the distance from the executor to the biome.
In Java Edition, the coordinates in these messages can be clicked, which can put the command /tp @s <x> ~ <z> in the chat box. The command can then be executed, and the player is sent to those coordinates. Also, in Java Edition, this message does not appear if the command was run from a function.[2]
Syntax
- Java Edition
/locate structure <structure>/locate biome <biome>/locate poi <poi>
- Bedrock Edition
/locate structure <structure: Structure> [useNewChunksOnly: Boolean]/locate biome <biome: Biome>
Arguments
JE : <biome>: resource_or_tag
BE: biome: Biome: enum
- Specifies the biome to locate. In Java Edition, this argument also supports biome tags.
- In Java Edition, must be an existing registered resource location or tag in
minecraft:worldgen/biomeregistry. In Bedrock Edition, must be an ID of a biome (without namespace)
JE (case-sensitive): <structure>: resource_or_tag_key
BE: structure: Structure: enum
- Specifies the structure to locate. See Generated structures#Data values.
- In Java Edition, must be a resource location or a tag, which resolves during command execution into an entry or tag in
minecraft:worldgen/structureregistry. In Bedrock Edition, must be an ID of a generated structure (without namespace)
BE: useNewChunksOnly: Boolean: enum
- Specifies if a structure of any type wants to be located in new chunks only (
true) or not (false), and it'sfalseby default. - Must be a [Boolean]Boolean (either
trueorfalse).
JE : <poi>: resource_or_tag
- Specifies the point of interest to locate.
- Must be an existing registered resource location or tag in
minecraft:point_of_interest_typeregistry. - The following are resource locations of POIs:
Point of Interest ID Blast Furnace armorerBee nest bee_nestBeehive beehiveSmoker butcherCartography Table cartographerBrewing Stand clericComposter farmerBarrel fishermanFletching Table fletcherBed homeCauldron leatherworkerLectern librarianLightning Rod lightning_rodLodestone lodestoneStonecutter masonBell meetingNether Portal nether_portalLoom shepherdSmithing Table toolsmithGrindstone weaponsmith
- This argument also supports point of interest type tags, as following:
Tag Includes #acquirable_job_sitearmorer
butcher
cartographer
cleric
farmer
fisherman
fletcher
leatherworker
librarian
mason
shepherd
toolsmith
weaponsmith#bee_homebee_nest
beehive#village#acquirable_job_site
home
meeting
Result
| Command | Trigger | Java Edition | Bedrock Edition |
|---|---|---|---|
| Any | The command is incomplete, or any argument is not specified correctly. | Unparseable | Unparseable |
locate structure ... | The specified resource location or tag is not a valid structure or structure tag. | Failed | N/A |
| The requested structure doesn't generate in this dimension. | Failed | ||
| Unable to locate the requested structure within a square of 201×201 units of the Structure's Spacing.. | |||
locate biome ... | Unable to locate the requested biome within a square of 12801×12801 blocks. | ||
locate poi ... | Unable to locate the requested poi within a ball with a radius of 256 blocks. | N/A | |
| Any | Otherwise | Successful | |
Output
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On fail | 0 | 0 | 0 |
locate structure ... | On success | 1 | 1 | horizontal distance between the executor and the requested structure or POI | |
locate biome ... | On success | 1 | 1 | distance between the executor and the requested biome | |
| Any | Bedrock Edition | On fail | 0 | N/A | N/A |
| On success | 1 | N/A | N/A |
Examples
- To obtain the coordinates of the nearest woodland mansion:
/ structure mansion - To obtain the coordinates of the nearest pillager outpost in new chunks only:
/ structure pillager_outpost true - To obtain the coordinates of the nearest village of any kind:
/ structure #village// structure village - To obtain the coordinates of the nearest desert biome:
/ biome desert - To obtain the coordinates of the nearest point of interest used by villagers:
/ poi #village
History
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.11 | 16w39a | Added /locate. | |||||
| 1.13 | 17w45a | The y-coordinate is now returned as 64 instead of ?. | |||||
The result of the command, used by /execute store, is the absolute distance to the structure. | |||||||
| 1.13 | 18w06a | /locate now accepts different structure names for all structures previously grouped under Temple: Desert_Pyramid, Igloo, Jungle_Pyramid, and Swamp_Hut. | |||||
| 18w08a | Added a clickable teleport link to the /locate command output. | ||||||
| 1.14 | 18w47a | /locate now accepts Pillager_Outpost. | |||||
| 18w48a | /locate now accepts New_Village. | ||||||
| ? | /locate no longer accepts New_Village. | ||||||
| 1.16 | 20w11a | Nether fossils can now be located. | |||||
| 20w21a | Structure names are now specified as lowercase. | ||||||
| 1.18.2 | 22w03a | /locate now uses a namespace ID parameter instead of hard coded values. | |||||
| Pre-release 1 | /locate now support tags, using # prefix to distinguish from normal IDs.
| ||||||
| The parameter is now a configured structure rather than a structure type. | |||||||
| 1.19 | 22w19a | /locatebiome has been merged with /locate. | |||||
| Added the ability to locate points of interest. | |||||||
| Pocket Edition | |||||||
| 1.0.0 | alpha 0.17.0.1 | Added /locate. | |||||
| alpha 0.17.0.2 | Removed /locate. | ||||||
| alpha 1.0.0.0 | Re-added /locate. Works only for strongholds. | ||||||
| 1.1.0 | alpha 1.1.0.0 | /locate can now find other structures. | |||||
| Bedrock Edition | |||||||
| ? | /locate can no longer locate structures that generate outside of the world boundary in old worlds. | ||||||
| 1.19.10 | Preview 1.19.10.23 | /locate can now find biomes. | |||||
| 1.19.30 | Preview 1.19.30.20 | The original command /locate <feature: Structure> is no longer used. | |||||
| Preview 1.19.30.21 | Added new structure names with underscores like ancient_city, bastion_remnant, buried_treasure, end_city, pillager_outpost, and ruined_portal. | ||||||
| Upcoming Bedrock Edition | |||||||
| 1.21.100 | Preview 1.21.100.20 | /locate biome now requires that the biome's namespace is specified (ex: minecraft:plains instead of just plains). Auto-complete suggestions for this command will now include namespaces. | |||||