Ready to get under the hood in Minecraft and start tinkering? The command line will let you tweak game settings, skip long walks, and spawn a variety of interesting and dangerous entities.
Inputting these commands is simple. While playing Minecraft, simply hit the forward-slash to bring up the chat window, and add your command after the slash. We’ll cover the basic usage for each, and the Gamepedia Commands page covers the more unique use cases.
For some of the commands listed below, you may also need the list of id codes for various blocks and status effects. You can find a full list of those codes on the Minecraft Wiki, which will differ depending on your version of the game. You can also use /Help to show the available commands for your platform, and /help followed by a command to see its parameters.
This is far from an exhaustive list of commands but provides a selection of useful and common commands that are broadly available on different platforms, with some basic use cases for each.
Inventory
Clear - If you need a way to wipe out your, or another player’s, inventory, the /clear command will do that in short order. You can simply type /clear for yourself, or add a space, then a player’s name, to erase their inventory.
Give - Instantly add an item to any player’s inventory, including yours, using the Give command. Put the player’s name first, the ID number of the item next, and the amount you’d like to give at the end.
Duplicate - This command copies and drops whatever you are currently holding.
Block manipulation
Clone - The clone command takes a snapshot of a specified region, and copies it to another set of coordinates. It requires at least three sets of X, Y, Z coordinates. The first two sets define the opposite corners of the area you’re copying from. The third set of numbers indicates the spot where the structure will be copied, starting at the lower northwest corner.
Fill - If you’d like to just create an area dense with a specific block, the fill tool makes that simple. After the command, fill in the X, Y, and Z coordinates, followed by the ID code for the block you want to use.
Instant mine - You can make your mining go much faster with this command that makes any tool break down blocks with a single hit.
Instant smelting - Use “/superheat” to turn all your items into their smelted forms.
Plants instantly grow - Use “/instantplant for a planted seed to grow without the use of bonemeal.
Player interaction
Effect - The Effect command has a number of uses, but the two most common are applying status effects to players or removing them. To apply an effect, simply add a player’s name and the ID code for any effect. To clear them, instead add the word “clear” after the player’s name, where the status ID would go.
Enchant - The Enchant command works just like Effect, except it applies an enchantment to the item the targeted player is currently holding, rather than the person themselves.
Kill - This one does just what it sounds like. You can use a player name or target a specific mob or NPC. If you don’t provide any parameters, the kill command will kill you instead.
Teleport and TP - These commands have some minor differences in parameter use, but they both have the same basic functionality -- moving players around. The most common use is teleporting yourself to another player or teleporting another player to you. Either way, the first name after the command should be the player you’re trying to move, and the second name is the player at the destination.
Target Selector - If you do not feel like typing an entire player’s name out, you can use the following shortcuts to affect them faster or add a little RNG madness to your world.
@p = nearest player
@r = random player
@a = all players
@e = all entities
World interactions
Difficulty - Monsters giving you trouble? The difficulty command lets you change the world’s difficult settings on the fly. The peaceful setting prevents any hostile mobs from spawning while bumping the difficulty to easy, medium, or hard will make the mobs deal more damage, and render the rules around eating and surviving more difficult. Minecraft has a hardcore mode, where dying causes the world to reset, but it isn’t available as an option here, you have to select it when you create the map.
Gamemode - While changing the difficulty will make your Minecraft world more or less forgiving, the Gamemode command lets you swap between survival, creative, adventure, or spectator mode. It’s great for editing your adventures, then testing them out, or switching to creative when you just need a few extra blocks.
Locate - Dropping the Locate command in chat will return the location of the closest structure. If you’re trying to quickly locate a village, mineshaft, or stronghold, this will tell you where to find it.
Playsound - This command lets you play any game sound, originating from any other player, including yourself. The first parameter is the sound itself, which is available either in the file in your game client or on the Minecraft wiki. If you’re playing the Java version, you’ll need to specify the audio source, as in master, ambient, music, etc. Finally, target a player for them to hear the noise or a position for it to come from. To stop it, use the same parameters, but with Stopsound instead of Playsound.
Freeze - Stop all mobs from moving
Fall Damage - Set fall damage on or off
Setworldspawn - Punch this command into chat to set the new spawn point for your world right where you’re standing. Alternatively, you can add coordinates on the end to specify a remote point. If you use the Spawnpoint command instead, you can set a player’s personal spawn point.
Summon - Use this command to summon any mob, or a variety of non-block items, into the world around you. You’ll need to use the Entity IDs, found on this Gamepedia page, to actually spawn in the correct mob or item.
Time - In lieu of an in-game clock, you can use the Time command to set the current game time, or just find out what time it is now. One of the most common uses is skipping over nighttime in creative mode, which you can do by entering Time Set 0, which will turn the clock to dawn instantly.
Stop time - If you are tired of constantly setting the time to your desired setting, use “/gamerule doDaylightCycle false” to stop time in its tracks. Replace “false” with “true” to reactivate the time cycle.
Weather - Too rainy for your tastes? The Weather command can change the weather around you by following the command with Clear, Rain, or Thunder. You can leave it blank to set it and let the weather change naturally or add a number of seconds for the downpour to last.
Atlantis - Are things a little too dry in your world? Use this command to raise the water levels so only the highest mountains in your server will be above water.
Server settings
Op and Deop - Use the Op command, followed by a player name, to promote them to Operator. This will allow them greater access to server commands and settings. If they start abusing their power, the Deop command will strip them of their titles and make them a regular player again.
List - The List command displays a quick rundown of all the players currently connected to the server.
Setmaxplayers - Need to let more people play with? Or maybe things are getting a little too crowded? This command will change the total number of players who can connect to you or your server.
Transferserver - Hop to another server without navigating back to the main menu using the Transferserver command. As long as you know the IP address, you’re good to go.
Keep inventory when you die - Use “/gamerule keepInventory true” to change the game rules to allow you to keep your inventory on your person when you die. To revert this, change “true” to “false”.
Chat
Me - A classic chat trope, the Me command, followed by a third-person statement, will simply share that you “did” that in chat.
Say - The Say command Broadcasts a message in chat to everyone currently playing on the server.
Tell - Whispering secrets? Follow up the Tell command with a player name, then the message, to send the message directly to them and no one else.
Brad Bourque contributed to this article.