How to Keep Inventory when you Die
This Minecraft Dungeons tutorial explains how to use a game command to save your inventory after dying.
While playing the game press the forward-slash key (/) and a small window will pop up. Enter the code, press enter and this will be enough to have your command activated.
/gamerule keepInventory true
This command enables you to keep all the items in your inventory even if you die. Changing “true” to “false” turns it off again.