How to Use Command Blocks in Minecraft

Table of contents:

How to Use Command Blocks in Minecraft
How to Use Command Blocks in Minecraft
Anonim

Minecraft commands (also known as "cheat codes") allow players to change any aspect of the game world or other players present. A "command block" is an item available in the game world, inside which a specific command is stored. As soon as the block in question is activated, the command it contains will be executed. This system allows you to create fun games, useful tools or very complex customized maps, in which there are a myriad of events triggered by these commands.

Steps

Part 1 of 3: Creating the Command Blocks

Use Command Blocks in Minecraft Step 1
Use Command Blocks in Minecraft Step 1

Step 1. Launch Minecraft on your computer or update Minecraft PE

In Minecraft you can use "command blocks" only in the Bedrock Edition or in the PC version. These blocks are not available in the Pocket Edition or the console version (versions that still have these subtitles in the name).

Use Command Blocks in Minecraft Step 2
Use Command Blocks in Minecraft Step 2

Step 2. Log into the game world where you have access to the console

The "command blocks" are elements present in the game, which allow you to access the Minecraft console. These are very powerful tools, which allow you to modify all aspects of the game world and gameplay, but which, precisely for this reason, are only available in certain circumstances:

  • Multiplayer Server: Only server administrators can use "command blocks". You will then have to ask one of the admins to include you in that user group, or you can create your own server.
  • If you are playing in "single-player" mode, you need to enable the use of "cheats", as long as you have already done so when you created the game world. To do this, go to the main menu and press the Open to LAN button, then select the "Allow Cheats" checkbox. When finished, press the Start LAN world button. This change will only be active for the current game session, but you can still repeat the activation procedure whenever you want to add other "command blocks".
Use Command Blocks in Minecraft Step 3
Use Command Blocks in Minecraft Step 3

Step 3. Switch to "Creative" game mode

Now that you have access to the console, you can switch to "Creative" game mode. This is the only game mode that allows the use and configuration of "command blocks". To apply the changes described, use the following commands:

  • Press the "T" key to open the console (the chat window). Alternatively, press the "/" key to open the window in question and insert the "/" character in the typing line.
  • To activate "Creative" game mode, type the following command / gamemode c, then press the "Enter" key.
  • When you have finished configuring the "command block", type the command / gamemode s to activate "Survival" mode or command / gamemode a to activate the "Adventure" mode.
Use Command Blocks in Minecraft Step 4
Use Command Blocks in Minecraft Step 4

Step 4. Create a "command block"

Open the console window by pressing the "T" key, then type the following command into it: / give [username] minecraft: command_block 64. Replace the [username] parameter with your full Minecraft username, obviously omitting the brackets.

  • Remember that the username is case sensitive.
  • If the command entered has no effect, it means that most likely you need to update your version of Minecraft to at least 1.4. To have the complete list of all the commands in the game available, you will need to update it with the latest version available.
  • You can replace the "64" parameter of the command with any number you like. This number refers to how many "command blocks" are produced. In our example command 64 blocks are produced.

Part 2 of 3: Using Command Blocks

Use Command Blocks in Minecraft Step 5
Use Command Blocks in Minecraft Step 5

Step 1. Place a "command block"

Explore your inventory to locate the "command blocks" you just created, which feature a brown cube icon with gray control panels on each side. Move the "command blocks" into the speed dial slot, then place one on the ground, as you would any other element in the game.

Use Command Blocks in Minecraft Step 6
Use Command Blocks in Minecraft Step 6

Step 2. Enter the "command block" interface

Approach your character to the newly placed block, then right click to open it, just as if it were a normal chest. A new pop-up window will appear with a text field.

If nothing happens, it most likely means that the use of "command blocks" is disabled on your multiplayer server. You need a user who can access the "server.properties" file to set the parameter enable-command-block with the value "true" and the parameter op-permission-level with the value "2" or higher.

Use Command Blocks in Minecraft Step 7
Use Command Blocks in Minecraft Step 7

Step 3. Type a command

Now you are able to enter the command you prefer in the "command block" text field. At the end, press the Done button to save the changes within the block in question. This guide contains a long list of commands, but as a first attempt you should try using the command summon Sheep.

  • For other commands, log into your normal game console (not the "command block" interface), then type the command / help.
  • Unlike the Minecraft console, commands typed within the interface text field of a "command block" must not begin with the "/" symbol.
Use Command Blocks in Minecraft Step 8
Use Command Blocks in Minecraft Step 8

Step 4. Activate the block using the "redstone"

Connect a strip created with the "redstone" dust to the "command block" in question, then place a push switch at a point in the "redstone" circuit. To activate the "redstone", place your character on the push switch plate. At this point, a sheep should appear next to the block. This event occurs whenever any player or any "mob" activates the switch connected to the "redstone".

  • This system works just like any other "redstone" based circuit or mechanism. You can replace the push switch with a push button, toggle switch, or other activation system of your choice. If you prefer, you can also place the activate button directly on the "command block".
  • Once the "command block" has been configured and equipped with an activation system, it can be used by anyone, but only users with the appropriate permissions can modify the command saved in it.
Use Command Blocks in Minecraft Step 9
Use Command Blocks in Minecraft Step 9

Step 5. Learn the advanced syntax

In most cases, the syntax of "command blocks" is the same as that used within the Minecraft console. If you are not yet familiar with the game console, please refer to the help section where you will find example commands. If you already know how the Minecraft command console works, below, you will find the only parameters you need to know:

  • @p - the command in question will affect the player who is closest to the "command block", regardless of distance.
  • @r - the command in question will affect any player among those connected to the server.
  • @to - the command in question will affect each of the players connected to the server, including yourself.
  • @And - the command in question will affect all the "entities" present on the server. This includes pretty much anything that isn't a block, including players, items, enemies, and animals. Be very careful when using this parameter.
  • You can use these parameters anywhere in the command where you would use the name of a user or entity.
Use Command Blocks in Minecraft Step 10
Use Command Blocks in Minecraft Step 10

Step 6. Edit the syntax to have more control over the effect of the command (optional)

You can create more specific commands by adding other parameters after "@p", "@r", "@a" or "@e". These additional parameters use syntax [(parameter_name) = (value)]. You have several parameters available, which in turn can take on different values. You can get the full list by searching online, but here are some examples to get you started:

  • A command that includes parameters @r [type = Sheep] will affect any sheep in the game world.
  • In "Creative" mode, this command @e [m = c] affects everyone. The "m" parameter indicates the game mode and the "c" value identifies the "Creative" mode.
  • Use the "!" to exclude the value indicated in the parameter. For example the command @a [team =! Commando] it will affect all players, but not those belonging to the "Commando" team (splitting into teams is only possible on some custom maps created by users).
Use Command Blocks in Minecraft Step 11
Use Command Blocks in Minecraft Step 11

Step 7. For help, press the "Tab" key

If you know there is a command but are not sure you know how to use it, press the "Tab" key, the game will automatically create it for you. Press the "Tab" key a second time to see the list of parameters.

For example, go back to the "command block" created earlier with the "summon-sheep" command, then delete the word "Sheep". At this point, press the "Tab" key several times to cycle through the complete list of all available options

Part 3 of 3: Command Block Examples

Use Command Blocks in Minecraft Step 12
Use Command Blocks in Minecraft Step 12

Step 1. Create a teleport block

Create a "command block" with the following command tp @p x y z. Replace the variables "x", "y" and "z" with the relative coordinates of the destination point of the teleportation (for example / tp @p 0 64 0). When someone activates the block in question, the closest player will be teleported to the indicated coordinates.

  • To view the coordinates, press the "F3" key.
  • As with any other command, you can replace the "@p" parameter with any other term. By using your username, you will only ever be teleported, even if someone else activates the block. By using the "@r" parameter, any player connected to the server will be teleported instead.
Use Command Blocks in Minecraft Step 13
Use Command Blocks in Minecraft Step 13

Step 2. Make objects or blocks appear

Assuming you are using Minecraft version 1.7 or later, you can create commands for generating any entity or block. Here are some examples:

  • A "command block" related to the command summon Boat will make a new boat appear next to the block in question each time it is activated. All players connected to your server will no longer have to endure long waits for the "ferry".
  • If you want to create a block instead of an entity, you will need to replace the "summon" command with the command setblock. The command setblock minecraft: water 50 70 100 will transform the block present at coordinates "50-70-100" into a block of water. If a block was already present at the given coordinates, it will disappear.
Use Command Blocks in Minecraft Step 14
Use Command Blocks in Minecraft Step 14

Step 3. Destroy objects or players

The "kill" command permanently deletes an entity. This is a very dangerous command, as a typo could destroy the wrong object (or the entire game world if you used the "@e" parameter). The command kill @r [type = Painting, r = 50] it destroys a frame chosen at random from all those present within 50 blocks of the "command block" in question.

Use Command Blocks in Minecraft Step 15
Use Command Blocks in Minecraft Step 15

Step 4. Check the weather and weather conditions

The commands time set day or time set 0 set the sunlight level to the indicated value. Replace the value 0 with the one you prefer to set the time of day you want. When you get tired of living in a world where the sun never sets, you can create a block with the command toggle downfall or weather rain to create rain.

Use Command Blocks in Minecraft Step 16
Use Command Blocks in Minecraft Step 16

Step 5. Try other commands

There are hundreds of commands at your disposal, you can discover them all using the command / help or by searching online on Minecraft-related websites and forums. Here are some commands to try:

  • say [message]
  • give [username] [object] [quantity]
  • effect [username] [effect name]
  • gamerule
  • testforblock

Advice

  • To view the list of commands available within the game console, use the command / help. To get the list of parameters related to a given command and understand how to use them, type the string / help [command_name]. For more information on this, you can refer to the numerous Wiki and online forums related to the world of Minecraft.
  • To disable the notification about the execution of a command, which is displayed in the chat window, log in to the game console, type the following string / gamerule commandBlockOutput false, then press the "Enter" key.
  • When the signal sent to a "Command block" is deactivated, nothing more happens. The "Command block" in question will resume its function only when the signal is reactivated.
  • Even if a "Command block" is not directly connected to a "redstone" circuit, it can still be activated if an adjacent "redstone" block receives a signal of 2 or greater strength.

Warnings

  • If a signal sent on a "redstone" circuit must cross more than 15 blocks, a special repeater must be used to maintain the necessary intensity.
  • To save the changes made to a "Command block", you have to press the "Done" button. By closing the appropriate creation window by pressing the "Esc" key, the created command will not be saved.

Recommended: