Minecraft modding, besides where it is installed, what are the differences between client and server mods

minecraft-java-editionmods

I've been bouncing back and forth between client and server mod tutorials, and I can't seem to work out where one starts and the other ends.

If I create a client mod that adds items and blocks, install it on my PC then join a friends server, if there are no conflicts, will I be able to use my new blocks on his server? Does the server specify which mods are to be used… if so, will I not be able to join if I have my mod installed? If I can join, is my mod disabled while I'm on his server?

Alternatively, If I create the same mod,but for a server, will all of the users need to install the mod to be able to join my server? I would imagine that adding blocks may not require this, but what if I want to add a new UI? That screams client side to me, but what about things like permissions, that are geared towards server mods?

So, my questions are: how are server and client mods different (aside from the fact that one is installed on a client,the other on a server), what are the limitations of each, and how do they interact together, if at all?

Best Answer

This entirely depends on what the mod changes.

  • If you have a mod that changes things that only the client cares about (e.g., adds realistic shadow shaders) then the client mod will work fine in multiplayer. (These will not have any effect installed on the server.)

    • A UI mod will only change clients. Installing it on the server will have no effect.
  • If it changes something that only the server is responsible for managing (e.g., changing the world generator algorithm) then the client doesn't have to know about the mod at all and it can be server-only. (These will not have any effect installed on the client when playing multiplayer.)

  • If it changes the world in a way that client and server must both understand (i.e., new items/blocks), then it has to be on the server and the client. (What happens if there is a mod mismatch depends on the mod.)

    • In your specific example, no, adding new blocks to your client will not let you use them on a multiplayer server. You might be able to join, or you might not. You might be able to join, but get kicked as soon as you try to use a custom block. It entirely depends on what code you change. The possible interactions are as many as there are lines of code in Minecraft that can be changed.
    • Adding a new-block mod to a server will make it incompatible with clients. This might manifest as disconnects, crashes, or client-side "ghosts". The client must have a client-side mod that matches the server-side mod.
    • A permissions mod is server-side only, but a UI mod is client-side only. To make a UI mod able to change server-side permissions, you have to have a client mod and a server mod that know how to interact with each other.

These things entirely depend on how the mod is coded. Without knowing what your mod changes, we can't even guess. More technically, where server mods start and client mods begin are a matter of what specific Java functions they change and how those functions operate as part of Minecraft's server-client architecture.