The bug
The server will cause lag when we try to locate any of the structures away. With structure generation turned off, this can completely freeze the server.
Note that /locatebiome
(introduced in 20w06a) has a timeout.
Linked issues
is cloned by
is duplicated by
relates to
Attachments
Comments


@Dungeneer In earlier versions, like 1.12.2 the structures are located based on the seed without loading/creating chunks.

I believe this issue may be linked to the bug in which structures that are too far away fail to be located, which didn't happen in 1.12.2. Not sure if I should make a new report for that issue (haven't found a match through searching), or if I should forego that for now as a fix to the current issue may also fix that issue as well.

As @unknown said, this is caused by structures not being able to be located.
This also affects explorer maps, and is still present in 18w10a.
Someone might want to update the description and title, or create an entirely new issue.

I tested this in the 18w10d Vanilla server and a few locates is will lag the server for 7-8 seconds.

Still present in 18w11a, /locate to a Mansion returns 'Could not find that structure nearby' and badly lags the client for several seconds. It's also consistent with EndCity and consistent through a dozen single player survival worlds I've created and tested on.

Confirmed in 18w15a, still gives lag and error message for structures that are too far away.

Still not working 18w19b.
In general Locate is not working. Tested for buried treasure and others. It shows a location for those, but getting there (where is says you are 1 block away) there is nothing there. Both times it was at Y=0 where the N blocks away dropped to 0.

The following may, or may not, be useful.
1) Create world in latest build (18w20a)
2) Use locate mansion. Returns not found.
3) Copy seed, create same world in released version of MC.
4) Locate mansion. Works.
5) Re-open original world in 18w20a.
6) TP to mansion location. Mansion is there. (Verifying mansions are getting created, just that locate is not working as expected)
7) Locate mansion while standing next to it. Works. (Verifying that locate works some of the time. Distance SEEMS to be the issue (but read on!).
8) Press F3. Fly away. Very quickly the amount of memory used is 100%. (Note computer has 32GB and 64 bit Java is in use, but only 4 is allocated). However, at over 1000 blocks, the locate STILL SEEMS TO WORK (but read on!).
9) Due to 100% mem use, save quit. Allocate 8 GB of mem to "latest release" profile, Restart.
10) Do locate, from where it worked before. NOT FOUND. Indicating that locate failing IS NOT simply distance dependent. It is a sticky bit of some sort.
11) Fly back toward mansion. MANSION IS IN SIGHT, but about 100 or less away. Try locate. Locate fails.
Perhaps this will lend further insights. Cheers.

This lags my game more than a few seconds.. I have a large biomes world, and testing the locate command lags to the point of the game freezing- I am simply forced to force quit the game.

Is this related to https://bugs.mojang.com/projects/MC/issues/MC-130449 ?

@@unknown I guess no, this issue it's about the /locate command.

Still not work normally in 1.13 pre-2.
"/locate" can only locate the structure(s) in loaded chunck(s).

Guys, locate command works properly... Lag is caused because the command is generating all chunks and checking if there is any structure you are searching for... And if message Could not find that structure nearby shows up, then the structure is NOT NEARBY..
It shouldn't halt the entire game for 10 seconds though. Besides, /locate
didn't generate chunks in order to locate something in 1.12.2.

1.13 pre3 new random world, not a lot generated around spawn.
Locate works fine if structure is roundabout <500 Blocks away.
Gives little Lag if <800 Blocks, randomly crashes
Mostly crashes game after huge lag if >1000
Since now... ALWAYS crashes if not even nearby.
Open to Lan makes it a lot worth although nobody else joined game.
No Crash Report added

My results in 1.13-pre4;
1) "Could not find that structure nearby" is not fixed.
2) Vanilla lag is not fixed.
3) FPS drop I think is fixed.

It hasn't been fixed at all. I tested the command using the seed -4654979345475103749 at spawn, and tried to locate a mansion. Of course, it failed. I also tried unlocking an explorer map, but after doing the empty map trade with a cartographer, the game froze for a moment and the trade wasn't generated.

Please reopen

@MrWener /locate Village generates error "Cloud not find that structure nearby" even if on the village well. Simply this command isn't working.

/locate is continuing to crash my vanilla pre-release 4 server, so this issue doesn't seem to be resolved as of yet.

/locate still a bug for Mansion and Desert Temple as of 1.13 pre 5 - It will lag tremendously without giving coordinates then eventually crash.

@unknown, that doesn't matter anymore. This bug has already been marked as resolved for the NEXT version. It doesn't matter if it affects the current version, what matters is if it will affect the next version. Adding another affected version won't change anything about this bug. They obviously have enough information, and have already fixed it. (Hopefully.)

I also discovered this loophole, which was discovered in May.

Unfortunately, it is not fixed yet.

I can also confirm that /locate Mansion timed out on 1.13-pre6 as well.

For people who time out and crash, can you post your crashlog ?

It doesn't seem to cause severe lag on my end anymore, but the structure still can't be located. It doesn't time out or crash, but will a forced crash be of any use here?

Hello, @unknown! Today I tryed the /locate command with pre7 and finally we have the better experience!
The /locate command is run better on 1.13-pre7, but the Vanilla lag (when typing /locate <locate> command the Vanilla server will lag) is not fixed yet.
Here's my results on 1.13-pre7:
FPS drop is fixed.
"Could not find that structure nearby" error message is fixed.
Vanilla lag is not fixed.

"Vanilla" means unmodified. You mean server lag.

@@unknown Yes.

Server lag won't be fixed until the /locate command stops generating chunks to look for structures.

1.13pre9 still has this problem

Is this still in 1.13?

I noticed in pre10 that new worlds were ok, /locate had no lag and returned accurate coords as in structures were actually there. Old worlds, those I created in earlier 1.13 snapshots, had no lag anymore but /locate returned coords where structures were not there. 1.13 also seems ok thus far in my limited testing with a new world.

Are the structures also missing in 1.12.2 worlds? Upgrading between snapshots is not always supported.

No, 1.12.2 was fine. I didn't try to bring a 1.12.2 generated world into 1.13 snapshots or even 1.13. I was merely trying to point out that the issue, at least for me, looks to be resolved. Thanks!

I was asking whether /locate in 1.13 finds structures in 1.12 worlds, either generated in 1.12, generated in 1.13 or not yet generated. Those are three test cases that should be checked before this gets closed.

I can confirm that 1.13 locate can find 1.12 generated structures. I tested with '/locate Mansion' in Etho's LP world, and I was directed to a Mansion that had already spawned and had been looted.

There's still lag when opening a shipwreck map chest (just the map chest). I added some more info re: this to a bug report already marked as duplicate as above: https://bugs.mojang.com/browse/MC-133651
Is it always to be expected to have lag on a server for it to generate the treasure maps upon opening the chest? (and also in a singleplayer world?)

can reproduce in 18w43a and 18w43b.

Can confirm for 1.13.2 and 18w43a/b/c.

19w09a results:
There are no longer FPS drop or "Could not find that structure nearby" error. But when try to locate some structure the vanilla server will cause lag.

The only problem is the TPS lag. I can't get any FPS drop errors now.

Confirmed for 1.14.2 Pre-Release 2

Perhaps related to MC-157024 fatal server crash when using /locate command.

Affects 1.14.4 Pre-Realease 7
My servers are crashing because of this
Server console output when using /locate Village:
[10:31:07] [Server Watchdog/FATAL]: A single server tick took 60.00 seconds (should be max 0.05)
[10:31:07] [Server Watchdog/FATAL]: Considering it to be crashed, server will forcibly shutdown.
EDIT: This is happening when the world is generated with generate-structures=false.

Affects 1.14.4 - and still will stop any single player or server in it's tracks if the world was generated with generate-structures=false. To recreate in single player : while in "Create New World" click on "More World Options", then click on Generate Structures to turn it off. Create the new world and execute the command /locate Village. Then wait while it comes to a complete halt.

The Minecraft server client times out even with generate structures set to true on 1.14.4. See MC-158088 for more details.

Still seeing this 1.15.2. Very reproducible on opening chest in sunken ship. Have upped the max-tick-allowed to 480000 and still crashes.

On slower/weaker systems, the game first freezes, then crashes with a Java Heap Exception on opening the treasure map chest in sunken ships. (1.15.2)

Im having the same problem, me and my friends are having troubles with the cartographer. The server just freezes after the villager reaches Journeyman. Also our world was generated with generate structure to on

Still a problem in 1.15.2, especially when the cartographer villager ranks up Ocean Explorer map trade.

Setting "max-tick 600000" causes a timeout disconnect for the clients, but the game continues after a pause. So clients can reconnect and the game is not crashed.
The default "max-tick 60000" crashes the sever and the game is sent back some minutes due to not saved data.

This doesn't seem to be fixed. I'm getting this problem on a 100% vanilla server on 1.16.5. When the cartographer levels up, the server freezes for everyone. Is there any way this can be marked as not resolved?

Having this problem on a 1.16.3 server running on an AWS t3a.medium instance. Johannes' workaround works for me.

We discovered, that you can prevent server crash (in Shipwrecks) when setting (but in this thime the chest will not have a trasure map)
max-tick-time=-1

I discoved what causes this problem:
It only happens, when you try to get a trasure map in an area where most chunks arround you are already generated in a older version.
Seems that the game tries to find an burried trasure for the map, but it can find a burried trassure, because there are not enough unloaded chunks arround.
Mojang should yust check "if there is not area close, where a burried trassure could be place --> Skip generatting of trasure map" this would fix the problem

@@unknown I think if you still have this problem, you should create a new ticket and post it here in a comment. If you can attach a demonstration video, that would be great!

Still getting this in 1.17 and 1.17.1. Game freezes for upwards of 10 minutes when leveling up a cartographer.

I have found that this is a problem in 1.17.1, but it happens for me even when structures are in the world. Attempting to close the game by saving and quitting cause it to save the world for an extended period of time, and pressing alt+f4 causes the screen to go black without it actually closing
edit: And it only seems to happen when locating mansions

@@unknown I think you should create a new ticket for this, and mention this new ticket here in a comment. If you can attach a demonstration video that would be great!

@unknown Different problem; it only happens with OptiFine when trading with a cartographer, not by using a /locate command. See MC-228721.

New ticket MC-238830 , but just for the server lag caused by opening a buried treasure map in a chest in a stronghold or /locate buried_treasure somehow having to take an unreasonably long time to locate the nearest buried treasure, not the mansion issue that just seems to be an optifine bug.
The odd thing is this seems to have been fixed in the 1.16 snapshots but by 1.16.5 it's still just as big of a bug... then by 1.17 and 1.17.1 it seems to be fully fixed again. Then starting at 21w37a it has resurfaced yet again, which indicates that it isn't a really high priority issue that is easily broken from update to update.
Edit: This turns out to already have been reported as MC-238830 but not listed in the comments here. Probably will just be merged with that one.

For me i can confirm this happens in 1.19 in which it soft locks my game not letting me leave. Even after restarting the launcher and doing End Task in task manager because I couldn't close it. I still would not be able to do anything normally like i would fly through the floor and I also got straight up put on a Lead by a llama. It only worked normally on the 3rd reboot. Even though its a world with multiple biomes when I do /locate biome [?] it will do the same thing. I have a video that shows the bugs but it is "Too big of a file size". I might crop the video except I have no idea how to do that. I don't know if I should open this for a new ticket? But location maps also crash your game pretty much infinitely cuz when you restart the game your still holding it. I might add another comment later with more detail after I look into this more!
I'm pretty sure that is normal. How can the game know where the structures are placed without checking the seed?