The other day, I was playing on an old Minecraft singleplayer map when I encountered an unfortunate problem: I wanted to change some of the map’s gamerules, but I was unable to do so because cheats were disabled. Having spent several hours on this map, I didn’t want to start over, so I decided to try and find a way to enable cheats on an already existing world.
When you save a Minecraft world, the game creates a level.dat file that contains all of the map’s parameters in NBT (Named Binary Tag) format. Now, if we want to change these parameters, we can use an awesome little program called NBTExplorer (available for download on this forum thread: http://www.minecraftforum.net/topic/840677-nbtexplorer-nbt-editor-for-windows-and-mac/).
How to enable cheats using NBTExplorer:
First off, you need to download NBTExplorer either by looking up the forum thread linked previously or by going to this page: https://github.com/jaquadro/NBTExplorer/releases/
Once NBTExplorer is finished downloading, you can open it by clicking on NBTExplorer.exe (the icon is a small dead shrub). You should then see a list of your singleplayer maps:
Now, you need to double click on the map for which you want to enable cheats.
Once this is done, double click on level.dat [1 entries], then Data: 24 Entries, and finally on AllowCommands: 0
This will open a small text box titled “Edit value…” in which you need to type 1.
You can then click on Ok and save your changes by going to File -> Save (or by pressing Ctrl+S). You should now be able to use cheats on your Minecraft map!
I hope this article helped you out and, as always, have a nice day!