mojira.dev
MC-18216

Inventory items held by mouse are getting lost on server shutdown

The bug

Items which are currently being held with the mouse (not placed in any inventory slot) get permanently lost during server shutdown, even if the world is saved beforehand.

How to reproduce

  1. In a multiplayer server, pick up any item from your inventory, nearby chest, or other container

  2. Continue to hold the item with the mouse cursor

  3. Restart the server and rejoin
    → ❌  The item is permanently lost, because it is not saved anywhere in the player or chunk data while being held

Potential fix might be to drop the item on the ground or return it back to its initial slot/container.

Linked issues

Attachments

Comments 9

Are you using craftbukkit or the Minecraft server?

Edit: Nevermind... It says it's in the snapshot, so it must be Minecraft server... Still, please give more detail.

Cannot confirm.
See screenshots: Player is still holding the same pickaxe after server restart.

I mean if held by mouse click, not held by player.

Can still not confirm.

After attempting to use both an in-client and dedicated server of my own to verify, this appears to be specific to one server I was playing. Odd, considering it is vanilla and uses no plugins. Well, either way this can probably be considered dead. I will attempt to get more information out of the server owner when he is on later. Sorry to waste your time.

Surprisingly, I am able to reproduce this issue consistently on 1.13.2 vanilla server. Firstly the item is dropped on the ground, while on every second stop / restart the item is permanently lost, even if 'save-all' command is executed just before that. There are no warnings or errors in the console, nor any odd behaviour on client / server side.

Quite a while ago a few players have lost some of their important shulker boxes with everything inside on our 1.12 survival server because of this issue.

I will provide additional information if necessary, and could also try to make a video showing the steps to reproduce it consistently.

I tested this about 25 times on a vanilla 1.15.2 server, and the bug occurred about 5 times. (I lost the exact count)

So most times the item gets saved properly and drops as an item entity when the player rejoins, but about 1 in 5 times the item fails to get saved and disappears.

As of 24w11a both the cursor item and any items in the crafting slots seem to be getting deleted, while the rest of the world gets saved properly. This happens very consistently; I've tested about 10 times now, and only once have the cursor item and crafting slot items popped out as entities when I restarted and rejoined.

KarateF22

VideoklipBG

(Unassigned)

Community Consensus

Platform

Important

Items

multiplayer

Snapshot 13w24b, Minecraft 1.14, Minecraft 1.14.1 Pre-Release 1, Minecraft 1.14.1 Pre-Release 2, Minecraft 1.14.1, ..., 20w46a, 1.20.4, 24w06a, 24w11a, 24w45a

Retrieved