Commands

Commands may be used by players, operators and the Command Block while in multiplayer connected to a Minecraft server, and in singleplayer when the user has cheats enabled for the world (cheats are enabled during world creation via the "More World Options..." button). Some commands are also available in singleplayer even when cheats are not enabled. Commands may be entered from a Minecraft client while in the game or on the host computer's server console.

Commands being entered into the Minecraft client itself must be prefixed by a slash (example: ). The command window is identical to the chat window and can be accessed by pressing or starting directly by entering a slash.

Commands being executed via the console are not preceded by a slash. Commands in command blocks can be preceded by a slash, but this is not required.

Pressing cycles through possible commands or arguments.

In the following tables, required arguments appear in, and optional arguments appear in [square brackets]. Arguments in italics should be replaced by an appropriate value; arguments in plain text must be entered exactly as shown.

Player commands
These commands can be used in the chat window by any player who is allowed to connect to a server, and can also be used in singleplayer whether or not cheats are enabled.

doesn't protect.) Useful when lost, stuck or to restore health and hunger (assuming you can get your items back easily). Also displays message "Ouch. That looks like it hurt." || Cannot be used in a command block if no player is specified.
 * publish|| Opens your single-player game for LAN friends to join. This command appears in the singleplayer cheats. || Cannot be used in a command block.
 * playsound  [x] [y] [z] [Volume] [Pitch] [minimumVolume]|| Plays the selected sound to the selected player. The format for playing sounds are as follows:
 * playsound  [x] [y] [z] [Volume] [Pitch] [minimumVolume]|| Plays the selected sound to the selected player. The format for playing sounds are as follows:
 * playsound  [x] [y] [z] [Volume] [Pitch] [minimumVolume]|| Plays the selected sound to the selected player. The format for playing sounds are as follows:

Example: Sound located at .minecraft\assets\sound\mob\pig\death.ogg

The value for sound would be written as mob.pig.death, as the command originates from the sound folder. For sequentially numbered files pertaining to the same event (Example: various walking sounds), the player must exclude the number of the sound.

Example: Sound located at .minecraft\assets\sound\mob\pig\say[1-3].ogg This currently does not work as of 1.6.2

In this case, the command will play a randomly selected sound out of the three available.||
 * A player or area must be selected, and the player must be able to hear the sound from where it is played.
 * say ||Broadcasts message to all players on the server. If a multi-person target selector (e.g. @a) is used, the list of names is formatted as "name1, name2, and name3", or "name1 and name2" for two names. Therefore, regardless of any target selectors which are used, this command will only output once.|| All target selectors (e.g. @p) in the message must evaluate.
 * scoreboard ||See Scoreboard for more information. Scoreboard-specific commands.||Main Article
 * seed|| Displays the seed. This command can always be used in single-player mode, regardless of whether cheats are enabled or not. || Always succeeds (if user is a command block, player in singleplayer, or server op).
 * spawnpoint  [x y z] || Sets the spawnpoint of that player to that position, or to the current position if x y and z are not specified. Player is optional if x y z are not specified; will set the spawnpoint of the user to their current location. NOTE: Spawnpoint coordinates must be specified in whole numbers. No decimals. || Player must be online, and x, y, and z must be within the range -30,000,000 to 30,000,000 (inclusive). NOTE: Sleeping in a bed will also set a spawn point where the bed is, but you can only sleep in beds at night.
 * time set ||Sets the world time. number is an integer between 0 and 24000, inclusive, where 0 is dawn, 6000 midday, 12000 dusk and 18000 midnight.  Number can be greater than 24000; in this case, the the time of day wraps around, but the moon's phase is advanced.  However, Setting the time "backward" (earlier than the current time) does not change the moon.  "time set day" sets the time to 0, and "time set night" sets the time to 12500. || Number must be 0 or positive, or "day" or "night".
 * time add  ||Increments the world time, as above. || Number must be 0 or positive.  The daytime wraps, and the moon's phase advances; adding 24000 will advance the moon's phase by one day.
 * toggledownfall||Toggles rain and snow.||Always succeeds.
 * tp [playername] ||Teleports player playername to targetplayer 's location. If no player is specified, it will teleport yourself. || Playername is not optional in command blocks. Both players must be online.
 * tp [playername]   ||Teleports player playername (or yourself if no player is specified) to coordinates x,y,z. (the y value cannot be smaller than 0). Can also relatively move the player by adding the ~ character before the coordinate value. For example typing /tp John ~3 64 ~3 will teleport a player called John 3 blocks away from his current x and z, and to y 64. || x and z must fall within the range -30,000,000 to 30,000,000 (exclusive), and y must be at least 0. Playername is not optional in command blocks, and the player must be online.
 * weather  [seconds] || Changes the weather for the specified duration. || Seconds must be at least 1, and cannot be greater than 1000000, and a valid weather condition must be provided.
 * xp  [playername] ||Gives the specified user the given number of orbs. Maximum is 2,147,483,647 per command. Negative amounts may not be used to remove experience points. || Amount can be at most 2,147,483,647. Playername is not optional in command blocks, and player must be online.
 * xp L [playername] || Gives playername the amount number of experience levels. Maximum is 2,147,483,647 - if a player is given levels pushing them past this limit, they get reset to 0. Negative amounts may be used to remove experience levels. || Amount must be between -2,147,483,648 and 2,147,483,647, inclusive. Playername is not optional in command blocks, and player must be online.
 * }
 * toggledownfall||Toggles rain and snow.||Always succeeds.
 * tp [playername] ||Teleports player playername to targetplayer 's location. If no player is specified, it will teleport yourself. || Playername is not optional in command blocks. Both players must be online.
 * tp [playername]   ||Teleports player playername (or yourself if no player is specified) to coordinates x,y,z. (the y value cannot be smaller than 0). Can also relatively move the player by adding the ~ character before the coordinate value. For example typing /tp John ~3 64 ~3 will teleport a player called John 3 blocks away from his current x and z, and to y 64. || x and z must fall within the range -30,000,000 to 30,000,000 (exclusive), and y must be at least 0. Playername is not optional in command blocks, and the player must be online.
 * weather <clear | rain | thunder> [seconds] || Changes the weather for the specified duration. || Seconds must be at least 1, and cannot be greater than 1000000, and a valid weather condition must be provided.
 * xp <amount> [playername] ||Gives the specified user the given number of orbs. Maximum is 2,147,483,647 per command. Negative amounts may not be used to remove experience points. || Amount can be at most 2,147,483,647. Playername is not optional in command blocks, and player must be online.
 * xp <amount>L [playername] || Gives playername the amount number of experience levels. Maximum is 2,147,483,647 - if a player is given levels pushing them past this limit, they get reset to 0. Negative amounts may be used to remove experience levels. || Amount must be between -2,147,483,648 and 2,147,483,647, inclusive. Playername is not optional in command blocks, and player must be online.
 * }
 * xp <amount> [playername] ||Gives the specified user the given number of orbs. Maximum is 2,147,483,647 per command. Negative amounts may not be used to remove experience points. || Amount can be at most 2,147,483,647. Playername is not optional in command blocks, and player must be online.
 * xp <amount>L [playername] || Gives playername the amount number of experience levels. Maximum is 2,147,483,647 - if a player is given levels pushing them past this limit, they get reset to 0. Negative amounts may be used to remove experience levels. || Amount must be between -2,147,483,648 and 2,147,483,647, inclusive. Playername is not optional in command blocks, and player must be online.
 * }
 * xp <amount>L [playername] || Gives playername the amount number of experience levels. Maximum is 2,147,483,647 - if a player is given levels pushing them past this limit, they get reset to 0. Negative amounts may be used to remove experience levels. || Amount must be between -2,147,483,648 and 2,147,483,647, inclusive. Playername is not optional in command blocks, and player must be online.
 * }

Multiplayer-only Commands
These commands are usable by ops (operators) from the server console as well as through the chat window when prefixed by the command character (a forward slash). These commands are only available in SMP. With the exception of the list command, none of these commands can be executed by a command block, and none make use of target selectors. Many of these commands can be used on players who have never been to the server, or even on names which are not (or cannot be) registered as Minecraft accounts.

Command-Block-only commands
These commands can be used only in a Command Block and cannot be used in other ways. Command blocks are only obtainable via the  command.

Trivia

 * When the game rule "doFireTick" is set to "false", fires, though they will not spread, will burn eternally and be immune to rain, regardless of the block type they are attached to. This can be a large nuisance during thunderstorms, since lightning bolts can start a significant number of fires, and players need to put them out manually.


 * If you have "Resistance" Status effect level 5 (amplifier 4), /kill command does not work. This is a bug and was fixed in.