How to turn cheats on or off
Solution 1:
On a multiplayer server:
To turn on cheats:
- Type
op <Your username>
in the console. - Done.
To turn off cheats:
- Type
/deop <Your username>
- Done.
On a singleplayer world:
To turn on cheats:
Using the built-in LAN server:
- Pause the game.
- Click on
Open to LAN
. - In the options, change Allow Cheats: false to true (click on it).
- Open the server.
Changing your save file:
- Close your world.
- Using NBTEdit, open your save file (
%AppData%/.minecraft/saves/<World Name>/save.dat
) - Change the NBT node
AllowCommands
from0
to1
. - Save and reopen the world.
To turn off cheats:
Using the built-in LAN server:
Note: This only works on players who connect to this world, not you.
- Pause the game.
- Click on
Open to LAN
. - In the options, change Allow Cheats: true to false (click on it, if it already displays Allow Cheats: false, obviously don't click).
- Open the server.
Changing your save file:
- Close your world.
- Using NBTEdit, open your save file (
%AppData%/.minecraft/saves/<World Name>/save.dat
) - Change the NBT node
AllowCommands
from1
to0
. - Save and reopen the world.
Solution 2:
You can simply deop yourself. /deop {PlayerName}
and boom, no more commands like /gamemode 1
Solution 3:
If you're wondering how to make it so that no one can use any commands, then...
- Make the map open to LAN
- Turn cheats to "Off"
- End the LAN server and you won't be able to use cheats.
This works the other way around if you wish to turn the cheats back on.