What happens: A player dies while the keepInventory
gamerule is set to true
, and then the gamerule is switched to false
by command blocks while the player is on the death screen.
Bug: As soon as you click the respawn button on the death screen, not only is your inventory completely wiped of all items, but none of them are even dropped on the ground. The items are gone forever.
Expected outcome: When you hit the respawn button on the death screen, you will respawn with all of your items and experience points since you died when keepInventory
was set to true
.
Steps to reproduce:
Run the following command once:
/gamerule keepInventory true
Run the following command once:
/scoreboard objectives add Deaths stat.deaths
Place the following command inside an active repeating command block:
/execute @a[score_Deaths_min=1] ~ ~ ~ /gamerule keepInventory false
Run the following command once:
/kill @p
After dying, all the items in your inventory will be cleared, but none of them will drop on the ground, even though you died while keepInventory
was set to true
.
The keepInventory
gamerule should be based on the moment the player dies, not the moment they click the respawn button. If this was fixed, it would allow the possibility of command block creations that kill the player, without item or experience loss, in order to get them to their respawn point.
Linked issues
is duplicated by 2
Comments 13
Expected outcome was for items to drop at the player's death location once the gamerule was changed. Or at least for the player to keep the items currently in their inventory on respawn and lose items on their next death. As of 1.14 items are still deleted.
*Can we perhaps move this gamerule into the /teams modifiers?
/team modify exampleTeam keepInventory <true/false>
If needed I can pull versions and compile a list of affected versions. This has been an ongoing issue though. As previously commented by myself and others:
1.11, 16w50a, 1.11.2, 1.13.1, 1.13.2-pre2, 1.14, 1.14.1, 1.14.4, 1.15 & All 1.16 current snapshots.
The steps to reproduce this are still accurate. IF a player dies or is already on the "dead" screen when the gamerule is changed, all items in the player's inventory are deleted.
A workaround to this was added in a more recent version when the gamerule for {{doImmediateRespawn}} was added. This allows you to first force all dead players to respawn... and then change the gamerule. That way no player's inventory is deleted. (Only dead players have their inventory deleted)
@Marcono1234 IF you need me to, I can also create a test world that you can use to reproduce the error. I am following this report for updates as this issue directly affects a server I run and is a very annoying glitch to deal with.
-edit: Tried to Tag the MOD correctly. Doesn't seem to let me. I'm still new to using this system.
Thanks @@unknown. That was rather a generic comment (which also applies to your "1.15 & All 1.16 current snapshots"). The problem is that if we miss such a comment, or the player does not play in the latest version, it is difficult to know which version they are experiencing an issue in. Therefore the exact version should always be specified.
Tagging people here is not enabled (though that is a feature on some Jira installations), so you have to write
[~username]
[~marcono1234]
However, that is merely aesthetic. It does not have any effect here other than sending a regular comment to all watchers, so if that user is not watching they will not notice it.
Since you have confirmed this bug for multiple versions already and the original reporter seems to not be active here anymore, would you like me to make you the reporter? This allows you to directly update the report and add affected versions.
Yes, that would be fine. I regularly check this particular bug. If you need anything further I'll ensure im available.
Still present in 1.13.1.