Lodehost logoLodehost

Performance and fixes

Attempted to load class for invalid dist DEDICATED_SERVER: find the client-only mod

Attempted to load class net/minecraft/client/... for invalid dist DEDICATED_SERVER means a mod on your server tried to use a part of Minecraft that only exists in the game on a player's computer, such as the settings menu or the mouse. A dedicated server has no screen, so it stops right there. The fix is to find that mod and take it out of the server's mods folder; players can keep it in their own game. This guide shows how to read the error on Forge, NeoForge and Fabric, how to find the jar, and which kinds of mods belong on the client only.

5 min read

Configure your serverPick a plan and order your server.
A grass island with a server tower, a dark monitor block showing a small landscape with an orange warning sign in front, and a mint mod crate next to the tower
A dedicated server has no screen. A mod that reaches for one stops it at startup.

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_SERVER

NeoForge 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 errorWhat it is in the gameMods that touch it
net/minecraft/client/OptionsThe player's settings: video, sound, controlsMods that add or change options
net/minecraft/client/MouseHandlerMouse inputCamera, zoom and input mods
net/minecraft/client/gui/screens/ScreenEvery menu screenMods that add or change menus
net/minecraft/client/gui/components/AbstractWidgetButtons, sliders and text boxesMenu 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 seeWhere it points
Mod file: /home/container/mods/...jar in the crash reportThat jar. Remove it.
A class from a mod's own package, such as com/example/zoom/ZoomClientThe package name: by convention it holds the author's name and the mod's
A class under net/minecraft/client/ and no mod namedThe 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 modOn the server?
Shaders and rendering, such as OptiFine, Iris, Oculus, Sodium and EmbeddiumNo, players only
Zoom, HUD, menus, keybinds and soundsNo, players only
Minimaps and world mapsUsually players only. Some have a server part too, and their page says so
Content mods: new blocks, items, mobs, dimensionsYes, on the server and on every player
Libraries that other mods needWherever 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 SERVER

Warnings 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.

  1. Find the jar

    Use the Mod file: line or the class name from the crash, as above.

  2. 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 mods on the Files tab.

  3. 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.

  4. 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.

FAQ

Client-only mod questions

What does "invalid dist DEDICATED_SERVER" mean?

That a mod tried to load a class made for the game on a player's computer, on a dedicated server. Forge and NeoForge refuse, and the server stops.

Can a client-only mod run on a server?

No. It needs the screen, the menus or the mouse, and a server has none of those. Players can still use it in their own game while they play on your server.

Do players have to remove the mod as well?

No. Only the server's copy has to go. A client-only mod in a player's own game keeps working when they join your server.

Does OptiFine go on the server?

No. OptiFine changes how the game draws, so it only goes in the players' games. The same goes for Sodium, Embeddium, Iris and Oculus.

What is net.minecraft.class_310 in a Fabric log?

Fabric's name for the Minecraft client in a normal game. A line that mentions it means a mod reached for the client, which a server does not have.

Search mods that run on a server.

The Mods tab searches Modrinth, sorted by downloads, and only shows mods that run on a server and have a build for your version.

See Fabric hosting