Introduction: Minecraft Command Block Guide
Ever wondered what all the commands do in minecraft?
Thought you were going to spend hours on the internet, watching videos and reading blogs to learn commands?
Well no need for that anymore, with my very nice guide, made for the minecraft contest and to help all you minecrafters.
Step 1: A Little Intro
Before I start, I first want to say I'm not a pro at command blocks, and I won't explain the more difficult commands in depth since I myself don't entirely know what it can be used for, however, I will try my best to make you at least moderate to command blocks.
The minecraft command block is a very usefull block in minecraft, if not the most important for mapmakers.It was first introduced in minecraft 1.4.2 (snapshot 12w32a), and can only be used in creative mode, and on multiplayer the person also has to be opped.
To obtain the command block, you need to use the command: /give [name player] command_block, a command block will be spawned in the players inventory, from there on, right clicking will show the typing grid and the previous output (see image).
Also, you do not need to type the prefix / before every command.
The [playername] can be replaced by @a=all online players @p=closest player @r=random player.
I hope you like this tutorial, thanks anyway.
Step 2: The More Known and Easy Commands
From here, the real commands start, I'll be listing them here and giving you a brief explanation of what it does.
/?: One of the most basic ones, gives you a list of all the commands and what variables you have to fill in.
/achievement: Used to give a player an achievement without completing it.
/clear [playername]: Clears the players inventory.
/difficulty [number]: changes game difficulty 0=Peacefull 1=Easy 2=Normal 3=Hard.
/gamemode [number]: Changes gamemode 0=Survival 1=Creative 2=Adventure 3=Spectator.
/give [playername] [item name] [amount]: gives a specified item to a player.
/help: See /?
/kill [playername]: kills a player, when name left blank, the player suicides.
/me [message]: displays you doing an action (see picture).
/msg [playername] [message]: multiplayer only, sends a private message to specified player.
/publish: opens world to LAN, but you can't change settings.
/say [message]: Displays a message, by default [@] but renaming the command block in an anvil changes the displayed name.
Step 3: The More Challenging Commands
These commands are getting harder, and I advise you if you don't understand my explenation, I highly suggest googling the commands.
/Blockdata [x] [y] [z] [Datatag]: used to change the data of certaing blocks eg. the growth value of a sapling.
/debug [start;stop;chunk] [coördinates]: reloads a chunk/position if there is a loading issue.
/defaultgamemode [gamemode]: changes the worlds default gamemode.
/effect [playername] [effect] [seconds] [amplifier]: gives a player a potion effect.
/enchant [playername] [Id] [level]: enchants the item wich the player is holding.
/entitydata [entity] [datatag]: to be honest, i don't really know a lot of this command, I only know its used to chance the data of entity's.
/execute [entity] [command]: instead of using a command relative to a coördinate, it uses an entity to use the command upon.
/fill [pos1] [pos2] [blockname]: simular to the worldedit plugin, it fills the area between the 2 positions with a defined block.
/particle [name] [x] [y] [z] [xd] [yd] [zd] [speed]: Just like this one, searching on the internet is strongly adviced, but in the end, it should spawn a particle, only the arguments are the hard part.
/playsound [sound] [playername]: you're never guessing this one, it plays a sound found in the game library to a certain player or at specific coördinates.
/replaceitem [block;entity] [amount] [data]: replaces a block or an inventory slot item with another specified item.
/setblock [x] [y] [z] [block]: one of the more easy to remind commands, and does just what it says on the tin.
/spreadplayers [x] [z] [spreaddistance] [maxspreaddistance]: spreads players out of each other relative to the given up x and z coördinate.
/testfor [player]: tests for a player in a specified radius, if so, placing a comparator next to the command block should emit a redstone signal if there is a player.
/testforblock [x] [y] [z] [x2] [y2] [z2] [tilename]: just like testing for a player, this test for a block on a specified coördinate.
/testforblocks [x1] [y1] [z1] [x2] [y2] [z2]: instead of testing for 1 block, this test for multiple blocks in a specified region.
/title [player] title [text]: yes I know, there are multiple variations, but i dont really find them usefull, anyway, you can get the 4 other variations by editing the second title to: clear, reset, subtitle, times, but I wont explain what all of them do since its pretty obvious.
/worldborder add [sizeinblocks]: add a worldborder, you can resenter it by typing /worldborder center [x] [z].
/xp [ammount] [player], or for adding levels: /xp [ammount]L [player].
Step 4: The Nightmare Commands
To be honest, I had to do a lot of research to find out how these commands do, and this will be an incomplete and brief overview over the commands, no variables here, just the command and the explenation, for the complete command, type what I wrote and press enter, it should tell you what to add.
/scoreboard: this command is used to manage scoreboards, objectives and players and teams, but it can go very indept however.
/summon: Know how all those fancy youtubers talking about fallingsand? well, they are using this command, however, you can also use it to spawn mobs.
/tellraw: It is used to send a raw json message to someone, however, you should note that JSON in an entirely different coding language, and it isn't easy to master.
/trigger: this is used in association with the scoreboard, and simply triggers an objective.
Step 5: The Golden Part of Minecraft: Gamerule's
A gamerule is a command, with many different possibility, mostly the input just requires a yes or a no. I am leaving the command /gamerule behind and I'm just giving you the variables.
CommandBlockOutput [true;false]: every time a command goes off, its like a grey message in your chat, this completely disables that, so your chat doesn't get spammed all the time.
doDaylightCycle [true;false]: if false, time will be frozen, and the sun wont move anymore, unless you use the /time command.
doFireTick [true;false]: if false, fire isn't able to spread to other burnable objects.
doMobLoot [true;false]: if false, mobs won't drop their loot, like creepers don't drop gunpowder
doMobspawning [true;false]: if false, mobs can't spawn naturally, only using spawn eggs and the /summon command.
doTileDrops [true;false]: if false, breaking a block won't result in it turning into a pickable entity.
KeepInventory [true;false]: if true, dieing won't result in losing your items/levels.
logAdmingCommands [true;false]: whether to log admin commands to a server log.
mobGriefing [true;false]: if false, creepers aren't able to destroy blocks, and zombies can't knock down doors.
naturalRegenation [true;false]: if false, even if you are at full hunger, you won't regen hearts.
randomTickSpeed [0-255]: how often a random block tick occurs (effect growth of plants and such) default is 3.
reducedDebugInfo [true;false]: if false, the debug screen shows less info, duh...
sendCommandFeedback [true;false]: if true, when a player executes a command, this is shown in chat.
showDeathMessages [true;false]: if false, dieing won't result in a message you have died.
We have a be nice policy.
Please be positive and constructive.