Fix "Invalid Dist DEDICATED_SERVER": Client-Only Mod Crashing Your Server
Your modded server worked yesterday, or you just installed a fresh pack, and now it dies a few seconds into startup with a wall of red text and this somewhere in it:
Attempted to load class net/minecraft/client/gui/screens/Screen for invalid dist DEDICATED_SERVER
This is one of the most common startup crashes on Forge and NeoForge modpack servers, and it's almost always a quick fix: one mod in the server's mods folder was only ever meant to run on a player's game.
logs/latest.log, find the mod named next to the error (Forge prints the mod ID and jar file), move that jar out of the server's mods folder, and restart. Repeat until the server reaches "Done". Players keep the mod on their own game.What the error actually means
Minecraft is two programs that share most of their code: the client (the game you play, with graphics, menus and sound) and the dedicated server (no screen at all). Anything under net/minecraft/client/ only exists in the client.
Mods that only change what you see, like shader loaders, custom main menus, loading screens or HUD tweaks, are built against that client code. When one of them ends up on a server and tries to load a client class, Forge and NeoForge refuse and stop the server. "Dist" is short for distribution, and DEDICATED_SERVER is the server one.
You'll see it in a few forms depending on the loader:
| Loader | What the error looks like |
|---|---|
| Forge | Attempted to load class net/minecraft/client/... for invalid dist DEDICATED_SERVER |
| NeoForge | Same wording, often inside Mod <id> has failed to load correctly |
| Fabric | Cannot load class net.minecraft.client... in environment type SERVER |
| Any | java.lang.NoClassDefFoundError: net/minecraft/client/... |
Step 1: Find the mod in the log
Open logs/latest.log (or the newest file in crash-reports/) and search for invalid dist or net/minecraft/client. Then read the lines just above and below it. You're looking for one of these:
- A mod file line, like
Mod File: /home/container/mods/fancymenu_forge_3.2.jar. That's your answer. - A mod ID, like
Failure message: Mod fancymenu has failed to load correctly. - The class that asked for client code. In
at com.example.coolhud.client.HudRenderer..., thecom.example.coolhudpart tells you which mod it is.
If you only have a mod ID, list the mods folder and look for the jar with a matching name. If the name doesn't make it obvious, open the jar like a zip file: META-INF/mods.toml (Forge) or META-INF/neoforge.mods.toml (NeoForge) lists the mod ID inside.
New to crash logs? How to read a Minecraft server crash report walks through the layout.
Step 2: Move it out, don't delete it
Make a folder called removed-mods next to mods and move the jar there. That way, if you picked the wrong one, putting it back is one drag.
Restart the server. Two things can happen:
- It reaches
Done (x.xxxs)! For help, type "help". Fixed. - It crashes with the same error, naming a different mod. Packs often have more than one client-only mod. Repeat steps 1 and 2 until it boots.
Don't remove mods at random. A mod that adds blocks, items or mobs has to be on both sides, and removing it from the server will make players unable to join with a mismatched mod list.
Mods that commonly cause it
Any mod that only changes visuals or menus can trigger this. The usual suspects are:
- Shader loaders (for example Oculus)
- Custom main menu and loading screen mods (for example FancyMenu, Drippy Loading Screen)
- Animation and first-person tweaks (for example Not Enough Animations)
- Notification and sound tweaks (for example Ding)
- Debug screen and HUD mods (for example Better F3)
Many of these are written carefully enough to do nothing on a server, so their presence alone isn't proof. Always go by the name in your log, not this list.
Why a working pack suddenly breaks
The most confusing version of this: the pack ran fine, you updated to the new pack version, and now it won't start. Pack authors usually build one mod list for players and export the server files from it. If a new version adds a client-only mod that doesn't flag itself properly, it lands in the server files too.
Recently we tested a horror pack where exactly this happened: one small notification mod in the latest version crashed every fresh server on startup. With that one jar removed, it booted in under a minute.
How to stop it happening again
- Use the pack's official server files when the author publishes them. They're usually cleaned of client mods.
- After every pack update, check the log once before telling everyone it's ready.
- Keep your
removed-modsfolder. When you update the pack, the same mod may come back, and you'll know exactly what to pull. - Take a backup before updating, so a bad version is one click to roll back. See how to back up a Minecraft server.
If the server still won't start after the client mods are gone, the cause is something else, like the wrong Java version or a missing library. Forge server won't start: every fix covers the rest.
On FreaksMC
When you install a pack with our one-click modpack installer, we boot-test the packs on our list first and strip the client-only mods we've found, so the server starts the first time. If you hit this on a pack we haven't seen, email support and we'll fix it and add it to the list.
Try a FreaksMC server free
Get your own Minecraft server free for 14 days with your own address and Bedrock crossplay set up. No card needed.
Start your free trialFAQ
What does "invalid dist DEDICATED_SERVER" mean?
It means a mod tried to use code that only exists in the Minecraft game client (graphics, menus, sounds) while running on a dedicated server, which doesn't have that code. Forge and NeoForge stop the server instead of letting it run broken.
How do I know which mod is causing it?
Look in logs/latest.log or the crash report for the lines right around the error. Forge and NeoForge usually print the mod ID and the jar file, for example Mod File: /mods/examplemod-1.2.jar. The class name in the error (like com/example/mod/client/...) also points at the mod.
Do players need to remove the mod too?
No. Client-only mods like shader loaders, menu mods and minimaps are fine on players' games. Only the server copy has to go.
What is the Fabric version of this error?
On Fabric it usually reads Cannot load class net.minecraft.client... in environment type SERVER. The fix is the same: remove the client-only mod from the server.
Why did the pack's server files include a client-only mod?
Some packs are uploaded as one list for both client and server, and not every mod marks itself as client-only correctly. A new pack version can add one even if the last version booted fine.
Want a server that just runs fast?
FreaksMC runs on NVMe hardware with performance-tuned defaults baked in - pre-optimized Paper, sane view distances, and one-click world pre-generation. Set up in 60 seconds.
See plans from $3/mo