The Minecraft Crash That Wasn't the Mod Everyone Blamed
Clicking Disconnect on my modded server crashed every client. Weeks of bisecting pointed at the wrong mod. One debug flag found the real one.
On the modded Minecraft server I run for friends, clicking Disconnect crashed the game: a NullPointerException deep in Fabric's registry sync, every time. The stack trace mentioned registries, and the biggest registry-touching mod in the pack was Polymer, so that's where I looked. I spent weeks bisecting it, along with a couple of other suspects. Nothing changed.
The actual evidence was a single line the server only prints with -Dfabric.registry.debug=true: "multiple objects hold the raw ID 22" in minecraft:armor_material. A small backport mod defined its copper armor material as a supplier that registered a new entry every time it was called, and it got called five times. So minecraft:copper sat on five raw IDs. Fabric syncs registries by name, the client rebuilt the table with four empty holes, and on disconnect it walked into one of them.
The fix was a few lines: memoise the supplier so it registers once. I built a patched jar, shipped it to the server and to both modpacks, and confirmed it two ways: a registry dump with zero holes, and a real disconnect that went back to the main menu.
That debug flag now stays on in the server's start script, and it also writes the registry contents to CSV on every join. The lesson: when the stack trace points at a subsystem, find the tool that makes the subsystem explain itself before you start blaming mods.