What "invalid dist DEDICATED_SERVER" means
invalid dist DEDICATED_SERVER means Forge or NeoForge refused to load a class meant for the game on a player's computer, because this is a dedicated server. Everything under net/minecraft/client/ is that kind of class, and so is any class a mod marks as client-only. The loader logs the attempt under DISTXFORM and the server crashes.
Forge 1.20.1, in the console
[main/ERROR] [net.minecraftforge.fml.loading.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/MouseHandler for invalid dist DEDICATED_SERVERNeoForge 1.21.1, in the console
[main/ERROR] [net.neoforged.fml.common.asm.RuntimeDistCleaner/DISTXFORM]: Attempted to load class net/minecraft/client/Options for invalid dist DEDICATED_SERVER| Class in the error | What it is in the game | Mods that touch it |
|---|---|---|
net/minecraft/client/Options | The player's settings: video, sound, controls | Mods that add or change options |
net/minecraft/client/MouseHandler | Mouse input | Camera, zoom and input mods |
net/minecraft/client/gui/screens/Screen | Every menu screen | Mods that add or change menus |
net/minecraft/client/gui/components/AbstractWidget | Buttons, sliders and text boxes | Menu and HUD mods |
These four are the classes we found in crashes on servers we host, on Forge 1.20.1 and NeoForge 1.21.1. The class tells you what the mod wanted, not which mod it was. That is the next step.
Find the client-only mod that crashes the server
To find the client-only mod, look for the Mod file: line in the crash report first: when the loader knows which jar asked for the class, it writes the full path, such as Mod file: /home/container/mods/...jar, and that jar is the one to remove. Without it, the class name and the lines around it narrow it down.
| What you see | Where it points |
|---|---|
Mod file: /home/container/mods/...jar in the crash report | That jar. Remove it. |
A class from a mod's own package, such as com/example/zoom/ZoomClient | The package name: by convention it holds the author's name and the mod's |
A class under net/minecraft/client/ and no mod named | The mod lines just above it in the log, or a split search |
Crash reports are in the crash-reports folder, and the crash report guide shows which part to read. If nothing names a mod, split the search: move half of the mods out of mods, start the server, and keep halving the half that still crashes. With 200 mods that takes about 8 starts. If the server then stops because a library is missing, put that library back and carry on.
Which mods are client-only and stay off a server
Client-only mods change what one player sees, hears or presses: shaders, minimaps, zoom, HUD and menu mods, sound and animation mods, and mods that make the game draw faster. They belong in the players' own mods folder, and players can use them on your server without the server having them.
| Kind of mod | On the server? |
|---|---|
| Shaders and rendering, such as OptiFine, Iris, Oculus, Sodium and Embeddium | No, players only |
| Zoom, HUD, menus, keybinds and sounds | No, players only |
| Minimaps and world maps | Usually players only. Some have a server part too, and their page says so |
| Content mods: new blocks, items, mobs, dimensions | Yes, on the server and on every player |
| Libraries that other mods need | Wherever the mod that needs them goes |
Do not build a server from your game's mods folder
The mods folder of your own game also holds your shaders, minimap and performance mods. For a server, take the modpack's server files, or copy only the content mods and the libraries they need.
Client-only mods on Fabric: "Cannot load class in environment type SERVER"
On Fabric, a client-only mod that says so in its fabric.mod.json, with "environment": "client", is not loaded on a server at all, so it cannot crash it. A client-only class that does get loaded stops the server with Cannot load class ... in environment type SERVER, Fabric's version of the Forge message.
Fabric, an example with a made-up mod class
java.lang.RuntimeException: Cannot load class com.example.zoom.client.ZoomHud in environment type SERVERWarnings such as @Mixin target net.minecraft.class_310 was not found are a different thing. class_310 is Fabric's name for the game client, and the warning means a mod's client part had nothing to attach to on the server and was skipped. They are only worth a look when the server stops right after them. For the other Fabric startup errors, see Fabric incompatible mods found.
Fix it: remove the mod from the server, keep it on the client
To fix the crash, remove the client-only mod from the server's mods folder and start the server again; players who use the mod keep it in their own game, where it works as before.
Find the jar
Use the
Mod file:line or the class name from the crash, as above.Remove it from the server
On Lodehost, open the Mods tab, type part of its name in Filter installed mods and press Remove. You can also delete it from
modson the Files tab.Start the server
If it stops again with the same error and a different class, a second client-only mod is in the folder. Repeat until it starts.
Add new mods through the search
The Mods tab searches Modrinth and only shows mods that run on a server, so client-only mods do not turn up there.
Written and checked by the Lodehost team, last reviewed on 8 November 2026.







