Inventory management and sorting

I’ve been working on my multiplayer sandbox game fairly well so far but I don’t know how to correctly handle inventory.

Inventory includes each player’s inventory and all the other inventories in blocks (like a chest, for example). The issue in particular is the sorting. Sorting in my case means when a player can click and item, put it “on their cursor”, and move it somewhere else, like Minecraft. Other players would have to be updated too if they’re looking at the chest.

What I had in mind was inventory was all server side but copies of the inventory were sent to the player (includes chests, etc). The player could look in a chest, sort their inventory and the chest’s inventory, and then changes would be sent to the server. However, if another player were to look at the same chest and change it, the new changes wouldn’t be reflected back on the first player’s screen, and their changes would override the other.

I looked into how Minecraft handles it and it’s fully server-side. The client sends packets whenever a client clicks on a slot and the server does the rest. I am leaning a bit towards this idea, but I’m wondering if there are any other better/more preferred options.

Thanks!

You kinda answered your own question, you want this, right ? So, the way Minecraft does should be fine, I think.

I want players looking at the same inventory to be able to see what the other is doing. I don’t want things to be overriden because that can cause syncing issues.

I may have misunderstood your question. I think you should try the way Minecraft does it, if you have any issues then you can ask for help

If you want players looking at it to see the same thing, then the server is gonna be authoritative and if two players try to drag the same item to different places, you have no choice, whichever the server gets first will be the correct one, and someones gonna get a correction from the server that they aren’t dragging that item anymore. As long as the server dies this behavior AND sends it to the people looking in the same chest or w/e, there won’t be any sync issues surely?