I once played a vanilla Minecraft adventure map (called "Herobrine's Mansion") that prevented the player from losing their items on death. Which commands can be used to prevent the player from losing their items on death (in vanilla Minecraft)?
Minecraft – Keep items in inventory on death in Minecraft
minecraft-commandsminecraft-java-edition
Related Topic
- Minecraft – Keep named items after death
- Minecraft – How to detect if a player logs out of the game in Minecraft
- Minecraft – Keeping specific items on death, rather than all
- Minecraft – How to detect the death of a mob
- Minecraft 1.14.3, unable to stop items despawning using command blocks
- Minecraft – How to detect whether a player has two of a specific item in their inventory, and drop one
Best Answer
You can use the command
/gamerule keepInventory true
(case sensitive) to prevent the player from losing items on death. This command will work in Vanilla Minecraft, without using any mods (as long as cheats are enabled). You can also do this on a server as long as you have operator status.