Enable cheats in an existing Minecraft world

Server setup

Edit cheats, difficulty and game mode in a worldLearn more

Permanently enable cheats in a world created without them: load its level.dat file, change the 'Use Cheats' setting, difficulty, hardcore, name, and mode, then return the file. Everything else remains unchanged.

My Game select version

Save your preferences in this browser and apply them to supported tools. Settings in a shared link take priority. Wiki version labels are not affected.

level.dat file

The file is located in the world folder: .minecraft/saves/<world>/level.dat. First, close the world in the game.

Result

Upload level.dat — its settings will appear here.

How to use the result

  1. Save a backup

    Copy the old level.dat to a nearby file, for example level.dat.bak — this allows the world to be restored as it was.

  2. Replace file

    Place the downloaded level.dat file in the world folder instead of the old one. The world must be closed in the game at this time.

  3. Open the world

    Cheats work instantly: /gamemode creative, /give, /time set day.

What to know

  • Without a file — only until logout. Open to LAN with cheats enabled allows commands only for that session. Editing level.dat makes the selected world setting persist after you reopen it.
  • Leave the rest untouched. Inventory, game rules, seed, and builds remain unchanged. Only the selected fields are rewritten.
  • Two formats. In 26.x, difficulty is a separate block, while in 1.21 and earlier it was a number; the page detects the format from the file itself. Both have been tested on isolated servers running 1.21.11 and 26.3.
  • On the server — not quite. Server cheats are operator permissions: granted in ops.json, and difficulty and mode are taken from server.properties.

All commands with cheats — in the wiki 'Cheats', world rules — in /gamerule editor. Any other field in level.dat, player file, or build template — in NBT editor.

Frequently asked questions

How to enable cheats in an already created Minecraft world?

Upload level.dat from the world folder, mark 'Cheats' and download the file back. Place it in the correct location when the game is closed — commands will work. Without editing the file, the world can be opened for online play with cheats, but only until exit.

Can you remove hardcore mode from the world?

Yes: uncheck 'Hardcore' and download level.dat. The world will become normal, with difficulty set to the one selected on the page.

Will the world be corrupted?

Only the selected fields are changed; the rest of the file remains unchanged. Still save the old level.dat nearby — the game retains level.dat_old.