I found a mineshaft in my regular world, so I used the seed to make a creative version of the world to try out the locate command.
Standing right in the real mineshaft I types "locate Mineshaft" and it told me 2056, ?, 1160. The mineshaft was standing in was at 350,30,275 (roughly. It's a huge mineshaft). So I figured maybe it was telling me the nearest mineshaft other than the one I was in.
So I went about 200 blocks away, above ground, and typed locate again. It still told me 2056,?.1160. So I went another 200 blocks away and this time it told me 1160,?,2056. Same numbers, but in reverse order. So I teleported to those two locations and used gamemode 3 to dive down and have a look. There were mineshafts close to both of those locs, even though they were 100 blocks or so away from the given locs.
But, using gamemode 3 I also found several other mineshafts closer than both of those locations. So the wiki says "Displays the coordinates for the closest structure of a given type in the chat for the player who executed the command." But that just ain't true.
I suspect that the command is bugged somehow, since mineshafts in particular should be very easy to locate since they do not have any dependence on the biome when generating, and even for those that do the game can check the biome at a point without generating terrain, which it does anyway when generating them.
Strongholds were not mentioned; are they affected as well? Because they certainly shouldn't be - the game already had code to locate them with Eyes of Ender long before 1.11, and their spawning algorithm is by far the most complex of any structure (both in placement as well as their biome check, which will offset them by up to 112 blocks from their initial location when searching for a biome that has a positive base elevation/above sea level).
Mineshafts are the simplest of structures in terms of spawning; the game just uses a couple random chances to determine whether they can generate in a chunk (a fixed 1/250 chance plus an x/80 chance, where x is the absolute chunk distance from the origin along either axis and 80 or more gives a chance of 1, so they are most common 1280+ blocks from the origin, and a 1/250 chance means an average spacing of only 253 blocks so the closest mineshafts will certainly be less than 2360 (sqrt(2056^2 + 1160^2)) blocks away. In fact, within such a circular radius you can expect an average of 273 mineshafts when away from the origin!).
I'm not sure how the game searches for structures but the best way would be to search outwards from the player in a spiral and stop when a structure is found, which I implemented in a mod which changed the way strongholds are located and made them "infinite" in number (one thing that is different about strongholds is that in vanilla the game caches their locations due to how expensive it is to run, which is why they only increased them to 128 instead of an infinite number in 1.9. To find the nearest one the game just goes over the list and picks the closest one. However, other structures can be searched by simply iterating over the chunks around the player; a spiral search is easy to implement and fast even with a very large maximum range and does not require making a list of all structures, then checking which one is the closest).
That's a good thought. I went back into the creative mode copy and checked it out.
Starting at 87 99 375 (petty close to the world spawn point) I get the following:
/locate Mineshaft reports 2056 (y?) 1160 the actual closest mineshaft point to that location was 1989 42 1181
I moved a couple dozen blocks and tried locate again.
This time it reported: 1160 (y?) 2056 and the actual closest mineshaft point was 1206 19 2071
The closest mineshaft in reality to the starting point of 87 375 is at 354 34 280 which depthwise is between the other two.
Curiously, standing at 1240 62 2099, almost directly over that mineshaft, typing /locate Mineshaft does find the mineshaft under my feet.
So I was kinda right; it looks like it's looking for the closest on the Y axis, not highest, then looking at the X and Z axises. It could be considered a bug, I guess, since the Y axis doesn't really affect travel.
So I was kinda right; it looks like it's looking for the closest on the Y axis, not highest, then looking at the X and Z axises. It could be considered a bug, I guess, since the Y axis doesn't really affect travel.
I've noticed something similar with portals. As a test I stacked three portals on top of each other with the middle one at the same y in the nether as the y in the overworld, and it took me to the one that had the same y. Then I broke the one in the middle and moved it 50 blocks away. The overworld portal still linked me to the one with the closest y even though the x and z of the other two were closer to what should have been the target location.
I discovered that accidentally when I ended up with a portal loop. Portal A in the overworld sent me to portal B in the nether., but portal B in the nether sent me to portal C in the overworld, and portal C in the overworld sent me to portal D in the nether, and portal D in the nether sent me back to portal A in the overworld!
So I was kinda right; it looks like it's looking for the closest on the Y axis, not highest, then looking at the X and Z axises. It could be considered a bug, I guess, since the Y axis doesn't really affect travel.
That shouldn't be happening if they calculated the distance correctly; that is x * x + y * y + z * z, where xyz is the difference between the player and structure coordinates; the effect of y will be insignificant for all but very short distances (usually less than 64; the deepest mineshaft I've seen had its center room at y=5; assuming you are not flying at y=1000 or something).
Unless... they have y in blocks while x and z are in chunks and/or they are not correctly converting to/from chunk/block coordinates (chunk coordinates are the more likely measure to use since structures generate aligned to chunks, not blocks). The command doesn't even give you the exact y coordinate in many cases since that requires actually generating the structure (as opposed to calling a simple canSpawnHere() method, which only accepts chunk x/z coordinates).
I've noticed something similar with portals. As a test I stacked three portals on top of each other with the middle one at the same y in the nether as the y in the overworld, and it took me to the one that had the same y. Then I broke the one in the middle and moved it 50 blocks away. The overworld portal still linked me to the one with the closest y even though the x and z of the other two were closer to what should have been the target location.
I discovered that accidentally when I ended up with a portal loop. Portal A in the overworld sent me to portal B in the nether., but portal B in the nether sent me to portal C in the overworld, and portal C in the overworld sent me to portal D in the nether, and portal D in the nether sent me back to portal A in the overworld!
So, in other words, it's in how the game processes the location of structures in general, and this has nothing to do with the actual command itself.
Also, that is very weird. Not quite sure how that happened.
That shouldn't be happening if they calculated the distance correctly; that is x * x + y * y + z * z, where xyz is the difference between the player and structure coordinates; the effect of y will be insignificant for all but very short distances (usually less than 64; the deepest mineshaft I've seen had its center room at y=5; assuming you are not flying at y=1000 or something).
Unless... they have y in blocks while x and z are in chunks and/or they are not correctly converting to/from chunk/block coordinates (chunk coordinates are the more likely measure to use since structures generate aligned to chunks, not blocks). The command doesn't even give you the exact y coordinate in many cases since that requires actually generating the structure (as opposed to calling a simple canSpawnHere() method, which only accepts chunk x/z coordinates).
I think the formula could be simplified to [ |x1 - x2| + |y1 - y2| + |z1 - z2| ] where '1' is the structure's location and '2' is the player's.
That chunk co'ords thing could very well be the source of the problem, and also be something that Mojang could easily overlook.
/locate is a very big command, it's sure to have bugs in it. The command does, afterall, have to check the seed, check the game code, check the algorithm, calculate player coords, check the files to see what's been found, etc. A lot happens in that one command, so we shouldn't expect it to be perfect in the same release in which it was introduced. I assume a lot of bugs will be fixed with the command by 1.12-1.13
I found a mineshaft in my regular world, so I used the seed to make a creative version of the world to try out the locate command.
Standing right in the real mineshaft I types "locate Mineshaft" and it told me 2056, ?, 1160. The mineshaft was standing in was at 350,30,275 (roughly. It's a huge mineshaft). So I figured maybe it was telling me the nearest mineshaft other than the one I was in.
So I went about 200 blocks away, above ground, and typed locate again. It still told me 2056,?.1160. So I went another 200 blocks away and this time it told me 1160,?,2056. Same numbers, but in reverse order. So I teleported to those two locations and used gamemode 3 to dive down and have a look. There were mineshafts close to both of those locs, even though they were 100 blocks or so away from the given locs.
But, using gamemode 3 I also found several other mineshafts closer than both of those locations. So the wiki says "Displays the coordinates for the closest structure of a given type in the chat for the player who executed the command." But that just ain't true.
The wiki is not maintained my Mojang, anyone can put things on the wiki.
My Github ด้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้дด็็็็็้้้้้็็็็้้้้้็็็็็้้้้้็็็็็้้้้้็็็็็้้้้้
Actually when do you create the world, it may cause of the old algorithm that is different from the new one.
I think by "the closest" it might mean the closest to your ORIGINAL SPAWNPOINT. I'm not sure, but this seems to be the case.
Yes, but it is recognized by Mojang as the official wiki. Curse dose a good job of keeping it maintained. Only rarely will you find false information
Most people out something interesting down here. I don't, so don't bother looking here.
Not so
I was standing less than 20 blocks from my original spawn point when I did that test, so that can't be the answer.
I suspect that the command is bugged somehow, since mineshafts in particular should be very easy to locate since they do not have any dependence on the biome when generating, and even for those that do the game can check the biome at a point without generating terrain, which it does anyway when generating them.
Strongholds were not mentioned; are they affected as well? Because they certainly shouldn't be - the game already had code to locate them with Eyes of Ender long before 1.11, and their spawning algorithm is by far the most complex of any structure (both in placement as well as their biome check, which will offset them by up to 112 blocks from their initial location when searching for a biome that has a positive base elevation/above sea level).
Mineshafts are the simplest of structures in terms of spawning; the game just uses a couple random chances to determine whether they can generate in a chunk (a fixed 1/250 chance plus an x/80 chance, where x is the absolute chunk distance from the origin along either axis and 80 or more gives a chance of 1, so they are most common 1280+ blocks from the origin, and a 1/250 chance means an average spacing of only 253 blocks so the closest mineshafts will certainly be less than 2360 (sqrt(2056^2 + 1160^2)) blocks away. In fact, within such a circular radius you can expect an average of 273 mineshafts when away from the origin!).
I'm not sure how the game searches for structures but the best way would be to search outwards from the player in a spiral and stop when a structure is found, which I implemented in a mod which changed the way strongholds are located and made them "infinite" in number (one thing that is different about strongholds is that in vanilla the game caches their locations due to how expensive it is to run, which is why they only increased them to 128 instead of an infinite number in 1.9. To find the nearest one the game just goes over the list and picks the closest one. However, other structures can be searched by simply iterating over the chunks around the player; a spiral search is easy to implement and fast even with a very large maximum range and does not require making a list of all structures, then checking which one is the closest).
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
I'm guessing it's doing it by layer (E.G. the highest mineshaft gets detected first). What were the Y-co'ords for them?
Please read THIS before making a suggestion
And support the ability to add paintings and records!
That's a good thought. I went back into the creative mode copy and checked it out.
Starting at 87 99 375 (petty close to the world spawn point) I get the following:
/locate Mineshaft reports 2056 (y?) 1160 the actual closest mineshaft point to that location was 1989 42 1181
I moved a couple dozen blocks and tried locate again.
This time it reported: 1160 (y?) 2056 and the actual closest mineshaft point was 1206 19 2071
The closest mineshaft in reality to the starting point of 87 375 is at 354 34 280 which depthwise is between the other two.
Curiously, standing at 1240 62 2099, almost directly over that mineshaft, typing /locate Mineshaft does find the mineshaft under my feet.
So I was kinda right; it looks like it's looking for the closest on the Y axis, not highest, then looking at the X and Z axises. It could be considered a bug, I guess, since the Y axis doesn't really affect travel.
Please read THIS before making a suggestion
And support the ability to add paintings and records!
I've noticed something similar with portals. As a test I stacked three portals on top of each other with the middle one at the same y in the nether as the y in the overworld, and it took me to the one that had the same y. Then I broke the one in the middle and moved it 50 blocks away. The overworld portal still linked me to the one with the closest y even though the x and z of the other two were closer to what should have been the target location.
I discovered that accidentally when I ended up with a portal loop. Portal A in the overworld sent me to portal B in the nether., but portal B in the nether sent me to portal C in the overworld, and portal C in the overworld sent me to portal D in the nether, and portal D in the nether sent me back to portal A in the overworld!
That shouldn't be happening if they calculated the distance correctly; that is x * x + y * y + z * z, where xyz is the difference between the player and structure coordinates; the effect of y will be insignificant for all but very short distances (usually less than 64; the deepest mineshaft I've seen had its center room at y=5; assuming you are not flying at y=1000 or something).
Unless... they have y in blocks while x and z are in chunks and/or they are not correctly converting to/from chunk/block coordinates (chunk coordinates are the more likely measure to use since structures generate aligned to chunks, not blocks). The command doesn't even give you the exact y coordinate in many cases since that requires actually generating the structure (as opposed to calling a simple canSpawnHere() method, which only accepts chunk x/z coordinates).
TheMasterCaver's First World - possibly the most caved-out world in Minecraft history - includes world download.
TheMasterCaver's World - my own version of Minecraft largely based on my views of how the game should have evolved since 1.6.4.
Why do I still play in 1.6.4?
So, in other words, it's in how the game processes the location of structures in general, and this has nothing to do with the actual command itself.
Also, that is very weird. Not quite sure how that happened.
I think the formula could be simplified to [ |x1 - x2| + |y1 - y2| + |z1 - z2| ] where '1' is the structure's location and '2' is the player's.
That chunk co'ords thing could very well be the source of the problem, and also be something that Mojang could easily overlook.
Please read THIS before making a suggestion
And support the ability to add paintings and records!
/locate is a very big command, it's sure to have bugs in it. The command does, afterall, have to check the seed, check the game code, check the algorithm, calculate player coords, check the files to see what's been found, etc. A lot happens in that one command, so we shouldn't expect it to be perfect in the same release in which it was introduced. I assume a lot of bugs will be fixed with the command by 1.12-1.13
My Name Is Bhexion and I make datapacks.
Find me on PlanetMinecraft and Youtube.