There are a number of commands that can be typed into the chat console, in Multiplayer or in Single Player if you chose to have cheats enabled when starting the game.
Typing a Command
Commands all begin with a slash.
Press '/' to open the chat window with a slash already in place, and start typing!
Changing the game mode
- Changes game mode to Creative (unlimited inventory and flying).
- Changes game mode to survival.
These are very useful if you're taking screenshots for a Minecraft tutorial website!
- Stops it from raining.
- Switches rain or snow on and off.
/time set day
- Changes the time to sunrise.
/time set night
- Changes the time to sunset.
/xp 30L playername
- Give yourself 30 experience levels for enchanting (you can of course change the number, and instead of "playername" you should type your own name).
/help for help, or visit the Minecraft Wiki for more commands.