RE:NODE

Find the broken Minecraft plugin or mod by bisecting

By RE:NODE Team
20 min read


If you cannot tell which plugin or mod is breaking your Minecraft server, stop guessing and halve the set. Copy the server to a staging copy, move half of the plugin jars out of plugins/ (or half of the jars in mods/), boot, and run the exact thing that fails. If the problem is still there, the culprit is in the half that stayed. If it is gone, the culprit is in the half you removed. Repeat on the guilty half. Thirty-two plugins take five boots, sixty-four take six, and the method does not care whether the symptom is a crash on start, a watchdog shutdown or a server that slowly drops to 12 TPS after an hour. This post is the whole procedure: what you need before you start, how to stage, a script that does the halving, the cases that break the method, and how to prove the answer before you remove anything from the live server.

When bisecting is the right tool, and when it is not#

Bisecting is a last resort that happens to be reliable. Most of the time the server tells you who is guilty, and reading is faster than halving.

Bisecting earns its place when the evidence is missing or misleading:

  • The stack trace is a wall of net.minecraft and org.bukkit frames with no plugin in sight.
  • Several plugins appear in the trace, because they all hook the same event and one of them is feeding the others bad data.
  • The profile points at "the server" or at an event dispatcher, and every plugin listens to that event.
  • The symptom is not an exception at all: players are kicked, a world will not load, entities vanish, chunks load slowly, memory climbs.
  • You inherited the server and there is no record of what was installed when.
  • A mod on Fabric, Forge or NeoForge fails during loading with an error that blames a mixin or a registry, which is rarely readable.

There is one more reason, and it is the strongest. Bisecting produces a result that does not depend on your interpretation. "With these 16 jars the lag is gone, with these 16 it is there" is a fact. A log excerpt is an argument.

What you need before the first boot#

The method fails for boring reasons, almost never clever ones. Settle these before you move a single file.

A reproducible symptom. You need a test that returns pass or fail, and it must be something you can run in a few minutes on a copy with nobody else online. Write it down as a sentence. Good: "the server starts and stays up for five minutes". Good: "typing /spark tps after ten minutes with two test accounts walking around shows MSPT under 30". Good: "teleporting to world_nether 0 0 kicks me". Bad: "lag in the evening". If the problem only appears under real player load, you either need a way to generate it (a few test accounts, a pregenerated area to fly across, the redstone machine or farm that causes the trouble) or you need to bisect in the open on the live server, which is a different and worse procedure covered near the end.

A copy that behaves like the original. Bisecting a fresh server proves nothing. The plugins' data folders, their configs, the worlds and the database contents are what make the bug. Take a backup of the live server first, ideally a fresh one, and use it for the copy. If you have not restored a backup lately, world backup and restore is worth ten minutes before you rely on one.

A list of what is installed. Run /plugins in the console, or list the folder:

bash
$ ls -1 plugins/*.jar | wc -l$ ls -1 plugins/*.jar

Save the output somewhere. On a modded server do the same for mods/. The count tells you how many boots to budget: ceil(log2(n)). Fifteen plugins is four boots, thirty is five, a hundred mods in a pack is seven.

A map of dependencies. Plugins declare what they need in plugin.yml with depend: (hard, the plugin refuses to load without it) and softdepend: (optional, load order only). Paper plugins using the newer format declare the same in paper-plugin.yml. The usual suspects are Vault, ProtocolLib, PlaceholderAPI, LuckPerms, WorldEdit and Citizens. If you park Vault, every plugin that hard-depends on it fails to enable, and your test now measures that failure instead of your bug. The console tells you straight away: lines such as Could not load 'plugins/Foo.jar' followed by Unknown dependency. Keep libraries together with their dependents. A mod loader has the same issue: a Fabric mod can require Fabric API or another library mod by id, and a Forge or NeoForge mod lists its required mods in its own metadata.

A way to see the console. You want the boot log in front of you and the ability to run commands. On RE:NODE that is the Console tab of the Minecraft server, which shows unfiltered output; on any other host it is a screen session or whatever your panel gives you. Check the first 200 lines of every boot, not just whether it came up.

Setting up the staging copy#

A staging copy is a second server with the same files, a different port and nobody on it. There are two honest ways to get one, and the cheaper one is fine for this job.

Option A: a second server. Restore the backup into a separate server, change the port, and bisect there while the live server keeps running. This is the right choice when players are online and you cannot afford downtime. On a panel, the port is on the Network tab and the matching server-port in server.properties must agree with it. Give the copy its own memory limit that is not smaller than the original, or you will chase an out-of-memory error you caused yourself. If you run a database for plugins, point the copy at a copy of the data, never at the live database - see MySQL for plugins.

Option B: the same server, offline. Stop the live server during a quiet window, take a backup, bisect in place, and restore the original jar set at the end. It costs no second plan and no port juggling. It costs downtime for as long as you bisect, so schedule it, say so on Discord, and keep it to an hour.

Whichever you pick, make these changes to the copy before the first test, so that the copy cannot leak or confuse:

  • Set online-mode=true unless you normally run behind a proxy. On a Velocity or BungeeCord backend you will need the same forwarding setup as production or nobody can join. The proxy side of this is in Velocity proxy networks.
  • Turn off anything that talks to the outside world: Discord bridges, Tebex or store webhooks, web maps that upload, vote listeners that pay out rewards. A staging copy that gives a real player a rank is a bug of its own.
  • Set white-list=true in server.properties and add only your test accounts, or you will find strangers on a staging server that is not supposed to be advertised.
  • Remove scheduled restarts and backups from the copy. A restart in the middle of a pass looks exactly like the bug.

The bisect, step by step#

Here is the procedure in the order you do it.

  1. Prove the bug on the copy. Boot the full set, run the test, confirm it fails. If it passes, your copy does not match the original (a missing config, a different world, a different Java version, different load) and nothing after this is trustworthy. Fix the copy first.
  2. Prove the opposite. Park everything you can and boot with only the hard requirements. Run the test. It must pass. If the problem is still there with no plugins at all, the cause is not a plugin: it is the world, the Paper build, Java, the memory limit or the host. Stop bisecting plugins and look there.
  3. Split the list in two. Sort the jars by name, take the first half, move them to a folder outside plugins/.
  4. Boot, read the log, run the test. Record the result.
  5. Take the guilty half and split it again. If the test failed with the second half still installed, the culprit is in the second half. Park half of that, unpark the first half's parked jars so only the suspects are being tested against a stable base, and go on.
  6. Stop at one jar. Confirm it by running the full set minus that single jar. The test must pass. Then put only that jar back and confirm it fails.

For step 3 onwards, do not delete anything. Moving is reversible, deleting is not. Create a parking folder next to plugins/:

bash
$ mkdir -p plugins-parked$ ls -1 plugins/*.jar > all.txt$ wc -l all.txt

Then move a slice by line number. This moves the first half of the list:

bash
$ half=$(( $(wc -l < all.txt) / 2 ))$ head -n "$half" all.txt | while read -r f; do mv "$f" plugins-parked/; done

To move one jar back, mv plugins-parked/Name.jar plugins/. To start a round clean, move everything back and apply the next slice from the list. Keep a plain text log of each boot: which jars were in, what you tested, what happened. By round four you will have forgotten otherwise.

A note on what moving a jar does. Paper only loads files ending in .jar from plugins/, so a parked jar is invisible. The plugin's data folder (plugins/SomePlugin/) stays where it is and is harmless. Do not move the data folders around; the next time the plugin is back, it finds its configs and database where it left them. Renaming a jar to Name.jar.disabled has the same effect and keeps everything in one place, which some people prefer. Moving to a parking folder is easier to read in a listing.

For mods the same logic holds with mods/, with one extra step: after each move, check that the mod loader does not refuse to start. Fabric reports missing dependencies on the console and by name, and the fix for a "mod X requires Y" line is to keep Y in the set. The pattern for modded servers is the same: see Fabric incompatible mod sets and Forge mismatched mod channel lists.

A worked example#

Say you run 24 plugins and the server freezes for several seconds roughly every ten minutes, then prints Can't keep up!. The spark profile is unhelpful: the worst tick is dominated by "event dispatch" with plugins all over it. Your test is: ten minutes of two test accounts walking around the spawn area, then /spark tps and a check of logs/latest.log for "Can't keep up".

RoundPlugins installedResult
0All 24Freezes at minute 9
1Essentials set + 12 othersFreezes at minute 9
2Essentials set + 6No freeze in 15 minutes
3Essentials set + 3No freeze
4Essentials set + 4th to 6thFreezes at minute 10
5Essentials set + 4th onlyFreezes at minute 9

At round 1 the freeze stays with the retained half, so the culprit is in those twelve. At round 2 it goes away, so it is in the twelve minus six, the six that were parked in this round. And so on, narrowing each time. Five or six rounds, a couple of hours of wall time, and you have a plugin by name. Round 5 is the confirmation: the fourth plugin alone, on top of the base set, brings the freeze back. If a freeze does not return when you test the suspect alone, you have found only half of the cause, which brings us to the cases that break halving.

When halving gives a wrong answer#

The method is only as good as its assumption: that one jar causes the symptom. When that is false, you get strange results. These are the four patterns, in the order you will meet them.

Interacting pairs. Two plugins that are fine alone and break together are the classic reason bisecting appears to fail. The symptom disappears whichever half you park, because the pair got split. If round after round the bug is there with the full set and gone with either half, you have a pair or a group. Park one half, then add the other half's jars back one at a time until the symptom returns; the last one added is half of the pair, and the second half is somewhere in the first set. A shorter route is to keep the suspect found by that search and bisect the rest alongside it, with the suspect always installed.

Intermittent symptoms. A lag spike every ten minutes will happily pass a five-minute test. Always test for longer than the longest gap between occurrences, and make a pass mean "survived two full cycles", not "it seemed fine". For a crash that happens once a day you cannot bisect by waiting; you need to provoke it, or you need to switch to the live procedure below.

Load-dependent problems. Some bugs need players or entities to show up. A plugin that scans every loaded chunk is invisible with an empty server. Reproduce load: pregenerate and fly over an area (see world border and pregeneration), spawn the farm or mob cap that triggers it, or run with real players on a staging server for an evening. If you cannot reproduce it, profile the live server instead.

Data-dependent problems. A corrupt entry in a plugin's database, a poisoned chunk or a bad level.dat produces a crash that follows the data, not the plugin. If you park the plugin that reads the data and the crash disappears, you have proven the plugin is involved, not that it is at fault. Test the finding with a fresh data folder for that one plugin on the staging copy. World-side causes look like chunk errors and world corruption or a ticking entity crash.

There is also a rarer fifth case, worth a sentence: the symptom is the sum of many small costs and no single plugin is to blame. Ten plugins each take 4 ms per tick, the budget is 50, and every one of them is innocent individually. Bisecting finds nothing because there is nothing. The profile shows it plainly, so this is a point for profiling first.

Bisecting lag as opposed to crashes#

Crashes are the easy case: the test is binary and takes seconds. Lag needs numbers, so measure it the same way each round or you will be comparing noise.

  • Fix the test conditions: same world position, same test accounts, same duration, nobody else online.
  • Record MSPT and TPS from /spark tps after the run, not by feel. Paper's own /tps also prints TPS. The main number is MSPT: under 50 means the server is keeping up, and anything over that is slipping.
  • Decide the pass threshold beforehand. "MSPT average under 25 and no tick over 200 ms" is a test. "Feels better" is not.
  • Use /spark tickmonitor --threshold 200 during the run if the problem is spikes rather than a general slowdown.
  • Let the server settle. The first two minutes after a boot are not representative: chunks are loading, JIT compilation is warming up, plugins are hitting their databases for the first time. Start the clock after that.

If your lag also depends on memory, include it in the test: a plugin that leaks will look fine for ten minutes and awful after three hours. /spark health --memory shows heap use and garbage collection pressure. Leaks need long soak runs, and that is a point where halving gets expensive. Consider a heap summary instead, and compare it with the plugin list. The Java heap space error fix covers how to read that side of it.

One more trap on a hosted server. The CPU on a container has a hard limit, and a server pegged at its share is slow because of the limit, not because of a plugin. A server at 100% is slow, not broken. Check CPU in the panel's graphs before you decide the plugins are at fault, and compare against the memory limit too. If the numbers show you are at the ceiling with a sensible plugin set, the fix is a larger plan, not a search; see Minecraft plans for what each tier gives you.

Narrowing faster: ordering the list#

Plain alphabetical halving is fine. But you can save a round or two by being smart about how you split.

  • Park the usual suspects first. Plugins that hook many events, scan chunks or entities, or store data on every action are likelier than a MOTD plugin. Anti-cheat, protection, economy shop plugins, entity-clear tools, holograms, custom item and block plugins and anything that does its own world generation lead the list. Splitting by suspicion instead of by name puts the likely culprit on one side sooner.
  • Bring the newest first. If the symptom started recently, the plugin you added or updated since is the first suspect. Your hosting file listing shows modified times: ls -lt plugins/*.jar sorts by date. Test that jar alone before you do anything cleverer. Often that is the whole story.
  • Group by dependency. Treat a plugin and its dependencies as one unit. Vault and an economy plugin and the shop on top form a group; park or keep the group together.
  • Split by author or family. A suite such as EssentialsX ships several jars that expect each other. Keep them together.
  • Ignore libraries on the first pass. A library jar that nobody calls is harmless. Park the plugins and leave the libraries.

Be careful about the temptation to jump straight to the suspect and skip the proof. Intuition about which plugin is guilty is right most of the time and, when it is wrong, wrong confidently. Your suspect jar gets one round of its own anyway, as the first test: all plugins except that one. If the symptom goes, you are done in a single boot. If it does not, the bisect carries on with no loss.

Bisecting on the live server when you have no choice#

Sometimes staging cannot reproduce the problem, and the only place it appears is the live server with players on it. Then you bisect in the open, which is slower and costs players some patience.

  • Do it in short windows, and announce them. Halving a plugin set means restarts, and every restart is a disconnect.
  • Prefer commands that unload things without restarting, with caution. Reloading plugins with /reload on Paper is unsupported and leaks state; many plugins do not clean up after themselves, and the Paper project warns against it. A clean restart is the honest test.
  • Take a backup before the first window and a second one at the end. If the bisect turns up a corrupt data file, you want the version from before you touched it.
  • Change one thing per window. Two changes and a good result tells you nothing.
  • Log results with timestamps. Players report lag at odd hours, and having your windows in a list lets you line theirs up.

Restarts you ask for yourself are not counted as crashes by a restart watcher, but a loop of automatic restarts is. On RE:NODE, a server that restarts three times within an hour gets a warning on the server page and an automatic ticket, and six restarts means suspension. If your bisect is on a server that crashes on start, stop the loop with Stop in the console first, then work on the files while it is off. The same applies to any host with a restart policy. Ours checks for a server that went offline or whose uptime went backwards; restarts you requested are not counted.

If you can, take a schedule that restarts the live server nightly off the table while you test. Tasks on the Schedules tab fire whether or not you are in the middle of a pass; see scheduled restarts and automatic backups.

After you find it: prove it, then act#

Finding the plugin is not the end. Before you tell the community that a plugin was at fault, do three things.

  1. Prove it on the staging copy. Full set minus the suspect passes. Only the suspect plus its requirements fails. Both results, not one.
  2. Check whether it is a known problem. Look at the plugin's release notes and issue tracker for the version you run. The fix may be a newer build, or a config value (a scan interval, a per-chunk limit, a database flush interval). Check that the plugin supports your Paper and Minecraft version: a plugin built for an older API can fail in ways that look like a bug in the plugin when it is a version gap. See Minecraft version upgrades.
  3. Pick an action. Update, configure, replace or remove. Updating comes first when the plugin is behind. Configuration comes next when the plugin has a limit that matches your symptom. Replace it when it is unmaintained and has a maintained alternative with the same data format. Removal is for the plugin you can live without.

When you roll the fix onto the live server, use the same careful routine as any other change: backup first, apply, watch, keep the old jar. It is the same list as in the plugin update routine. Keep the staging copy around for a week; if the problem returns it is the fastest way to find out what you changed.

If the culprit is a plugin that came from outside the usual places, take a look at where it came from. A jar that crashes the server and that you cannot trace to an author is worth a security check, not just a bug report; mod and plugin safety covers how to do that.

Finally, write the finding down. A one-line note, "Plugin X version Y does Z on Paper build N, fixed by config key K", will save the next admin, who may be you in a year, from running the whole procedure again. On a team server, put it in the place where staff read their notes. This is the part most admins skip and the part that makes the next outage short.

Valheim and other games: the same method#

This post is about Minecraft, but the method is general. Anywhere a server loads independent extensions from a folder, halving finds the broken one: BepInEx plugins in Valheim, Oxide plugins in Rust, addons in Garry's Mod. The details that change are how dependencies work and where the logs live. For the Valheim case, with its own dependency problems, see Valheim mod conflicts and dependencies.

FAQ#

How many boots does it take to find one broken plugin?

About log base 2 of the number of plugins, rounded up. Sixteen plugins take four boots, thirty-two take five, and sixty-four take six, plus one boot at the start to prove the bug and one at the end to confirm the culprit. Dependency groups and pairs add a round or two.

Can I bisect without a second server?

Yes. Stop the live server in a quiet window, take a backup, and halve in place, then restore the full set when you are done. It costs downtime but no second plan. Do not bisect a running server with /reload; Paper does not support it and plugins leave state behind, so the results are not reliable.

What if the problem stays with every plugin removed?

Then the cause is not a plugin. Look at the world (chunk or entity corruption), the Paper build, the Java version, the memory limit or the CPU share. Try a fresh world on the same setup; if that is healthy, the world is the problem.

What if two plugins only break when installed together?

Halving will appear to fail: the bug vanishes whichever half you park. Park one half, add the other half back one jar at a time until the bug returns, then repeat with the first half. The two jars that complete the pair are your answer. Often the real fix is updating one of them or changing a shared setting.

Does this work for Fabric, Forge and NeoForge mods?

Yes, with the same steps on mods/. Keep library mods and their dependents together, because the loader refuses to start when a required mod is missing. For crashes during loading, the first line of the log that names a mod id is your starting point; halving takes over if the error is vague.

Should I delete the plugin I found?

Park it first, run for a few days, then delete. Keep its data folder until you are sure you will not need its stored data, because a plugin's database holds player data you may not be able to recreate.

Was this helpful?