Creative mode
Switch to Creative mode: unlimited blocks, flying and no damage.
Commands
/gamemode creative Switches you to Creative mode
/gamemode creative PlayerName Switches another player to Creative mode
How it works
Creative mode is the most popular mode for building and testing in Minecraft. You have access to every block and item in the game through the Creative inventory, and you can fly (double-tap the spacebar). You take no damage (except from /kill and the void) and can break any block instantly with a single click. The /gamemode creative command (or /gamemode 1 in older versions) switches you to this mode. Switching to Creative doesn't wipe your Survival inventory, so you can go back to Survival and keep your items. Clicking a block with the middle mouse button copies it to your hotbar. Creative mode is essential for map makers, builders and server admins.
Practical tips
Double-tap the spacebar to start flying, and double-tap it again to stop.
The middle mouse button copies the block you're looking at into your hotbar.
Your Survival inventory doesn't disappear, so you can switch between modes safely.