Tutorials/Command blocks and functions

'''I created this page with good intentions, and I hope that it will become as popular as I think it will be. Please help me add as much info and content as possible to it; I cannot do this alone.''' MrRedstone 12:19, 25 September 2012 (UTC)

The Command Block is a new block that was introduced in 12w32a and will be officially released in Minecraft 1.4. It was introduced as a way to help support Adventure Mode and custom maps.

To find out more in detail, visit the Command Block page.

Singleplayer Applications (SSP)
Command blocks can be used in single player to change the difficulty, change the state of the weather, or give you predesignated items. They are particularly useful for the /downfall and /set time x commands, as they are only available in cheat mode otherwise. The /set time x command is especially useful, as it allows one to change the current time to a preset time at the press of a button.

Multiplayer Applications (SMP)
This section details the applications of the Command Block in multiplayer.

Through, one can create teleporters for public use on a server. Can be applied to a range of scenarios.
 * Teleportation/Transport

Through, one can create a lottery. Keep in mind that in the most recent snapshot,  will directly put items into one's inventory, instead of throwing them on the ground in front of the character.
 * Lottery

By using  a whole bunch, you can force a player to stay at a certain place. If you do this it would be advisable to either turn off commands in your chat settings or do.
 * Jails

By using the parameter, only players in Creative will be affected by the command block. Hopefully only ops are in Creative on your server.
 * Admin Only

By using  in a command block one can create announcements that could play even when the admin/owner wasn't there.
 * Announcements

By using, you can scan people for items. If you want to remove certain items, use. For example, on a server that doesn't want griefing you could have a clock connected to a command block set to.
 * Security Scan

Using, the command block can report the nearest player. If the command block is placed after a finish line, it will say the finishers in order.
 * Race Referee

Creating a "Creative Only" zone is possible through command blocks, but it is complex and more of a case-by-case basis. The basic idea would be to create a "fence" of command block affected zones so that, once a player flies in creative though it, they would be changed to survival or adventure mode. A "World Guard" zone would be a lot simpler, just have a command block do  so players cannot steal each others items, then put  a command block on a redstone clock with something like   at the spawn so people still lose their items when they die and to prevent spawn kills.
 * Creative Area/World Guard

2.

3.