Recognising the crash
NeoForge and Forge often report an error such as "Attempted to load class net/minecraft/client/... for invalid dist DEDICATED_SERVER". Fabric may say a mod requires the client environment, or crash on a class in the net.minecraft.client package. Any crash mentioning client classes on a server points at a client-only mod.
The usual suspects
- Rendering and shaders: Sodium, Iris, Embeddium, OptiFine, Oculus
- Interface and HUD: some minimaps, zoom mods, inventory tweaks, menu mods
- Sound and visual effects, such as particle or ambient sound mods
- Client utilities such as Mod Menu, and client-side culling mods
Finding the culprit
Open the newest file in crash-reports, or the end of logs/latest.log, and look for a mod ID near the top of the stack trace. If none is named, move half the mods out, test, and keep halving. With a hundred mods that takes about seven restarts.
Modrinth labels each mod as client, server or both, and CurseForge pages usually say so in the description. Checking before uploading saves a lot of time.
The cleaner way
Install from a modpack's official server files or from a .mrpack with a tool that skips client-only files. Those are already filtered.