Fabric Client Mod on Server
A Fabric server crashes because a client-only Fabric mod was added to it. The mod's client entrypoint tries to load rendering classes the dedicated server does not have.
What does this error mean?
Fabric mods can declare a 'client' environment in their fabric.mod.json. When such a mod is on the server, it attempts to load client classes for the DEDICATED_SERVER dist and fails, because those classes are client-only.
Attempted to load class net/minecraft/client/... for invalid dist DEDICATED_SERVER
Most Common Causes
- A client-environment Fabric mod placed on the server.
- Copying the full client mods folder to the server.
- A visual/UI Fabric mod with no server role.
- Not checking the mod's environment field.
- A pack that did not separate client mods.
How To Diagnose
- Read the crash for the failing mod and client class.
- Check the mod's fabric.mod.json or page for a client-only environment.
- Decide whether the mod has any server function.
- Review the server mods folder for other client-only entries.
Recommended Fixes
- Remove it from the server
Delete the client-only Fabric mod from the server, leave it on clients. - Keep server-safe mods only
On the server, run only mods that work in or do not require the client environment. - Use environment metadata
Trust the mod's declared environment (client/server/*) when deciding where it goes. - Separate the pack sides
Maintain distinct client and server mod sets for the modpack.
Frequently Asked Questions
In fabric.mod.json, mods declare client, server, or both. Client-only ones must not run on a server.
Yes, it stays on clients. It just cannot be on the dedicated server.
No, this is about the mod's side, not a missing library, the fix is to remove it from the server.