Minecraft commands are very powerful tools that can help you do things in Minecraft very quickly. They can even be essential components in the design and creation of your own mini-games within a Minecraft world. Some commands are relatively simple to use, whereas some are complex and require lots of specific information to function correctly. Today we'll share some of our favorites with you!
If you're excited about learning more about Minecraft, be sure to check out our Minecraft camps and free Minecraft class led live online by an expert, and designed by professionals from Google, Stanford, and MIT. Learn Minecraft engineering or make your own mods.
What are Minecraft commands?
A Minecraft command is a way to make something specific happen in a Minecraft world. There are many different commands available. There are commands that can give a player a certain item, change the time in the world, teleport an entity, fill an area with blocks, and so on. Commands are kind of like a computer language in that they are used by players to tell the game what to do. For the game to understand and execute each command given by the player, the player must provide proper syntax or else the command will not work as intended.
How to Use Minecraft Commands
A command is executed by typing the command name in the Chat and Commands window and then pressing the Enter key or clicking the send button. The difference between a chat message and a command is that commands always start with a slash, e.g. /help. Although the player can press T or Enter on the keyboard to open the Chat and Commands window, pressing / on the keyboard will also open the Chat and Commands window but with a slash already added.
Because commands allow players to control what happens in a Minecraft world, commands are considered a cheat. If you are playing in a Minecraft world with cheats disabled, commands will not work. If you have never used a Minecraft command before, follow these steps below to practice running your first Minecraft command:
- Make a new Creative world with cheats enabled.
- Open the creative inventory and put some items in your hotbar.
- Press “/” to open the Chat and Commands window. Notice that there’s already a slash in the text field.
- Type “clear” so that your text looks like /clear.
- Send the message to execute the command. Notice that unlike chatting, executing a command automatically closes the Chat and Commands window.
- Observe your hotbar. If your command ran correctly, you will see that the items you acquired in Step 2 are gone. By executing the command /clear, you cleared all the items from your inventory. If you instead received an error message in the chat, you may have typed /clear incorrectly; the game won’t understand the command if there are any errors in it.
Congratulations on running your first command! You may have noticed that after you pressed / to open the Chat and Commands window, a list of commands were displayed instead of the usual chat log. When you are typing commands, Minecraft will automatically suggest commands based on what letters you have typed. If you do not want to type the entire command name, you can press the Tab key to cycle through the list suggested by the game. Also, if you need to run a command you have previously used, you can press the Up arrow key to scroll through commands you’ve already executed.
Some commands aren’t as simple as a single word. Some commands need extra information. These extra pieces of information are called arguments. One command that needs an argument is /weather. If you send the command /weather in the Chat and Commands window, you will receive an error. That is because the /weather command needs an argument but none was provided.
When you type /weather and then press the spacebar, you’ll see a list of suggestions of what argument to type next and two versions of the /weather command. The suggested arguments you’ll see are clear, query, rain, and thunder. The query argument is not like the others, which describe different types of weather. That’s because there are two different versions of the /weather command.
One way to use the /weather command is /weather query. By running this command, the game will simply state the current weather in the chat. The other way of using the /weather command is to set the weather. Try changing the weather using the /weather command like so:
- Run /weather rain; notice that it will start raining in the game.
- Run /weather clear; notice that it will stop raining.
- Run /weather thunder 10
The 10 in step three is an additional argument for controlling how long the specified weather state will last. In this case, the game will set the weather to thunder for ten seconds (Java Edition) or ten ticks (Bedrock Edition) and then return to clear.
Cool Minecraft Commands List
Here we'll share awesome commands from basic to more advanced! Explore the best Minecraft coding for kids courses to learn even more.
Basic Minecraft commands
The following commands are relatively simple ones to get started with. They only use relatively simple arguments such as a number and/or suggestions provided by the Chat and Command window. Practice with these commands to get a better feeling for how to use commands.
Use the /help command to learn about other commands. Adding a number argument (e.g. /help 3) will show you in the chat a list of commands from the virtual command handbook on the page number you specified. Instead of adding a number argument, you can add a command name as an argument (e.g. /help weather) to see a description of the command and the syntax associated with it.
Use the /time command to do different actions associated with time. You can set the time with commands like /time set midnight or /time set 1200; you can even add to the current time with /time add 1200.
Use the /gamerule command to toggle different rules in the world. There are many different rules to alter; the Chat and Command screen will suggest them as arguments. One such rule is fire damage, which determines whether or not players will be hurt by fire. To turn fire damage on, use /gamerule firedamage true; to turn fire damage off, use /gamerule firedamage false. There are many other rules you can experiment with.
Selector required Minecraft commands
This next group of commands are a little bit more challenging because they require a very specific type of argument called a selector. Knowing which selector to use is very helpful in using commands to target only certain entities.
Use the /tell command to send a chat message only to a specific player or players. The first argument after the /tell command will determine the player or players you wish to send the message to. The game will automatically suggest other players by their gamertags and a list of selectors. A selector is a preset target or group of targets. For example, the @a selector targets all players. The second argument is the message you wish to send. This sample command /tell @r hello will send the message “hello” to a random player.
Use the /kill command to kill specific entities or players in the world. Like the /tell command, /kill requires a target. For example, you can kill all entities with /kill @e. You can modify a selector to limit the targets to a certain subset. For example, if you only want to kill all the zombies, you would use /kill @e[type=zombie].
Use the /give command to give a player (or players) a certain item. For example, /give @s apple would give you one apple. You can add more arguments to control how many items and which versions of items you would like to receive. The command /give @a wool 64 1 would give all players 64 orange wool blocks (1 is the data value of the orange version of the wool block).
Use the /clear command to remove items from the inventory of a player (or players). We’ve already seen that /clear without any arguments removes everything from your own inventory. The command /clear @r diamond will remove all the diamonds from a random player’s inventory, whereas /clear @r emerald 1 will remove just one emerald from a random player’s inventory.
Use the /effect command to apply an effect to a player. For example, /effect @a blindness will put all players under the blindness effect for 30 seconds since no argument for time has been indicated. Arguments can be added to specify the duration of the effect and the level of the effect, so /effect @s speed 15 1 will apply the second level speed effect to yourself for 15 seconds. The levels for each effect start with 0, so the first level is 0, the second level is 1, etc. To remove effects from all players, use /effect @a clear.
More advanced Minecraft commands
This next group of commands are a bit more advanced because they use coordinates to represent where in the world something should happen. For these commands, it is strongly recommended that you practice using them in a world where you wouldn’t mind destroying anything because there is no easy way to undo the results of a /fill or /clone command.
Use the /teleport or /tp command to teleport an entity. There are many different versions of this function. You can teleport yourself to a random player’s location with /tp @s @r. Or you can teleport a random player to a specific location in the world using coordinates with a command such as /tp @r 100 65 100. The three numbers represent a location in the Minecraft world with 3-D coordinates. If you don’t specify a target player or entity to teleport, you will be the one who is teleported. For example, /tp ~0 ~0 ~-10 will teleport you ten blocks north of where you were standing because the tilde (~) represents coordinates relative to your location. There are also additional arguments to control which direction a target is facing after being teleported.
Use the /setblock command to place a certain block in a specific location in the world. For example, /setblock 50 60 70 concrete 15 will place a black concrete block (since 15 is the data value for black concrete) at the location (50, 60, 70). If the data value argument is omitted, it will default to 0. To change the block you’re standing on into air, use /setblock ~0 ~-1 ~0 air because the relative coordinate (0, -1, 0) represents the block directly beneath you.
Use the /fill command to fill an entire 3-D volume with a specific type of block. The /fill command is very similar to /setblock but instead requires two sets of coordinates. The first set of coordinates will represent one corner of the volume to fill and the second set of coordinates will represent the opposite corner. This command can be a big time saver because it can place a lot of blocks upon execution. If you want to build a column 50 blocks tall out of sand at location (-250, 70, -300), you would need to execute the command /fill -250 70 -300 -250 119 -300 sand. To build a square platform under where you’re standing, you could use something like /fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 obsidian.
Use the /clone command to copy an entire volume from one spot to another. This can be very useful for copying or moving something you’ve built into another area. The /clone command requires three sets of coordinates. The first set of coordinates is one corner of the volume to be copied, and the second set of coordinates is the opposite corner of the volume to be copied. The third set of coordinates is the corner of the area where the volume will be copied to with the lowest values. For example, to copy a 5x5x5 cube located at (20, 50, -80) to the spot one block south of the player’s location, the command would be /clone 20 50 -80 24 54 -76 ~0 ~0 ~1.
Try your new Minecraft commands!
The Minecraft Wiki is a great resource for learning what other commands you can use and their additional arguments, if they have any. There are many commands to learn and master. In addition to learning what the commands are, learning how to use target selectors is very important. Furthermore, a strong understanding of the coordinate system will be crucial for being able to effectively use commands that make use of coordinate arguments. The key to getting better at using commands is practice.
Up next, learn more about how to code Minecraft mods or get started with our fun live Minecraft Redstone Engineering class - there's even a free intro session!
Written by Chris Youngs, who worked on Minecraft for over four years. He spent most of that time testing Minecraft: Education Edition, with a heavy emphasis on the CodeBuilder feature. He joined the Create & Learn team to help teach young students the basics of programming with Minecraft: Education Edition.