[Crash] Dedicated server crash: NoClassDefFoundError / Attempted to load client classes (ParticleEngine / net.minecraft.client.*) on Winter Overhaul 3.0.0 (Forge 1.20.1)
Closed this issue · 1 comments
Bug Description
Description
When running Winter Overhaul (Forge 3.0.0 for MC 1.20.1) on a dedicated server (Forge 47.4.9), the server fails to start because the mod attempts to load client-only classes during server initialization.
Environment
- Minecraft: 1.20.1
- Forge: 47.4.9
- Winter Overhaul: 3.0.0 (Forge build) — file: WinterOverhaul-Forge-3.0.0+1.20.1.jar
- Java: 17.0.15
- Server type: Dedicated (Aternos / local Forge dedicated server)
Notable dependencies (from CurseForge / Modrinth)
- Required: Architectury API, GeckoLib. See CurseForge/Modrinth project pages. :contentReference[oaicite:6]{index=6}
Steps to reproduce
- Place these files in the server
mods/folder:WinterOverhaul-Forge-3.0.0+1.20.1.jararchitectury-9.2.14-forge.jargeckolib-forge-1.20.1-4.7.4.jar
- Start the dedicated server (no other mods required to reproduce).
- Observe server crash during mod initialization.
Crash log (short excerpt)
Full log: https://mclo.gs/rPeL8iQ. :contentReference[oaicite:7]{index=7}
Relevant excerpts:
[...]
Attempted to load class net/minecraft/client/particle/ParticleEngine for invalid dist DEDICATED_SERVER
Failed to create mod instance. ModID: winteroverhaul, class tech.thatgravyboat.winteroverhaul.forge.WinterOverhaulForge
[...]
Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/Minecraft
at winteroverhaul.client.WinterOverhaulClient.(WinterOverhaulClient.java:25)
Expected behavior
- If the Forge build is intended to support dedicated servers, the mod must not reference/instantiate
net.minecraft.client.*classes during server initialization. - If the Forge build is client-only, please mark the Forge release as client-only on CurseForge/Modrinth to prevent server installs (Aternos allows uploads and users often miss that).
Technical analysis & suggestions
- The log shows that Architectury and GeckoLib were present during loading, yet the crash still occurs, indicating this is not merely a missing-dependency issue. The failure is due to client-only classes being loaded on the dedicated server. :contentReference[oaicite:8]{index=8}
- Common fixes:
- Avoid instantiating client classes in common mod constructors.
- Use
DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> ...)for client-only initialization. - Register client initialization via
@Mod.EventBusSubscriber(value = Dist.CLIENT)or handle setup inFMLClientSetupEvent. - Ensure
mods.tomllists required dependencies (so Forge can warn/stop installs when deps are missing).
- Example pattern (client-only init):
if (FMLEnvironment.dist == Dist.CLIENT) {
DistExecutor.safeRunWhenOn(Dist.CLIENT, () -> () -> ClientInitClass.init());
}
### How to Reproduce?
_No response_
### Expected Behavior
_No response_
### Version
3.0.0
### Mod Loader Version
1.20.1
### Logs or additional context
_No response_