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
- In a multiplayer server, pick up any item from your inventory, nearby chest, or other container
- Continue to hold the item with the mouse cursor
- 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.
- Unresolved
VideoklipBGKarateF22
- 13
- 9
- Community Consensus
Important
- Platform
- Items
- Survival
- multiplayer
13w24b - 24w45a
13w24b 1.14 1.14.1-pre1 1.14.1-pre2 1.14.1 1.14.2-pre1 1.14.2-pre2 1.14.2-pre3 1.14.2-pre4 1.14.2 1.14.3-pre2 1.14.3-pre3 1.14.3-pre4 1.14.3 1.14.4-pre2 1.14.4-pre3 1.14.4-pre4 1.14.4-pre5 1.14.4-pre6 1.14.4 19w45b 1.15-pre1 1.15-pre4 1.15-pre6 1.15-pre7 1.15 1.15.1 1.15.1-pre1 1.15.2-pre2 1.15.2 20w06a 20w07a 20w08a 20w09a 20w10a 20w11a 20w12a 20w13b 20w15a 20w16a 20w18a 20w19a 20w20b 20w21a 1.16-pre1 1.16-pre2 1.16-pre3 1.16-pre4 1.16-pre5 1.16-pre8 1.16-rc1 1.16 1.16.1 20w29a 1.16.2-pre1 1.16.2-rc1 1.16.2-rc2 1.16.2 1.16.3 1.16.4 20w45a 20w46a 1.20.4 24w06a 24w11a 24w45a
Created Issue:
Items lost on server shutdown if held
If a server is shutdown normally while the user is holding an item, the item held is completely lost rather than thrown on the ground or put back into the users inventory.
Environment
Windows 7, Java 7
If a server is shutdown normally while the user is holding an item (edit: clarification, I mean held by your mouse, not your in-game character), the item held is completely lost rather than thrown on the ground or put back into the users inventory.
relates to
Windows 7, Java 7
Itemslost on server shutdownif heldInventory items held by mouse are getting lost on server shutdown
If a server is shutdown normally while the user is holding an item (edit: clarification, I mean held by your mouse, not your in-game character), the item held is completely lost rather than thrownon the ground orput backintothe users inventory.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
- In a multiplayer server, pick up any item from your inventory, nearby chest, or other container
- Continue to hold the item with the mouse cursor
- 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.
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
- In a multiplayer server, pick up any item from your inventory, nearby chest, or other container
- Continue to hold the item with the mouse cursor
- 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.
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
- In a multiplayer server, pick up any item from your inventory, nearby chest, or other container
- Continue to hold the item with the mouse cursor
- 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.
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
- In a multiplayer server, pick up any item from your inventory, nearby chest, or other container
- Continue to hold the item with the mouse cursor
- 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.
is duplicated by
This does seem incongruous. Tickets such as MC-37529, MC-49062, and MC-18216 all suggest that the cursor is not part of the inventory, or the world, because items can be lost if they are held when the game closes unexpectedly. However, I don't know if that's still true since the inventory code was rewritten. It's possible that the cursor is now part of the inventory, and as such, commands that work on the inventory should be able to find it. That the clear command can find it also does suggest that it can be done.
Thank you for your report!
We're actually already tracking this issue in MC-18216, so I resolved and linked this ticket as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature in the future to see if the issue has already been reported.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki


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.
Reopened and changed the reporter to VideoklipBG, see https://www.reddit.com/r/Mojira/comments/blp2ii/items_are_getting_lost_on_server_shutdown_if_held/
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.