HomeJavaModsLagDoctor
LagDoctor
ModsJava

LagDoctor

Diagnosis + prescription for server lag: measures tick times, chunk entity density and config values, then gives ranked, actionable fixes instead of raw…

⬇ Download on Modrinth

LagDoctor

Diagnosis + prescription for server lag — no profiler jargon.

LagDoctor measures your server from the inside (tick times, entity/tile-entity density per chunk, server config values) and turns the results into ranked, actionable recommendations instead of raw profiler data. Where a profiler shows you flame graphs, LagDoctor tells you things like:

The chunk at 5,-3 in region r.0.-1 contains 412 hoppers — raise ticks-per.hopper-check in spigot.yml to 8.

Everything runs inside the server: no external services, no web API, no spark dependency. Output language is selectable (English / Turkish).

✨ Features

Intentionally out of scope: continuous background profiling, method-level profiling (that's spark's job), web panels, automatic config editing, and entity removal/cleanup.

🚀 Installation

  1. Download the LagDoctor jar and drop it into your server's plugins/ folder.
  2. Restart the server (or start it for the first time).
  3. Optionally edit plugins/LagDoctor/config.yml and run /lagdoctor reload.

Requirements: Paper (or a Paper fork such as Purpur) 1.20.4 – 1.21.x, Java 21. Spigot is not supported — the tick-duration events LagDoctor relies on are Paper-only.

💬 Commands

Command Description Permission
/lagdoctor scan [world] Full diagnosis: tick stats + chunk scan + config audit, ranked report lagdoctor.scan
/lagdoctor report [page] Re-show the last scan report / print the report file path lagdoctor.scan
/lagdoctor top [entities|hoppers] List the 10 busiest chunks (click to teleport) lagdoctor.scan
/lagdoctor tps Instant MSPT/TPS summary and spike count (lightweight, safe anytime) lagdoctor.tps
/lagdoctor tp <world> <chunkX> <chunkZ> Teleport to a chunk from a report (target of the clickable text) lagdoctor.teleport
/lagdoctor reload Reload config and message files lagdoctor.admin

All commands also work from the console (except tp). Everything defaults to OP-only. /ld is available as an alias.

⚙️ Configuration

language: en                # en | tr — language of all output
sampler:
  history-ticks: 6000       # ring buffer size (~5 min at 20 TPS)
  spike-threshold-ms: 100   # a tick longer than this counts as a "spike"
scan:
  chunks-per-tick: 20       # scan speed; lower = less impact, slower scan
  top-chunk-count: 10       # busiest chunks listed by /lagdoctor top
report:
  save-to-file: true        # write markdown reports to plugins/LagDoctor/reports/
  max-saved-reports: 20     # older report files are deleted automatically
  findings-per-page: 8      # findings per chat page
thresholds:                 # rule thresholds (advanced tuning)
  hoppers-per-chunk: 60
  entities-per-chunk: 150
  dropped-items-per-chunk: 200
  tile-entities-per-chunk: 100

messages_tr.yml and messages_en.yml are copied into the plugin folder on first start and can be edited freely.

🔒 Data & privacy

❓ FAQ

Does scanning lag the server? No. The scan processes at most chunks-per-tick chunks per tick (20 by default), so even a world with thousands of loaded chunks is swept without a visible MSPT increase — it just takes a few seconds longer.

How is this different from spark? spark shows you where the time goes at the method level; LagDoctor tells you what to do about it at the gameplay/config level. They complement each other.

Verified by MCModsHub

These come from our own check of the pack file, not from the source page.

Explore more