Minecraft Blogs / Tutorial

Command Blocks: The Question

  • 1,093 views, 1 today
  • 6
  • 2
  • 1
OfficialHG_PMC's Avatar OfficialHG_PMC
Level 24 : Expert Nerd
19


Minecraft Command Blocks: How To?


How to set up your command blocks:


First of all, you must get a command block. To do this you must have the command /give available to you. In single-player you must have Allow Cheats on. Now to get the block type in: /give (playername) 137 1. Now to set up your blocks. One way of setting up blocks so they are ready to execute the command with a click of a button can be seen here:



Yxezpng

Hey, What do Those Lines of Text Mean?


Now that your command block(s) are set up you can begin to execute various commands. Before this though you must learn one more thing. When right-clicking on the command block, you will be able to see a few lines of text underneath where the commands go. These say:


Use @p to target nearest player


Use @r to target random player


Use @a to target all players


What these mean is who the command executed by the command block will target. With @p the command will target the closest player to the command block. This will be the person clicking the button. With @r the command will target a random player. Of course this will not matter in single-player as it will always target you. If in multi-player this will target a random player on the server. Finally with @a, this will target all players. Once again this only matters for multiplayer.


Basic Commands:


You are now ready to start using the command block! Congrats! In this tutorial I will only be showing off basic commands. All of the most simple commands are:


1. The Say Command: For this command when the button is pressed the said message will appear in chat. Leto s say you type o say Hello PMC!o The server would have a sort of announcement which says Hello PMC! An example of what this command looks like can be seen here:

TSdSxSpng


When I click the button there will be an announcement saying Hello PMC which can be seen here:

mzAUndpng


2. The Set Time Command: This Command is quite obvious. Setting the time of day! You can do this by typing in the command line o time set (time)o Say for example you want the time to be at 0 write in the command line (without the quotations) o time set 0o . With a click of the button the time will be set to 0. An example of this in the command line can be seen here:


OLILTJepng


3. The Teleport Command: Alright we are now up to the teleport command. This command is very useful for Custom/Adventure Maps and Servers. An example of this in a Mini-game is the popular Subway Surfers Mini-game. This command (obviously) teleports the player(s) to a specific spot. This command is an example of when the @p, @r, and @a commands can be used. So for example typing in o tp @p 1 4 1o will teleport the player who clicked the button to coordinates x:1 y:4 z:1. This command line can be seen here:


pmQVcnpng


4. The Give Command: My final command for this update we are now using the give command. This command will give the targeted player a block(s). This is also a case where @p, @r, @a can be used. This command will simply place the said item straight into the said playero s inventory. For example we can use o give @r 1 10o This will give a random player 10 stone. To dissect the command the first number (in this case the 1) is the item ID you wish to give the player. The second number (in this case 10) is the number of blocks you wish to give the player. An example of this command line can be seen here:


HqTDpjpng


This is the End of the Tutorial for Now. Updates are On the Way!

Tags

Create an account or sign in to comment.

1
07/30/2013 10:57 am
Level 64 : High Grandmaster Musician
hobo joe
hobo joe's Avatar
Really helpful tutorial, thank man :)
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome