/locate command doesn't locate nearest structure
The /locate command doesn't actually locate the nearest object to you.
Example 1: nearest stronghold not found
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1460,546 – only 740 blocks southeast.
Update 3 May 2019: Additional steps:
- Teleport to the nearer stronghold at 1460,546, or near to it.
- /locate stronghold
- The /locate command still returns the stronghold at 578,882, even though you're right on top of a different one.
The stronghold found by /locate is clearly farther away. It doesn't matter if you're directly on top of the one "invisible" to /locate, or if you move a short distance away from that spot.
Example 2: nearest monument not found
Steps to reproduce:
- Use the seed picker to generate "Ocean Monument Ahead" in creative mode.
- From the spawn point, the /locate monument command shows the nearest monument at -456,152 – over 850 blocks away
- Teleport to the actual nearest monument, or near to it, at 280,120
- Try /locate monument again. Even if you are directly over the monument at 280,120 (or near that spot), /locate still says the nearest one is at -456,152.
- There's another nearby ocean monument directly north of the one you're on top of, at 312,-249. This one also isn't found. The /locate command still favors the far one, even though two other monuments are closer to you.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures. (Struck out, verified Euclidean distance is used, but /locate is failing to find a nearer structure even when I'm right over it; see comment below.)
This is possibly related to MC-138887 reported for Java Edition.
Linked Issues
Created Issue:
/locate command doesn't locate nearest structure
The /locate command doesn't actually locate the nearest object to you.
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1489,586 – only 780 blocks southeast.
The stronghold found by /locate is clearly farther away.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.
This is likely related to MC-138887 reported for Java Edition.
- Unresolved
- Open
- Unconfirmed
- Windows
- Windows 10
- 1.11.1
relates to
The /locate command doesn't actually locate the nearest object to you.
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 14
89,586 – only 780 blocks southeast.The stronghold found by /locate is clearly farther away.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.
This is likely related to MC-138887 reported for Java Edition.
The /locate command doesn't actually locate the nearest object to you.
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1460,546 – only 740 blocks southeast.
The stronghold found by /locate is clearly farther away.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.
This is likely related to MC-138887 reported for Java Edition.
The /locate command doesn't actually locate the nearest object to you.
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1460,546 – only 740 blocks southeast.
The stronghold found by /locate is clearly farther away.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.
This is
likely related to MC-138887 reported for Java Edition.The /locate command doesn't actually locate the nearest object to you.
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1460,546 – only 740 blocks southeast.
The stronghold found by /locate is clearly farther away.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.(Struck out, verified Euclidean distance is used, but /locate is failing to find a nearer structure even when I'm right over it; see comment below.)This is possibly related to MC-138887 reported for Java Edition.
The /locate command doesn't actually locate the nearest object to you.
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1460,546 – only 740 blocks southeast.
Update 3 May 2019: Additional steps:
- Teleport to the nearer stronghold at 1460, 546.
- /locate stronghold
- The /locate command still returns the stronghold at 578. 882, even though you're right on top of a different one.
The stronghold found by /locate is clearly farther away.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.(Struck out, verified Euclidean distance is used, but /locate is failing to find a nearer structure even when I'm right over it; see comment below.)This is possibly related to MC-138887 reported for Java Edition.
The /locate command doesn't actually locate the nearest object to you.
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1460,546 – only 740 blocks southeast.
Update 3 May 2019: Additional steps:
- Teleport to the nearer stronghold at 1460, 546.
- /locate stronghold
- The /locate command still returns the stronghold at 578. 882, even though you're right on top of a different one.
The stronghold found by /locate is clearly farther away.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.(Struck out, verified Euclidean distance is used, but /locate is failing to find a nearer structure even when I'm right over it; see comment below.)This is possibly related to MC-138887 reported for Java Edition.
The /locate command doesn't actually locate the nearest object to you.
Example 1: nearest stronghold not found
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1460,546 – only 740 blocks southeast.
Update 3 May 2019: Additional steps:
- Teleport to the nearer stronghold at 1460, 546.
- /locate stronghold
- The /locate command still returns the stronghold at 578. 882, even though you're right on top of a different one.
The stronghold found by /locate is clearly farther away.
Example 2: nearest monument not found
Steps to reproduce:
- Use the seed picker to generate "Ocean Monument Ahead" in creative mode.
- From the spawn point, the /locate monument command shows the nearest monument at -456,152 – over 850 blocks away
- Teleport to the actual nearest monument at 280, 120
- Try /locate monument again. Even though you are directly over the monument at 280,120, /locate still says the nearest one is at -456,152.
- There's another nearby ocean monument directly north of the one you're on top of, at 312, -249. This one also isn't found. The /locate command still favors the far one, even though two monuments are closer.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.(Struck out, verified Euclidean distance is used, but /locate is failing to find a nearer structure even when I'm right over it; see comment below.)This is possibly related to MC-138887 reported for Java Edition.
The /locate command doesn't actually locate the nearest object to you.
Example 1: nearest stronghold not found
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1460,546 – only 740 blocks southeast.
Update 3 May 2019: Additional steps:
- Teleport to the nearer stronghold at 1460, 546.
- /locate stronghold
- The /locate command still returns the stronghold at 578. 882, even though you're right on top of a different one.
The stronghold found by /locate is clearly farther away.
Example 2: nearest monument not found
Steps to reproduce:
- Use the seed picker to generate "Ocean Monument Ahead" in creative mode.
- From the spawn point, the /locate monument command shows the nearest monument at -456,152 – over 850 blocks away
- Teleport to the actual nearest monument at 280, 120
- Try /locate monument again. Even though you are directly over the monument at 280,120, /locate still says the nearest one is at -456,152.
- There's another nearby ocean monument directly north of the one you're on top of, at 312, -249. This one also isn't found. The /locate command still favors the far one, even though two monuments are closer.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.(Struck out, verified Euclidean distance is used, but /locate is failing to find a nearer structure even when I'm right over it; see comment below.)This is possibly related to MC-138887 reported for Java Edition.
The /locate command doesn't actually locate the nearest object to you.
Example 1: nearest stronghold not found
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1460,546 – only 740 blocks southeast.
Update 3 May 2019: Additional steps:
- Teleport to the nearer stronghold at 1460, 546.
- /locate stronghold
- The /locate command still returns the stronghold at 578. 882, even though you're right on top of a different one.
The stronghold found by /locate is clearly farther away. It doesn't matter if you're directly on top of the one "invisible" to /locate, or if you move a short distance away from that spot.
Example 2: nearest monument not found
Steps to reproduce:
- Use the seed picker to generate "Ocean Monument Ahead" in creative mode.
- From the spawn point, the /locate monument command shows the nearest monument at -456,152 – over 850 blocks away
- Teleport to the actual nearest monument, or near to it, at 280, 120
- Try /locate monument again. Even though you are directly over the monument at 280,120 (or near that spot), /locate still says the nearest one is at -456,152.
- There's another nearby ocean monument directly north of the one you're on top of, at 312, -249. This one also isn't found. The /locate command still favors the far one, even though two monuments are closer.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.(Struck out, verified Euclidean distance is used, but /locate is failing to find a nearer structure even when I'm right over it; see comment below.)This is possibly related to MC-138887 reported for Java Edition.
The /locate command doesn't actually locate the nearest object to you.
Example 1: nearest stronghold not found
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1460,546 – only 740 blocks southeast.
Update 3 May 2019: Additional steps:
- Teleport to the nearer stronghold at 1460,
546.- /locate stronghold
- The /locate command still returns the stronghold at 578. 882, even though you're right on top of a different one.
The stronghold found by /locate is clearly farther away. It doesn't matter if you're directly on top of the one "invisible" to /locate, or if you move a short distance away from that spot.
Example 2: nearest monument not found
Steps to reproduce:
- Use the seed picker to generate "Ocean Monument Ahead" in creative mode.
- From the spawn point, the /locate monument command shows the nearest monument at -456,152 – over 850 blocks away
- Teleport to the actual nearest monument, or near to it, at 280,
120- Try /locate monument again. Even
thoughyou are directly over the monument at 280,120 (or near that spot),/locate still says the nearest one is at -456,152.- There's another nearby ocean monument directly north of the one you're on top of, at 312, -249. This one also isn't found. The /locate command still favors the far one, even though two monuments are closer.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.(Struck out, verified Euclidean distance is used, but /locate is failing to find a nearer structure even when I'm right over it; see comment below.)This is possibly related to MC-138887 reported for Java Edition.
The /locate command doesn't actually locate the nearest object to you.
Example 1: nearest stronghold not found
Steps to reproduce:
- Use the seed picker to generate "Coastal Village" in creative mode. You will spawn at 960,4.
- From that location, the /locate stronghold command says the nearest stronghold is at 578,882 – about 950 blocks directly south-southwest.
- However, there is another stronghold at 1460,546 – only 740 blocks southeast.
Update 3 May 2019: Additional steps:
- Teleport to the nearer stronghold at 1460,546, or near to it.
- /locate stronghold
- The /locate command still returns the stronghold at 578,882, even though you're right on top of a different one.
The stronghold found by /locate is clearly farther away. It doesn't matter if you're directly on top of the one "invisible" to /locate, or if you move a short distance away from that spot.
Example 2: nearest monument not found
Steps to reproduce:
- Use the seed picker to generate "Ocean Monument Ahead" in creative mode.
- From the spawn point, the /locate monument command shows the nearest monument at -456,152 – over 850 blocks away
- Teleport to the actual nearest monument, or near to it, at 280,120
- Try /locate monument again. Even if you are directly over the monument at 280,120 (or near that spot), /locate still says the nearest one is at -456,152.
- There's another nearby ocean monument directly north of the one you're on top of, at 312,-249. This one also isn't found. The /locate command still favors the far one, even though two other monuments are closer to you.
Is the command using taxicab distance rather than Euclidean distance? If so, that seems odd, because the whole point of /locate is to find the nearest structures.(Struck out, verified Euclidean distance is used, but /locate is failing to find a nearer structure even when I'm right over it; see comment below.)This is possibly related to MC-138887 reported for Java Edition.
@Mega_Spud – why was this resolved? The issue is still reproducible using exactly the steps outlined in the description.
I reported the same bug MCPE-45526 for Bedrock Edition (and that bug has been confirmed). I found examples of /locate failing to find the nearest structure (a stronghold and two monuments) even when I was right on top of it. This bug isn't just in Java Edition.
The more general version of this bug would be MC-138887, which is still reproducible as of 2 days ago. The same bug exists in Bedrock, documented at MCPE-45526, in which /locate fails to locate the nearest stronghold or monument.
@bdm68 – that's a good explanation, but it doesn't explain how you can be practically right on top of a structure that locate still doesn't find. Multiple examples are cited in MCPE-45526 – granted, that's Bedrock not Java, but the issues do seem related.
@Kris – in the examples I cited in MCPE-45526 it doesn't matter where you are around the structure: on top, nearby, just off any outermost boundary in any direction.... locate doesn't find it. That may be a different problem than described in this ticket (this ticket is Java, that one is Bedrock). But I am skeptical that the "anvil region" explanation applies there.
Hi Kanzai,
This would appear to be the same issue reported in MCPE-45526 which has been resolved in the 1.16 BETA's.
Are you able to confirm they are the same issue?
Given the amount of time that has elapsed since this report was last modified I'm going to put this into an Awaiting Response status. Never fear though, it will automagically re-open when you comment back ![]()
Ionic
Hi Tianxing,
The main report here would be considered a feature request. The locate command is intended to find world generation features such as monuments and natural villages. A request for it to find player made places of note (such as villages) would be a feature request. To log a feature request head over to https://feedback.minecraft.net.
Regarding your comment for old worlds not locating correctly, we have a number of existing reports for that issue which you can find using the search function. The most prominent is MCPE-45526.
If you don't believe an existing report adequately covers your bug, you're welcome to raise a new one, however you would need to attach an example world and instructions to reproduce in order for someone to easily confirm it.
Ionic
@Kris – there may be hope. I confirmed it got fixed in 1.16 in MCPE-45526 in the Bedrock version of this ticket. So a fix is possible – although that may simply mean that Bedrock uses a different mechanism than anvil regions for locating things.
Relates to MCPE-45526? Only tested on shipwrecks and villages but may affect more structures.
Steps to reproduce
Updated for 1.18
Shipwrecks
- Create a world with the seed 668 (thanks MCPE-119822)
- /tp 280 60 5 and you should see a shipwreck close by
- /locate shipwreck
→
The nearest Shipwreck is at block 280, (y?), 24 - /tp 280 60 -5
- /locate shipwreck
→
The nearest Shipwreck is at block 232, (y?), -280 (several hundred blocks away)
Villages (same seed)
- /tp -272 64 550
- /locate village
→
The nearest Village is at block -280, (y?), 680 (~130 blocks away) - /tp -272 64 540
- /locate village
→
The nearest Village is at block -264, (y?), 184 (~350 blocks away)
Ruined Portals
- Create a world with the seed 623724822
- /tp -1 93 83 and you should see a ruined portal
- /locate structure ruined_portal
→
The nearest Ruined Portal is at block -580, (y?), 360
I'll add, it would be nice if there were a /locate option that listed all structures within some fixed radius, like 500 blocks radius.
I believe what you are trying to say is that the /locate command isn't directly on the structure because I have tested for this and the structure is there, however it is noticeably a little bit off from the actual structure.
No, I'm trying to say that /locate doesn't locate the nearest structure, and the error is way off, far more than you would expect if the location were "a little bit off." In the example in my description, /locate identified a stronghold 950 blocks away as nearest, when the actual nearest stronghold is a completely different one 740 blocks away in a different direction. If I plot the end portal for each stronghold on a map, it's clear and obvious which one is nearer.
I'm speculating that this error may be due to the way distance is calculated, knowing that taxicab distance will always result in longer distances than direct-bearing distance, especially for intercardinal bearings.
In the example I gave, the stronghold identified by /locate is almost directly south, while the actual nearest one is southeast (-45 degrees bearing). An object at 45 degrees bearing will measure 1.4 times farther away than its true distance, if taxicab distance measuring is used.
It seems you are right. I guess it just happens to be by chance it was close by. By attempting more times, there have been more occasions where structures have been located more than 135 blocks from the given location. I'll look into the code from the game to try to pinpoint this error.
Euwill, I apologize for any confusion. I'm not saying that the location identified is incorrect, I'm saying that there are cases when /locate identifies one structure as nearest while completely missing another structure that is nearer.
I went back and checked the coordinates in my description. Given a search position at the spawn coordinates 960,4:
Now, here's the new weird thing: This nearer stronghold isn't found by /locate at all, even when I'm right over it!
Update: I have verified by experimenting with two locatable strongholds (at 578,882 and -286, -702) that /locate is actually calculating distances correctly, using Euclidean distance instead of taxicab distance. The bug reported here, then, is that /locate simply cannot find one nearby stronghold even when you're right on top of it. I don't know whether this is an isolated anomaly or a systemic problem with /locate.
Updated description with a second example of /locate failing to find two nearer ocean monuments.
Confirmed in 1.11.4 using Windows 10. The steps to reproduce given in the description are correct.
MCPE-34355reported a similar bug, but was retracted by the reporter who said that the command worked correctly when you were not above the ocean monument. That is not true for this report; moving some distance away, it still locates the farther target.That is correct. It doesn't matter if you're directly over the structure. If /locate doesn't find it, then /locate never finds it, no matter where you are.
Resolving issues that were marked as fixed in the 1.15 and 1.16 Betas, now that 1.16.0 is being released.
As the reporter, I have verified that the steps outlined in the description no longer reproduce the issue. This ticket can be closed.