How to Fix Lag Spikes When Using Treasure Maps or /locate
What Causes the Lag
Treasure maps and the /locate command force the game to scan large areas for a matching structure. With many structure mods installed, that scan can take a long time and freeze the server tick loop. Structure Essentials replaces the slow search with a faster lookup and adds a hard timeout so a runaway search can't hang the server.
Tuning Search Behavior
Open the config and look for the search-related options:
- Timeout: The maximum time a search is allowed to run. If your server still stutters, lower this so bad searches bail out sooner. If searches are failing too often, raise it.
- Search distance: How far the game looks for a structure when a map or locate request comes in. Shorter distances finish faster.
After changing values, restart the server. Test by using a treasure map or running /locate structure for a structure you know exists nearby. The command should return quickly instead of pausing the whole server.
If you're on a multiplayer server, these settings are server-side — players don't need to change anything on their clients. Communicate the new limits to your players so they understand why very distant locate requests may fail.