Minecraft wiki entry for Gameplay, associated text: In the level.dat file, Survival mode is gametype=0, Creative is gametype=1, Adventure is gametype=2, and Spectator is gametype=3. Hardcore is Survival with the addition of hardcore=1 (a normal world uses hardcore=0 instead). This knowledge allows hacking to change game modes by editing the world's level.dat. The command /gamemode can be used to switch between these (except Hardcore, as it cannot be set using commands). For example, /gamemode creative puts the player into Creative mode.