Our news See more of us on Google? Add
Discord
Player Java & Bedrock Requires cheats

Keep inventory after death

Turn on keepInventory so you don't lose your items and XP when you die.

Commands

/gamerule keepInventory true

Turns on keeping your inventory after death

/gamerule keepInventory false

Turns off keeping your inventory (the default)

How it works

The keepInventory game rule is one of the most popular gameplay tweaks in Minecraft. By default, when you die you lose every item in your inventory and your experience points: the items stay on the ground for 5 minutes and then despawn. The /gamerule keepInventory true command changes that: after you die, you respawn with your full inventory and all your XP. It's especially handy in single player, on servers with friends, or whenever losing hours of farming would be frustrating (for example, when you're exploring an End City with an elytra over the void). Many purists see keepInventory as a cheat, but on community servers it's the standard: it cuts down on frustration and encourages exploration. The /gamerule keepInventory false command restores the default behavior. Keep in mind that keepInventory doesn't protect you from /clear: that command still removes items from your inventory.

Practical tips

1

keepInventory also keeps your experience points, so you don't lose any XP when you die.

2

It doesn't protect you from the /clear command, which still removes items.

3

On servers, the setting is saved in the world file and survives a restart.

4

Many players use keepInventory on survival servers with friends.

Details

Category Player
Edition Java & Bedrock
Requires cheats Yes
Number of commands 2
Tags
keepInventorydeathinventorygameruleXP

Related cheats

Player Java & Bedrock

Experience (XP)

/xp add @s 30 levels
Player Java & Bedrock

Status effects

/effect give @s minecraft:speed 999999 2 true
Player Java & Bedrock

Change the difficulty

/difficulty peaceful
Survival Java & Bedrock

Invincibility (god mode)

/gamemode creative