mojira.dev
MC-126244

'/locate', explorer maps, and treasure maps can cause extreme TPS lag, even leading to a complete server freeze if structure generation is turned off

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

MC-126375 /Locate Immediatley Drops Down My Fps MC-126711 When using /locate says 'Could not Find That Structure Near by" and game lags some much I searched for Igloo MC-128452 the game stop calculate entities when I type /locate in the singleplayer chat MC-128913 [Crash] Overloaded Locate Command MC-130671 /locate Monument freezes game and prevents reloading MC-131176 Locate monument MC-131280 Game Crashes when /locate Village command is used MC-131550 Crash World MC-131671 Locate command crashes game when dungeon is not found MC-131828 Trying to locate distant structures is very resource intensive and may cause crashes MC-131941 /locate MC-132022 /locate uses all memory & crashes game MC-132066 locate command doesnt work MC-132403 You can't search the coordinates of a woodland residence MC-132935 Trading paper for emerald with a cartographer villager causes timeout on server, and all players get disconnected. MC-132946 Extreme tick lag when using the /locate command MC-133027 The command "/locate" cause a serve crash. MC-133062 /locate Mansion not working MC-133068 Cartographer Trading Results in Unending FPS drop MC-133651 World tick lag after open chest in Shipwreck MC-133961 /locate makes FPS huge drop and crash MC-134781 generated chests in ships not displaying on first opening. MC-136464 Underwater chest make the game stop MC-136764 Empty maps bug in 1.13.1 MC-136849 Villager Trading very bugged MC-137249 Is imposible open some chest with a map in a ship MC-137827 /locate takes very long time to locate faraway things MC-138327 Game freeze on /locate Jungle_pyramid MC-138461 Tressure chest GUI on ship recks not displaying. MC-139056 Unlocking the explorer maps trade from Cartographers massively increases the ms per tick and essentially kills the world MC-139280 /locate creates extreme lag that affects mobs and world generator MC-139314 Open chest under water and server crashes MC-140431 MInecraft stop working after the third interaction with the cartographer MC-141680 "/locate mansion" crashes the game MC-142118 Cartographer trade freezes the game on 1.13.2 MC-142908 Using command "/locate " sometimes crashs the game MC-143094 Map item freezing MC-145782 Woodland explorer map takes for ever to generate and freezes game. MC-146488 Using /locate when the structure doesn't exist causes the game to enter a weird, glitch state MC-148089 locate command freezes the game MC-148301 Chests take a while to open MC-148577 Command /locate will "pause" the game MC-149062 Cartographer trade freezes the game on 1.13.2 MC-149743 Sunken Ship Chest Crash MC-149962 World can freeze while cartographer villager unlocks an explorer map MC-150893 All Mobs either freezing or dissapearing when /locate is used MC-151249 Leveling up Cartographer causes chunks to fail loading MC-151575 Using /locate softlocks the game, having to use task manager to close it MC-151722 /locate MC-151832 Game freezes when locating a village in superflat world. MC-152069 Crashing Servers MC-153132 /locate command freezes the game MC-153622 Using locate Village with structure generation off crashes servers MC-156128 some generated chests cause massive lag MC-156303 If you enter "/locate <Structure>" in the world where the "Generate Structures" is disabled, then the world is frozen MC-157024 1.14 Fatal Server Crash when using /locate command MC-158088 Opening Chests With Treasure Maps Inside Causes Extreme Slow Down on SSP & Crash on SMP MC-158804 bug on map errore code -1 MC-158829 /locate monument not working MC-158860 Levelling up villagers freezes the game MC-158865 Cartographer crashes server in 1.14.4 MC-159181 The game doesn't work(about game code) MC-159339 Chests in Shipwrecks won't open properly MC-160141 Minecraft Realm /locate bug MC-160694 Cartographer trades crash world when structures are off MC-162032 Cartography Villagers glitching on worlds with no structures MC-162178 Locate Command on a World with Generated Structures Off Causes Crash MC-162985 Bug in singleplayer with cartographer MC-162989 Map Villager Crash with no Structures MC-163429 /locate lags game MC-164938 Locate causes lag MC-164960 Trading with Cartographer Villager MC-166230 Game freezes using locate command MC-166564 Extreme Lag when opening Shipwreck Treasure Map Chest on Realms MC-167302 Server crashs when opening a map chest in shipwreck MC-169572 Cartographers time out server when searching for structures MC-170159 /locate can lock up the game if no features are generated. MC-170199 /locate freezes the world or times out servers when structure generation is disabled MC-173116 [DUPLICATE] World time freeze MC-173409 "/locate" bug MC-173592 Issue with Cartographer Villager MC-174681 Redstone and AI do not work after using the "locate" command. MC-176463 World stops responding after typing /locate EndCity MC-177355 Using /locate jungle_pyramid in jungle superflat freezes world MC-177520 cartographer crashes server when leveling up past apprentice MC-179636 /locate in a world without generated structures seemingly softlocks the game MC-179692 Trading with cartographer will crash the vanilla 1.15.2 server MC-180991 /locate in a no structures world is like a crash MC-184343 When with villagers game crashes . Tried no sound lower setting still it locks up and does not resolve its self. MC-184553 uncontrolled chunk loading by /locate in world with structures disabled MC-185477 Locate command broken MC-190745 /locate crashes world

Attachments

Comments

migrated

I'm pretty sure that is normal. How can the game know where the structures are placed without checking the seed?

black-hole

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

migrated

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.

CreeperMagnet_

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.

migrated

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

migrated

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.

migrated

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

migrated

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.

migrated

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.

migrated

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.

McModknower
migrated

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

Leon_Xu

Still not work normally in 1.13 pre-2.

"/locate" can only locate the structure(s) in loaded chunck(s).

migrated

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..

violine1101

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.

migrated

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

migrated

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.

CivetKitty

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. 

qwerty23495

Please reopen

Jacie_krece

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

migrated

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

migrated

/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. 

CreeperMagnet_

@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.)

migrated

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

migrated

Unfortunately, it is not fixed yet.

migrated

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

migrated

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

migrated

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?

migrated

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.

FaRo1

"Vanilla" means unmodified. You mean server lag.

migrated

@@unknown Yes.

qwerty23495

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

migrated

 1.13pre9 still has this problem

Makzevu

Is this still in 1.13?

migrated

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.

 

FaRo1

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

migrated

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!

FaRo1

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.

qwerty23495

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.

migrated

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?)

migrated

can reproduce in 18w43a and 18w43b.

migrated

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

migrated

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.

migrated

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

migrated

Confirmed for 1.14.2 Pre-Release 2

Makzevu
migrated

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

migrated
[media][media]

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.

migrated

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.

migrated

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

migrated

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.

dscheJ-Ouh

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)

migrated

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

migrated

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

migrated

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.

migrated

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?

migrated

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

migrated

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
migrated

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

ZeNico13

@@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!

migrated

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

migrated

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

ZeNico13

@@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!

tqz78

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

migrated

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.

migrated

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!

migrated

boq

Confirmed

Normal

Commands, Performance, Structures, Trading

/locate

Minecraft 18w08b, Minecraft 18w09a, Minecraft 18w10c, Minecraft 18w10d, Minecraft 18w11a, ..., 20w10a, 20w11a, 20w13a, 20w13b, 20w15a

Minecraft 1.13-pre6, 20w17a

Retrieved