3 ms·
The server is the source of truth. The client only duplicates logic that's present on the server in order to optimise for network delay. For example suppose I
by tialaramex 9y ago
The server is the source of truth. The client only duplicates logic that's present on the server in order to optimise for network delay.
For example suppose I smash a block of iron ore with a pickaxe. The client tells the server that I used my pickaxe to smash the block of iron ore, the server checks that yes, that pickaxe can smash the iron ore, and adds one chunk of iron ore to my inventory. By duplicating this logic the client can anticipate that I'll get a chunk of ore, but the fact it did that doesn't actually give me ore in the world, it just means my display updates even before the server replies saying "Also now you have ore". I actually think the ore example doens't happen in modern minecraft because a better pick might give more ore, or even auto-smelt it into iron ingots, and the server would decide some of that randomly in some cases - but you get the idea.
Network problems can cause this to de-synchronise. The symptom might be e.g. you dig a block of sand on a new server, your client shows you now have sand, but when you move to where the sand was, your client rubber-bands and the sand re-appears in front of you. But the server is the truth for everybody else, they'll see you lurching about trying to dig sand but failing, and when you fix the problem, you won't have any sand.
Modders are mostly working on the server, although since they add new graphics and other elements the same mods are usually also needed by the client (it just doesn't run the server elements).
Some logic does live purely on the client but it's mostly quality-of-life stuff, e.g. auto-mapping. All the visuals live on the client. So a client can make opaque blocks see-through for example, to some extent, which would be a problem for cheating in combat games, and hit-scanning would be easy to cheat in a client too.
- rainbowmverse 9y agoThis leads to fun things in high-load situations (like Extreme Hills biomes) even on a local single player game. You break a block...and it comes right back. Break again, comes back. The internal server is rejecting it all even though it's on the same system as the client.