Test Mods on Both Server Modes
A mod can appear correct in an integrated world yet fail when a dedicated server starts, often because common startup or gameplay code reaches a client-only class or assumes a local player exists. Exercise the same feature in an integrated session and a dedicated server with a remote client, and trace which side owns each call before moving client-specific work behind the appropriate side boundary. Exact side annotations and classloading rules depend on the Minecraft version, loader, and mappings, so verify them against the target environment.
Client-only classes must stay out of code shared with the server. A reference to one can throw
NoClassDefFoundErroron a dedicated server even in a method that never runs there, so split client code into its own classes and use the loader's side annotation. Got a different fix? Post it in the comments.