At first glance, Minecraft’s command blocks seem really complicated to use. Once you get to know them, however, they become a useful tool for creating adventure maps or managing multiplayer servers as well. In this article, we are going to talk about What are Command Block Minecraft – How to Use it. Let’s begin!
We will explain what a Minecraft command block is, show you how you can make a Minecraft command block. And examine how you can use Minecraft command blocks to make Minecraft even better.
What Is a Minecraft Command Block?
A Minecraft command block is actually a special Redstone-powered block. Then main use of it is to perform pre-set console commands when a Redstone charge activates it. When it receives a charge, then it fires off the command loaded into it.
The main use of Minecraft command blocks is to give the player control over commands they could not otherwise use. That’s because command blocks have admin-level powers so that they can perform console commands for folks without admin privileges. This means that you can give players control over particular things without giving them power on your server.
This is really great to perform menial tasks, such as changing the current game mode. If the term “game mode” draws a blank for you.
How can we Get a Minecraft Command Block?
Because Minecraft command blocks are related to server and also player management. They cannot mine in the game world actually.
If you want to get a command block, then you must have the right permissions to give yourself items. Then, open the chat by tapping the T key. The chat window doubles as the in-game console; start your message along with a forward-slash (/) in order to turn a chat message into a command.
With the chat open, you need to type “/give PLAYER_NAME Minecraft:command_block”, where PLAYER_NAME is your name.
You may notice the game predicting what you will type when you enter characters. If the game guesses correctly, then you can tap the TAB key to enter the guess automatically. Now that you have a command block in your possession, then it’s time to put it to use.
How can we Use Minecraft Command Block Commands
In order to use the block, right-click it as if it were a crafting table. You will see a lot of confusing buttons, but you don’t need to worry about those right now. Let’s focus on getting the command block if you want to perform a task when it receives a Redstone charge.
Open up a new Minecraft world (Superflat works best), make sure that you are in Creative mode, and tap the “/” button. This is actually the command window, which is the same thing as the chat window, except it starts you off with a ‘ / ‘, and anything starting with the forward-slash is actually a command. The first command that you can run is
/give @p minecraft:command_block
Let’s break this down now. The command “/give” puts items into a player’s inventory and has two arguments: the player and the item to give. The “@p” is a target selector. The selector “@p” actually selects the nearest player. Just like that, you could also use your Minecraft username, however, if you run a command from the console you will always be the nearest player. The other target selectors are “@a” for all players, “@r” for a random player, and “@e” will target all then entities. Entities include everything that isn’t a block, such as monsters, snowballs, animals, and arrows as well.
The command should execute successfully and also give you a new block. Place it anywhere on the ground to start that. You can see that the command block points in the direction you place it, a lot like hoppers or furnaces as well. This will be important later actually.
Right-click the block (or use whatever key you use in order to access crafting tables and furnaces) and you will be greeted along with the command block GUI.
Buttons | command block minecraft
It seems a little scary at first, but don’t worry about that, all of those buttons do something. The button that says “Impulse” actually changes the type of command block. There are three different types of command blocks, have a look:
- Impulse, which runs commands on the rising edge of Redstone current. This means that whenever they are powered, they will run their command once and then stop, even if they continue to be powered. This is the default setting and is the only one that is available in 1.8
- Repeat, which runs commands every tick they are power. A tick is just like a frame, and multiple commands can be run in a single tick, more than 20 times a second.
- Chain, which only runs if the command block that is pointing into it has executed its command. These will run in order, one after the other, in a single tick, thus the name ‘Chain’.
The button that says “Unconditional” stops the command block from checking if the previous block in the chain has executed successfully. The other option, “Conditional”, only runs if the previous block threw no errors.
The button that says “Needs Redstone” only runs the command if the command block is powered actually. The other option, “Always Active” stops the command block from checking if it is powered and just assumes that it is. This option should not be used with Impulse command blocks as it makes them useless.
Further | command block minecraft
Well, let’s make a chain, our first ‘script’. Place down a chain command block or also two facing into the first impulse command block, like this:
You guys need to make sure to set the chain blocks to “Always Active”. Otherwise, we would need to place down Redstone blocks or current, which actually takes up unnecessary space. Place a button on the impulse command block at the start of the chain, and then press it.
Nothing will actually happen. This is because we haven’t filled them along with commands yet! Right-click the impulse block if you want to edit it, and then put in a basic command
say start
Notice how we do not need a forward slash in command blocks actually. You can also use one if you want, however, it’s unnecessary. The “/say” command takes one argument, text, and also says it from the point of view of whoever executes it. If you run it, then it will display as “<username> message” just like a regular chat. If it’s running from a command block, then it will be “[@] message”. Alternatively, there is “/tell”. That takes a player argument and “/tellraw” which is like “/tell” except it takes raw JSON rather than text.
Further
You can also fill the chain command blocks to write more things to chat. They will be executed in order, without delay, in the same tick as well. If you want to run them with a delay, then you will need to set them up with Redstone repeaters. Along with “/say”, there are other basic commands that do more things, such as “/give”, which gives items, “/effect”. That applies potion effects, “/setblock” and “/fill” which modify your world, and many others. A large database of commands can be found on the Minecraft Wiki, along with other helpful content as well.
Target Selectors | command block minecraft
Well, the “@p” target selectors are actually much more powerful than they seem at first glance. Such as, if we wanted to target all entities, we would use “@e”, but if we wanted to target only Zombies, then we would use
@e[type=Zombie]
Notice here, that the brackets after “@e”. Inside those brackets are target selector arguments, a full list of which you can found on the Minecraft Wiki. The “type” argument only selects entities of a certain type, also this one being “Zombie”. If we wanted to target all Zombies within 10 blocks of the command block, then we would use
@e[type=Zombie,r=10]
Along with the “r” being a radius argument. You can also target by location, name, team, and also score, among others as well.
Chaining Commands | command block minecraft
Let’s introduce another command that is not actually like the others. Its command is “/execute”. This command takes another command as input and then executes it from the point of view of another entity. The structure of “/execute” is, have a look:
/execute @target X Y Z /command
X, Y, and Z coordinate in order to run the command from. This does not matter with most commands but matters a lot if you use relative positioning. A relative position starts with “~” and is followed by a positive or also negative number. That indicates how many blocks from the origin, which is denoted by “~ ~ ~”. So, such as, if we wanted to run “/say” as if a Villager was talking, we can also set up the command like this:
/execute @e[type=Villager] ~ ~ ~ /say Hey
This command will then cause a message to go out to everyone, from every villager. This is not optimal if we have more than one person or more than one villager, so let’s reformat that command like:
/execute @a ~ ~ ~ /execute @e[type=Villager,c=1] ~ ~ ~ /tell @p Hey
This is much more complex than the first and then involves chaining two “/execute” commands together. The first “/execute” of the command actually runs on every player. Then the second checks for exactly one Villager nearby, and then have that Villager tell the closest player “Hey”. This actually makes sure that only one Villager talks per person as well.
Conclusion
Alright, That was all Folks! I hope you guys like this command block minecraft article and also find it helpful to you. Give us your feedback on it. Also if you guys have further queries and issues related to this article. Then let us know in the comments section below. We will get back to you shortly.
Have a Great Day!
Also See: User Guide To Troubleshoot Minecraft LAN Game Issues