How to Detect Lag Machines on Your Server
Learn how to detect lag machines minecraft server griefers build. Use Spark profiling, entity audits, redstone monitors, and anti-lag plugins to find and neutralize intentional lag sources.
What Is a Lag Machine
A lag machine is any player-built contraption designed to overwhelm the server's tick loop, usually by exploiting game mechanics that are computationally expensive. Common designs include massive piston arrays, infinite redstone loops, thousands of entities crammed into a single chunk, water/lava flow cascades, and TNT cannons. Some are built maliciously by griefers who want to crash the server. Others are accidental, a player builds a complex redstone project without realizing it tanks TPS for everyone. Either way, you need to detect lag machines minecraft server setups are vulnerable to and shut them down quickly.
Symptoms of a Lag Machine
The server was running fine, and then TPS suddenly drops to 5 or lower. Players report block-break delay, chat lag, and rubber-banding. The lag persists even after restarting, because the machine activates automatically when its chunks load. Sometimes the lag starts when a specific player logs in (they load the chunks containing the machine). Other times it runs continuously in force-loaded or spawn chunks. If TPS problems appeared suddenly and are not caused by a plugin update or Java issue, a lag machine is a strong suspect.
Using Spark to Find the Source
The fastest way to detect lag machines minecraft server owners deal with is through Spark profiling. Run /spark profiler and let it capture data for 60 seconds while the lag is active. Then examine the flame graph:
- Block ticking: If
ServerLevel.tickBlockorRedstoneWire.updatedominates the profile, a massive redstone contraption is firing. Spark's tick monitoring (/spark tickmonitor) can show you which ticks are slow. - Entity ticking: If
Entity.tickorLivingEntity.aiStepconsumes most of the tick, something is spawning or holding thousands of entities. Use/paper dumpentityto see per-chunk entity counts. - Explosions: If
Explosion.explodeor TNT-related methods appear, someone is detonating massive amounts of TNT.
Entity and Tile Entity Audits
Run /paper dumpentity (Paper 1.19+) to get a full list of entity counts per world and chunk. Sort the output by count and look for outliers. A single chunk with 500+ entities is almost certainly a problem. Common culprits include:
- Minecarts: Thousands of minecarts stacked in one block create extreme collision calculation overhead.
- Armor stands: Used in some lag machine designs because they are entities with collision boxes.
- Dropped items: Infinite item generators flood chunks with item entities.
- Boats and boats-in-minecarts: Nested vehicle entities multiply physics calculations.
For tile entities (hoppers, pistons, command blocks), check your server logs or use a world editor to scan for chunks with abnormal tile entity counts. A chunk with 200+ hoppers is either a sophisticated sorting system or a lag machine.
Redstone Monitoring
Redstone-based lag machines are the most common type. Paper tracks redstone activity and can throttle it with the redstone-implementation setting:
# paper-world-defaults.yml
redstone-implementation: ALTERNATE_CURRENT
ALTERNATE_CURRENT is a rewrite of the vanilla redstone engine that processes updates much more efficiently. It does not stop lag machines entirely, but it raises the threshold of how complex a redstone circuit needs to be before it causes problems. See our redstone optimization guide for the full setup.
For active monitoring, plugins like LagFinder and Insights scan chunks in real time and flag those with excessive redstone activity, entity counts, or tile entity counts. Insights can even set hard limits per chunk, automatically preventing players from placing the 257th hopper in a chunk.
Anti-Lag Plugins
Several plugins are designed specifically to detect lag machines minecraft server administrators worry about:
- Insights: Sets per-chunk and per-world limits on specific block types and entities. Prevents lag machines from being built in the first place by blocking placement when limits are exceeded.
- RedstoneLimiter: Monitors redstone events per chunk per tick and disables circuits that exceed a configurable threshold.
- EntityDetection: Scans for chunks with high entity density and alerts staff.
- ClearLag: While primarily a cleanup tool, ClearLag's entity limiter can cap entities per chunk and auto-remove overflow.
Reactive Measures
When you find a lag machine during active lag:
- Identify the chunk coordinates from Spark or the entity dump.
- Teleport to the location:
/tp @s <x> 100 <z>. - If the lag is so severe you cannot teleport, use an async world editor like FAWE to delete the chunks, or stop the server and use MCEdit/Amulet to remove the offending blocks.
- Ban or warn the player responsible. Check CoreProtect or Prism logs to identify who placed the blocks.
- After cleanup, install preventive limits so it cannot happen again.
Prevention
The best defense is prevention. Combine entity-per-chunk limits (see our entity limits guide), redstone tick limits, piston push limits (Paper's piston-push-limit setting), and block placement auditing to make lag machines impractical to build. A well-configured server makes it physically impossible for a player to place enough pistons or hoppers in one area to cause meaningful lag. Document these limits in your server rules so players understand why their mega-farm got throttled.
See an optimized server in action: Astroworld MC, IP play.astroworldmc.com, Java + Bedrock.