Arqade is a question and answer site for passionate videogamers on all platforms. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)?

share|improve this question
up vote 31 down vote accepted

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.

share|improve this answer
only if cheats are enabled – ratchet freak Nov 26 '12 at 19:11
Someone edited my answer and added "you are OP'ed" to this answer. I'm not even sure what this is intended to mean: does it mean "overpowered", or does it mean something else? – Anderson Green Jul 15 '13 at 20:55
it means that you have OPerator privileges, essentially the moderators of your server – ratchet freak Jul 15 '13 at 21:02
Command blocks don't have to be enabled. – Timtech Sep 26 '13 at 22:33

Use /gamerule keepinventory true. This'll make you keep your inventory when you die.

As mentioned before, you need to have cheats enabled, and you need to have the permissions to execute them.

Assuming you're in creative and have cheats enabled:

  • Enter the command /gamerule keepinventory
  • (Enter command /gamemode survival or /gamemode adventure) --> Takes you out of Creative

And you're done.

Assuming you're in Survival:

  • Hit pause, and click open to LAN.
  • On the next screen, set "Allow Cheats" to "ON."
  • Enter the command /gamerule keepInventory
  • Save and Exit.
    When you re-open your map, items will stay in your inventory after you die.
share|improve this answer
Save and Exit. When you re-open your map, items will stay in your inventory after you die. So it’s a persistent setting that only has to be set once? ఠ_ఠ – Synetech Nov 5 '13 at 3:01

protected by Oak Feb 23 '13 at 17:20

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.