Commands, cheats and keepInventory
Commands start with a slash in chat or a command block. In singleplayer you turn cheats on when you create the world, or open to LAN with cheats. keepInventory, written keep_inventory in later Java game rules, defaults to false. When true, you keep items and experience on death. It has existed since 1.4.2, so 1.5.2, 1.8.8 and 1.12.2 all have the idea of it.
Last reviewed: . By the Eaglercraft Guide editorial team.
The command examples target the legacy 1.5.2, 1.8.8 and 1.12.2 Java-style syntax. Set a rule before it is needed; only the world owner or an authorized server operator can change it.
- /gamemode creative and /gamemode survival when you are allowed.
- /time set day and /weather clear are the usual singleplayer helpers, subject to the command existing in that version.
- /gamerule keepInventory true on the versions that use that spelling. If the client rejects the camel-case form, try the spelling the chat suggests. Do not assume 26.2’s spelling without a test.
- /seed reads the seed when permitted.
Op, ban and kick are operator commands. They are explained on the moderation page, not as something every player should run.
Questions
Why did I lose my items?
The default is to drop them. Turn the game rule on before the fight, in a world you control.
Related: Worlds · Moderation · Seeds
Continue with the relevant guide
These links explain related topics, not a guarantee of compatibility with every build or server.
Sources
- Community Minecraft Wiki: permissions and version-specific command syntax. Reviewed 2026-10-27.
- Community Minecraft Wiki: keepInventory history, defaults and later naming changes. Reviewed 2026-10-27.
Original illustrations on this page are drawn for eaglercraft.pro. They are not official screenshots.