well there is a mod for that or you can download too many items and there is a botton on the left where you can save your inventory so if you die you will have your stuff by clicking that button
Chat with our AI personalities
to keep inventory you can do /gamerule keepinventory true or /gamerule keepinventory false
/gamemode keepInventory true
you have to do /gamerule keepinventory true or /gamerule keepinventory false
You will lose all the items in your inventory and your experience and respawn.
Pressing 'E' will open your inventory.