Minecraft:Commands: Difference between revisions
More actions
Remove broken links to missing pages |
Sync: updated from Minecraft |
||
| (One intermediate revision by the same user not shown) | |||
| Line 3: | Line 3: | ||
{{Redirect|Code|the command|Commands/code}} | {{Redirect|Code|the command|Commands/code}} | ||
[[File:Introduction-to-commands.jpg|thumb|Showcase of using {{Command|time}} to change the time in ''Minecraft'']] | [[File:Introduction-to-commands.jpg|thumb|Showcase of using {{Command|time}} to change the time in ''Minecraft'']] | ||
'''Commands''' (also known as '''console commands''' or '''slash commands''') are | '''Commands''' (also known as '''console commands''' or '''slash commands''') are a game mechanic that execute specific actions when entered as text or triggered by blocks or certain [[Minecraft:entities]]. | ||
== Usage == | == Usage == | ||
[[File:Command Block UI 1.21.5.png|thumb|The interface of a command block in {{JE}}]] | [[File:Command Block UI 1.21.5.png|thumb|The interface of a command block in {{JE}}]] | ||
[[File:Command Block UI BE.png|thumb|The interface of a command block in {{BE}}]] | [[File:Command Block UI BE.png|thumb|The interface of a command block in {{BE}}]] | ||
In the client, commands are entered via the chat window, which is displayed by pressing the {{key|T}} / {{key|Return}} / [[File:Chat button.png|25px]]{{only|bedrock|short=1}} / {{Xbutton|onedpad-right}}{{only|bedrock|short=1}} or {{key|/}} key. Using the {{key|/}} key also enters the forward-slash that commands require as a prefix, so it is a useful shortcut. The {{key|Up}} / {{Xbutton|onedpad-up}} and {{key|Down}} / {{Xbutton|onedpad-down}} keys can be used to view previously entered text, including all previously executed commands. | In the client, commands are entered via the [[Minecraft:chat]] window, which is displayed by pressing the {{key|T}} / {{key|Return}} / [[File:Chat button.png|25px]]{{only|bedrock|short=1}} / {{Xbutton|onedpad-right}}{{only|bedrock|short=1}} or {{key|/}} key. Using the {{key|/}} key also enters the forward-slash that commands require as a prefix, so it is a useful shortcut. The {{key|Up}} / {{Xbutton|onedpad-up}} and {{key|Down}} / {{Xbutton|onedpad-down}} keys can be used to view previously entered text, including all previously executed commands. | ||
When the cursor is at a location corresponding to some types of argument (such as an entity ID), a list of applicable values appears above the text box. If the argument already contains characters, the list displays only those values containing the typed text. Pressing {{key|Tab}} while entering commands cycles through possible commands or arguments, and can be used to auto-enter them. | When the cursor is at a location corresponding to some types of argument (such as an entity ID), a list of applicable values appears above the text box. If the argument already contains characters, the list displays only those values containing the typed text. Pressing {{key|Tab}} while entering commands cycles through possible commands or arguments, and can be used to auto-enter them. | ||
| Line 14: | Line 14: | ||
Commands may also be entered in a multiplayer [[Minecraft:server]]'s console but are ''not'' preceded by a {{key|/}} when entered this way. A server owner running commands in this way is often referred to as "ghosting". | Commands may also be entered in a multiplayer [[Minecraft:server]]'s console but are ''not'' preceded by a {{key|/}} when entered this way. A server owner running commands in this way is often referred to as "ghosting". | ||
Commands in command | Commands in [[Minecraft:command block]]s ''can'' be preceded by a slash, but it is not required. | ||
Commands can be executed in the following ways: | Commands can be executed in the following ways: | ||
* Entered by a player in the chat screen. | * Entered by a player in the chat screen. | ||
* Executed by a command block or a minecart with command block. | * Executed by a [[Minecraft:command block]] or a [[Minecraft:minecart with command block]]. | ||
* In a dedicated [[Minecraft:server]], entered in the console. | * In a dedicated [[Minecraft:server]], entered in the console. | ||
* In | * In [[Minecraft:function]]s, in a [[Minecraft:data pack]] or [[Minecraft:behavior pack]]. | ||
* Clicking a text component that has "run_command" action.{{only|java|short=1}} | * Clicking a [[Minecraft:text component]] that has "run_command" action.{{only|java|short=1}} | ||
* Requested by a WebSocket server connected to a client.{{only|bedrock|short=1}} | * Requested by a WebSocket server connected to a client.{{only|bedrock|short=1}} | ||
* Clicking a dialog's action button.{{only|java|short=1}} | * Clicking a dialog's [[Minecraft:Dialog#Action format|action button]].{{only|java|short=1}} | ||
* By an [[Minecraft:NPC]] dialogue.{{only|bedrock|short=1}} | * By an [[Minecraft:NPC]] dialogue.{{only|bedrock|short=1}} | ||
* In scripts, in a [[Minecraft:behavior pack]].{{only|bedrock|short=1}} | * In scripts, in a [[Minecraft:behavior pack]].{{only|bedrock|short=1}} | ||
| Line 30: | Line 30: | ||
* In an entity event response, in a [[Minecraft:behavior pack]].{{only|bedrock|short=1}} | * In an entity event response, in a [[Minecraft:behavior pack]].{{only|bedrock|short=1}} | ||
[[File:Command macro toast.png|thumb|The [[Toasts|toast]] that appears when a command macro fails]] | [[File:Command macro toast.png|thumb|The [[Toasts|toast]] that appears when a command macro fails]] | ||
{{IN|be}}, commands can be executed through specified hotkeys on keyboard & mouse controls, known as '''command macros'''. The keybinds with commands can be customized below all other keybinds in the settings. For up to 10 macros, a command can be entered in a text input, which can be quickly executed in-game by pressing {{Keys|Alt+''Key''}}. Command macros can be preceded by a slash, but it is not required. This feature is not to be confused with ''Java Edition''<nowiki/>'s function macros, where functions may reference additional parameters and use them in ''macro lines'' (see {{slink|Function (Java Edition)|Macros}}). | {{IN|be}}, commands can be executed through specified [[Minecraft:hotkeys]] on keyboard & mouse controls, known as '''command macros'''. The keybinds with commands can be customized below all other keybinds in the settings. For up to 10 macros, a command can be entered in a text input, which can be quickly executed in-game by pressing {{Keys|Alt+''Key''}}. Command macros can be preceded by a slash, but it is not required. This feature is not to be confused with ''Java Edition''<nowiki/>'s function macros, where functions may reference additional parameters and use them in ''macro lines'' (see {{slink|Function (Java Edition)|Macros}}). | ||
== Commands guide == | == Commands guide == | ||
| Line 93: | Line 93: | ||
==== Cheats ==== | ==== Cheats ==== | ||
Cheats can be enabled when creating a new world by Allow Commands{{only|je}} / Cheats{{only|be}} options. | Cheats can be enabled when [[Minecraft:Create New World|creating a new world]] by Allow Commands{{only|je}} / Cheats{{only|be}} options. | ||
{{IN|java}}, the "Allow Commands" option when creating a new world only affects the player in a singleplayer world or the owner of a LAN world. The "Allow Commands" option when opening a LAN world affects all players in the LAN world. | {{IN|java}}, the "Allow Commands" option when creating a new world only affects the player in a singleplayer world or the owner of a LAN world. The "Allow Commands" option when opening a LAN world affects all players in the LAN world. | ||
{{IN|java}}, in singleplayer worlds where cheats were not enabled at creation, they can be enabled on a temporary basis by opening the current game session to LAN play ( {{key|Esc}} → "Open to LAN", then "Allow Cheats" button and "Start LAN World"). The player does not actually need to be on a LAN or have others join. This is not permanent but allows the use of commands until the player quits the world, and changes the player makes via commands (items spawned, etc.) are saved with the world. The player can do this each time the player starts playing the world again. Note that this disables game pausing for the duration, so while open to LAN, the player should get somewhere safe or reload their world before using the Game Menu. The player can disable the LAN world by reloading the world. To permanently enable cheats, the level.dat file has to be edited. | {{IN|java}}, in singleplayer worlds where cheats were not enabled at creation, they can be enabled on a temporary basis by opening the current game session to LAN play ( {{key|Esc}} → "Open to LAN", then "Allow Cheats" button and "Start LAN World"). The player does not actually need to be on a LAN or have others join. This is not permanent but allows the use of commands until the player quits the world, and changes the player makes via commands (items spawned, etc.) are saved with the world. The player can do this each time the player starts playing the world again. Note that this disables game pausing for the duration, so while open to LAN, the player should get somewhere safe or reload their world before using the Game Menu. The player can disable the LAN world by reloading the world. To permanently enable cheats, the [[Minecraft:Java Edition level format#level.dat format|level.dat]] file has to be edited. | ||
{{IN|bedrock}}, cheats can be toggled at any time in the "Cheats" tab of the settings menu. Enabling cheats in a world permanently prevents players from unlocking [[Minecraft:achievement]]s in that world, even if cheats are later turned off. In [[Minecraft:Bedrock Dedicated Server]], {{cmd|changesetting}} command can be used to toggle cheats. | {{IN|bedrock}}, cheats can be toggled at any time in the "Cheats" tab of the settings menu. Enabling cheats in a world permanently prevents players from unlocking [[Minecraft:achievement]]s in that world, even if cheats are later turned off. In [[Minecraft:Bedrock Dedicated Server]], {{cmd|changesetting}} command can be used to toggle cheats. | ||
| Line 103: | Line 103: | ||
=== Argument types === | === Argument types === | ||
{{main|Argument types}} | {{main|Argument types}} | ||
There are different argument types for arguments in commands. [[Minecraft:Coordinates]], target selector, SNBT, text component, and so on are commonly used formats in arguments. | There are different argument types for arguments in commands. [[Minecraft:Coordinates]], [[Minecraft:target selector]], [[Minecraft:SNBT]], [[Minecraft:text component]], and so on are commonly used formats in arguments. | ||
=== Parsing and execution === | === Parsing and execution === | ||
| Line 110: | Line 110: | ||
The command performing on the server side is divided into two stages: '''command parsing''' and '''command execution'''. During the command parsing stage, the game identifies the string as a command and checks whether the command is complete and whether arguments are specified correctly. During the command execution stage, the command fulfills its purpose. | The command performing on the server side is divided into two stages: '''command parsing''' and '''command execution'''. During the command parsing stage, the game identifies the string as a command and checks whether the command is complete and whether arguments are specified correctly. During the command execution stage, the command fulfills its purpose. | ||
When typing a command in the chat, or command block, the command is also be parsed '''in the client side''' first to provide autocompletion and help the player detect typing mistakes. | When typing a command in the chat, or [[Minecraft:command block]], the command is also be parsed '''in the client side''' first to provide autocompletion and help the player detect typing mistakes. | ||
: When typing an argument into the chat, it's noticeable if an argument cannot be parsed in the client side. However, being able to be parsed in the client side does '''not''' guarantee that this argument can be parsed in the server side. | : When typing an argument into the chat, it's noticeable if an argument cannot be parsed in the client side. However, being able to be parsed in the client side does '''not''' guarantee that this argument can be parsed in the server side. | ||
::{{IN|java}}, if an argument can't be parsed by the client, the argument is marked in red, and a syntax error message is displayed above the chat bar. | ::{{IN|java}}, if an argument can't be parsed by the client, the argument is marked in red, and a syntax error message is displayed above the chat bar. | ||
::{{IN|bedrock}}, when typing in the chat, if an argument can be parsed in the client side, the next argument in syntax hint turns to white from gray. If all arguments (including optional arguments) are entered and parseable in the client side, the whole syntax hint turns to gray from white. | ::{{IN|bedrock}}, when typing in the chat, if an argument can be parsed in the client side, the next argument in syntax hint turns to white from gray. If all arguments (including optional arguments) are entered and parseable in the client side, the whole syntax hint turns to gray from white. | ||
:{{IN|java}}, typing a command in command block also behaves as above | :{{IN|java}}, typing a command in [[Minecraft:command block]] also behaves as above | ||
:{{IN|bedrock}}, when typing a command in command block, autocompletion is provided without syntax hint. | :{{IN|bedrock}}, when typing a command in [[Minecraft:command block]], autocompletion is provided without syntax hint. | ||
{{IN|bedrock}}, when entering into a command block, the command is parsed on the server side once the command block screen is closed. If the command is unparseable in the server side, a syntax error message is outputted into its output box. | {{IN|bedrock}}, when entering into a command block, the command is parsed on the server side once the command block screen is closed. If the command is unparseable in the server side, a syntax error message is outputted into its output box. | ||
| Line 123: | Line 123: | ||
:{{IN|bedrock}}, the message is <code>Unknown command</code> or <code>Syntax error: unexpected ... at ...</code>. | :{{IN|bedrock}}, the message is <code>Unknown command</code> or <code>Syntax error: unexpected ... at ...</code>. | ||
Commands in functions are all parsed when loading the function. If any command in a function file is unparseable, the function cannot be loaded by the game. {{IN|java}}, macro lines are parsed when attempting to run the function, see also {{slink|Function (Java Edition)|Macros}} and {{slink|Function (Java Edition)|Loading and parsing}}. | Commands in [[Minecraft:functions]] are all parsed when loading the function. If any command in a function file is unparseable, the function cannot be loaded by the game. {{IN|java}}, macro lines are parsed when attempting to run the function, see also {{slink|Function (Java Edition)|Macros}} and {{slink|Function (Java Edition)|Loading and parsing}}. | ||
{{IN|be}}, if a command in a script is unparseable, an error is thrown when trying to execute the command. | {{IN|be}}, if a command in a script is unparseable, an error is thrown when trying to execute the command. | ||
| Line 130: | Line 130: | ||
After trying to execute a command, it may yield '''output values''', including '''success count''' and '''stored values'''{{only|je}}. | After trying to execute a command, it may yield '''output values''', including '''success count''' and '''stored values'''{{only|je}}. | ||
Success count is the value a command passes to the command block executing it. A command block can power a redstone comparator facing away from it (may be separated by a block) with signal strength being the success count. The signal strength reflects the success count of the last command executed. Even after the command block is deactivated, the success count is retained until the command is executed again. {{IN|be}}, the success count is also returned to the script executing the command. {{IN|java}}, commands that cannot be executed in command blocks have no success count. {{IN|bedrock}}, commands that cannot be executed in command blocks or scripts still have a success count, but it cannot be obtained. {{IN|je}}, success count is always 0 or 1, except the {{cmd|execute}} command. {{IN|be}}, success count is an integer between 0 to 2,147,483,647 (both inclusive) related to the command (e.g., the number of players affected by the command, the number of blocks that were altered, etc.) | Success count is the value a command passes to the command block executing it. A command block can power a [[Minecraft:redstone comparator]] facing away from it (may be separated by a block) with signal strength being the success count. The signal strength reflects the success count of the last command executed. Even after the command block is deactivated, the success count is retained until the command is executed again. {{IN|be}}, the success count is also returned to the script executing the command. {{IN|java}}, commands that cannot be executed in command blocks have no success count. {{IN|bedrock}}, commands that cannot be executed in command blocks or scripts still have a success count, but it cannot be obtained. {{IN|je}}, success count is always 0 or 1, except the {{cmd|execute}} command. {{IN|be}}, success count is an integer between 0 to 2,147,483,647 (both inclusive) related to the command (e.g., the number of players affected by the command, the number of blocks that were altered, etc.) | ||
Stored values{{only|je|short=1}} include {{cd|success}} value and {{cd|result}} value, which are the values passed by other commands to the {{cmd|execute}} command, when a command is executed by a {{cmd|execute}} command. These two values can be stored to a specified location by the {{cd|store}} subcommand in the {{cmd|execute}} command. The {{cd|success}} value is always 0 or 1. The {{cd|result}} value is an integer (rounded down if not). All commands may yield these two stored values after execution, with only two exceptions: {{cmd|execute}} command itself does not yield these two stored values; {{cmd|function}} command may not yield these two stored values in certain situation. | Stored values{{only|je|short=1}} include {{cd|success}} value and {{cd|result}} value, which are the values passed by other commands to the {{cmd|execute}} command, when a command is executed by a {{cmd|execute}} command. These two values can be stored to a specified location by the {{cd|store}} subcommand in the {{cmd|execute}} command. The {{cd|success}} value is always 0 or 1. The {{cd|result}} value is an integer (rounded down if not). All commands may yield these two stored values after execution, with only two exceptions: {{cmd|execute}} command itself does not yield these two stored values; {{cmd|function}} command may not yield these two stored values in certain situation. | ||
| Line 149: | Line 149: | ||
;Terminated{{only|java|short=1}} | ;Terminated{{only|java|short=1}} | ||
:Exclusive to {{cmd|execute}} command. When running a {{cmd|execute}} command, if the number of execution branches becomes 0, the command terminates, ending before the last sub-command is executed. | :Exclusive to {{cmd|execute}} command. When running a {{cmd|execute}} command, if the number of execution branches becomes 0, the command terminates, ending before the last sub-command is executed. | ||
:For example: {{cmd|execute as @s run ...}} in a command block. The command block is not an entity, so it cannot be selected by a target selector. As a result, the command is terminated at {{cd|as @s}}. | :For example: {{cmd|execute as @s run ...}} in a command block. The command block is not an entity, so it cannot be selected by a [[Minecraft:target selector]]. As a result, the command is terminated at {{cd|as @s}}. | ||
;Failed and Successful | ;Failed and Successful | ||
| Line 167: | Line 167: | ||
! style="text-align:left;" | Command | ! style="text-align:left;" | Command | ||
! style="text-align:left;" class="unsortable" | Description | ! style="text-align:left;" class="unsortable" | Description | ||
! style="padding:0.4em;" | {{Tooltip|OP level required|Permission level required to perform the command}} | ! style="padding:0.4em;" | {{Tooltip|[[Minecraft:OP level]] required|Permission level required to perform the command}} | ||
! style="padding:0.4em;" | {{Tooltip|Multiplayer only|Commands usable only in multiplayer}} | ! style="padding:0.4em;" | {{Tooltip|Multiplayer only|Commands usable only in multiplayer}} | ||
! style="padding:0.2em;" | {{Tooltip|{{EnvSprite|blocks}}|Command modifies or queries blocks}} | ! style="padding:0.2em;" | {{Tooltip|{{EnvSprite|blocks}}|Command modifies or queries blocks}} | ||
| Line 175: | Line 175: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|advancement}} | | style="text-align:left;" |{{cmd|advancement}} | ||
| style="text-align:left;" |Gives, removes, or checks player | | style="text-align:left;" |Gives, removes, or checks player [[Minecraft:advancement]]s. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | | {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | ||
| Line 220: | Line 220: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|data}} | | style="text-align:left;" |{{cmd|data}} | ||
| style="text-align:left;" |Gets, merges, modifies, and removes [[Minecraft:block entity]], entity, and command storage NBT data. | | style="text-align:left;" |Gets, merges, modifies, and removes [[Minecraft:block entity]], [[Minecraft:entity]], and [[Minecraft:Command storage format|command storage]] NBT data. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|yes|{{EnvSprite|blocks}}}} || {{tc|yes|{{EnvSprite|mobs}}}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | | {{tc|yes|{{EnvSprite|blocks}}}} || {{tc|yes|{{EnvSprite|mobs}}}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | ||
| Line 235: | Line 235: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|defaultgamemode}} | | style="text-align:left;" |{{cmd|defaultgamemode}} | ||
| style="text-align:left;" |Sets the default game mode. | | style="text-align:left;" |Sets the default [[Minecraft:game mode]]. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|default}}}} | | {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|default}}}} | ||
| Line 255: | Line 255: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|effect}} | | style="text-align:left;" |{{cmd|effect}} | ||
| style="text-align:left;" |Adds or removes status | | style="text-align:left;" |Adds or removes [[Minecraft:status effect]]s. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|yes|{{EnvSprite|mobs}}}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | | {{tc|-}} || {{tc|yes|{{EnvSprite|mobs}}}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | ||
| Line 270: | Line 270: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|experience}} | | style="text-align:left;" |{{cmd|experience}} | ||
| style="text-align:left;" |An alias of {{cmd|xp}}. Adds or removes player experience. | | style="text-align:left;" |An alias of {{cmd|xp}}. Adds or removes player [[Minecraft:experience]]. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | | {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | ||
| Line 290: | Line 290: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|forceload}} | | style="text-align:left;" |{{cmd|forceload}} | ||
| style="text-align:left;" |Forces | | style="text-align:left;" |Forces [[Minecraft:chunk]]s to constantly be loaded or not. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|default}}}} | | {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|default}}}} | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|function}} | | style="text-align:left;" |{{cmd|function}} | ||
| style="text-align:left;" |Runs a function. | | style="text-align:left;" |Runs a [[Minecraft:function]]. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|default}}}} | | {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|default}}}} | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|gamemode}} | | style="text-align:left;" |{{cmd|gamemode}} | ||
| style="text-align:left;" |Sets a player's game mode. | | style="text-align:left;" |Sets a player's [[Minecraft:game mode]]. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | | {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|gamerule}} | | style="text-align:left;" |{{cmd|gamerule}} | ||
| style="text-align:left;" |Sets or queries a game rule value. | | style="text-align:left;" |Sets or queries a [[Minecraft:game rule]] value. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|default}}}} | | {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|default}}}} | ||
| Line 550: | Line 550: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|test}} | | style="text-align:left;" |{{cmd|test}} | ||
| style="text-align:left;" |Manage and execute GameTests. | | style="text-align:left;" |Manage and execute [[Minecraft:GameTests]]. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|-}} | | {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|-}} | ||
| Line 600: | Line 600: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|waypoint}} | | style="text-align:left;" |{{cmd|waypoint}} | ||
| style="text-align:left;" |Manages waypoints displayed on the locator bar. | | style="text-align:left;" |Manages waypoints displayed on the [[Minecraft:locator bar]]. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | | {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | ||
| Line 615: | Line 615: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|worldborder}} | | style="text-align:left;" |{{cmd|worldborder}} | ||
| style="text-align:left;" |Manages the world border. | | style="text-align:left;" |Manages the [[Minecraft:world border]]. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|default}}}} | | {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|default}}}} | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|xp}} | | style="text-align:left;" |{{cmd|xp}} | ||
| style="text-align:left;" |An alias of {{cmd|experience}}. Adds or removes player experience. | | style="text-align:left;" |An alias of {{cmd|experience}}. Adds or removes player [[Minecraft:experience]]. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | | {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | ||
| Line 628: | Line 628: | ||
{{debug warning|plural=1|section=1}} | {{debug warning|plural=1|section=1}} | ||
Debugging commands are not accessible by default, but can be enabled using debug properties. | Debugging commands are not accessible by default, but can be enabled using [[Minecraft:debug properties]]. | ||
{| class="wikitable sortable mw-collapsible" style="text-align:center;" | {| class="wikitable sortable mw-collapsible" style="text-align:center;" | ||
! style="text-align:left;" | Command | ! style="text-align:left;" | Command | ||
! style="text-align:left;" class="unsortable" | Description | ! style="text-align:left;" class="unsortable" | Description | ||
! {{Tooltip|OP level required|Permission level required to perform the command}} | ! {{Tooltip|[[Minecraft:OP level]] required|Permission level required to perform the command}} | ||
! {{Tooltip|Multiplayer only|Commands usable only in multiplayer}} | ! {{Tooltip|Multiplayer only|Commands usable only in multiplayer}} | ||
! {{Tooltip|{{EnvSprite|blocks}}|Command modifies or queries blocks}} | ! {{Tooltip|{{EnvSprite|blocks}}|Command modifies or queries blocks}} | ||
| Line 642: | Line 642: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|warden_spawn_tracker}} | | style="text-align:left;" |{{cmd|warden_spawn_tracker}} | ||
| style="text-align:left;" |Shows how many warnings a sculk shrieker has before spawning a [[Minecraft:warden]]. | | style="text-align:left;" |Shows how many warnings a [[Minecraft:sculk shrieker]] has before spawning a [[Minecraft:warden]]. | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | | {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | ||
| Line 658: | Line 658: | ||
|- | |- | ||
| style="text-align:left;" | {{cmd|raid}} | | style="text-align:left;" | {{cmd|raid}} | ||
| style="text-align:left;" | Starts a raid | | style="text-align:left;" | Starts a [[Minecraft:raid]] | ||
| {{tc|yes|3}} || {{tc|-}} | | {{tc|yes|3}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|-}} | | {{tc|-}} || {{tc|-}} || {{tc|-}} || {{tc|-}} | ||
| Line 691: | Line 691: | ||
! {{Tooltip|''BE''|Available in Bedrock Edition}} | ! {{Tooltip|''BE''|Available in Bedrock Edition}} | ||
! {{Tooltip|''edu''|Available in Minecraft Education}} | ! {{Tooltip|''edu''|Available in Minecraft Education}} | ||
! {{Tooltip|OP level required|Command permission level required to perform the command}} | ! {{Tooltip|[[Minecraft:OP level]] required|Command permission level required to perform the command}} | ||
! {{Tooltip|Server only|Commands usable only in servers}} | ! {{Tooltip|Server only|Commands usable only in servers}} | ||
! {{Tooltip|{{EnvSprite|blocks}}|Command modifies or queries blocks}} | ! {{Tooltip|{{EnvSprite|blocks}}|Command modifies or queries blocks}} | ||
| Line 813: | Line 813: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|effect}} | | style="text-align:left;" |{{cmd|effect}} | ||
| style="text-align:left;" |Adds or removes status | | style="text-align:left;" |Adds or removes [[Minecraft:status effect]]s. | ||
| {{tc|yes}} || {{tc|yes}} | | {{tc|yes}} || {{tc|yes}} | ||
| {{tc|yes|1}} || {{tc|-}} | | {{tc|yes|1}} || {{tc|-}} | ||
| Line 849: | Line 849: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|function}} | | style="text-align:left;" |{{cmd|function}} | ||
| style="text-align:left;" |Runs a function. | | style="text-align:left;" |Runs a [[Minecraft:function]]. | ||
| {{tc|yes}} || {{tc|yes}} | | {{tc|yes}} || {{tc|yes}} | ||
| {{tc|yes|1}} || {{tc|-}} | | {{tc|yes|1}} || {{tc|-}} | ||
| Line 855: | Line 855: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|gamemode}} | | style="text-align:left;" |{{cmd|gamemode}} | ||
| style="text-align:left;" |Sets a player's game mode. | | style="text-align:left;" |Sets a player's [[Minecraft:game mode]]. | ||
| {{tc|yes}} || {{tc|yes}} | | {{tc|yes}} || {{tc|yes}} | ||
| {{tc|yes|1}} || {{tc|-}} | | {{tc|yes|1}} || {{tc|-}} | ||
| Line 861: | Line 861: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|gamerule}} | | style="text-align:left;" |{{cmd|gamerule}} | ||
| style="text-align:left;" |Sets or queries a game rule value. | | style="text-align:left;" |Sets or queries a [[Minecraft:game rule]] value. | ||
| {{tc|yes}} || {{tc|yes}} | | {{tc|yes}} || {{tc|yes}} | ||
| {{tc|yes|1}} || {{tc|-}} | | {{tc|yes|1}} || {{tc|-}} | ||
| Line 873: | Line 873: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|gametips}} | | style="text-align:left;" |{{cmd|gametips}} | ||
| style="text-align:left;" |Enable or disable the game tips on this device. | | style="text-align:left;" |Enable or disable the [[Minecraft:game tips]] on this device. | ||
| {{tc|yes}} || {{tc|-}} | | {{tc|yes}} || {{tc|-}} | ||
| {{tc|yes|0}} || {{tc|-}} | | {{tc|yes|0}} || {{tc|-}} | ||
| Line 891: | Line 891: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|hud}} | | style="text-align:left;" |{{cmd|hud}} | ||
| style="text-align:left;" |Changes the visibility of a HUD element. | | style="text-align:left;" |Changes the visibility of a [[Minecraft:HUD|HUD element]]. | ||
| {{tc|yes}} || {{tc|yes}} | | {{tc|yes}} || {{tc|yes}} | ||
| {{tc|yes|1}} || {{tc|-}} | | {{tc|yes|1}} || {{tc|-}} | ||
| Line 903: | Line 903: | ||
|- | |- | ||
| style="text-align:left;" | {{cmd|inputpermission}} | | style="text-align:left;" | {{cmd|inputpermission}} | ||
| style="text-align:left;" | Specify the operation for the player's permission status. | | style="text-align:left;" | Specify the operation for the player's [[Minecraft:permission]] status. | ||
| {{tc|yes}} || {{tc|yes}} | | {{tc|yes}} || {{tc|yes}} | ||
| {{tc|yes|1}} || {{tc|-}} | | {{tc|yes|1}} || {{tc|-}} | ||
| Line 1,005: | Line 1,005: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|project}} | | style="text-align:left;" |{{cmd|project}} | ||
| style="text-align:left;" |Contains tools for managing Editor projects. | | style="text-align:left;" |Contains tools for managing [[Minecraft:Editor]] projects. | ||
| {{tc|yes}} || {{tc|-}} | | {{tc|yes}} || {{tc|-}} | ||
| {{tc|yes|1}} || {{tc|-}} | | {{tc|yes|1}} || {{tc|-}} | ||
| Line 1,274: | Line 1,274: | ||
|- | |- | ||
| style="text-align:left;" |{{cmd|xp}} | | style="text-align:left;" |{{cmd|xp}} | ||
| style="text-align:left;" |Adds or removes player experience. | | style="text-align:left;" |Adds or removes player [[Minecraft:experience]]. | ||
| {{tc|yes}} || {{tc|yes}} | | {{tc|yes}} || {{tc|yes}} | ||
| {{tc|yes|1}} || {{tc|-}} | | {{tc|yes|1}} || {{tc|-}} | ||
| Line 1,289: | Line 1,289: | ||
! {{Tooltip|''BE''|Available in Bedrock Edition}} | ! {{Tooltip|''BE''|Available in Bedrock Edition}} | ||
! {{Tooltip|''edu''|Available in Minecraft Education}} | ! {{Tooltip|''edu''|Available in Minecraft Education}} | ||
! {{Tooltip|OP level required|Command permission level required to perform the command}} | ! {{Tooltip|[[Minecraft:OP level]] required|Command permission level required to perform the command}} | ||
! {{Tooltip|Server only|Commands usable only in servers}} | ! {{Tooltip|Server only|Commands usable only in servers}} | ||
! {{Tooltip|{{EnvSprite|blocks}}|Command modifies or queries blocks}} | ! {{Tooltip|{{EnvSprite|blocks}}|Command modifies or queries blocks}} | ||
| Line 1,465: | Line 1,465: | ||
| style="text-align:left;" |{{cmd|?}} | | style="text-align:left;" |{{cmd|?}} | ||
| style="text-align:left;" |An alias of {{cmd|help}}. Provides help for commands. | | style="text-align:left;" |An alias of {{cmd|help}}. Provides help for commands. | ||
| data-sort-value="4 1.13 17w45a" |{{nowrap|Java Edition 1.13}}<br>(17w45a) | | data-sort-value="4 1.13 17w45a" |{{nowrap|[[Minecraft:Java Edition 1.13]]}}<br>([[Minecraft:Java Edition 17w45a|17w45a]]) | ||
|'''?''' | |'''?''' | ||
| {{tc|no|0}} || {{tc|-}} | | {{tc|no|0}} || {{tc|-}} | ||
| Line 1,473: | Line 1,473: | ||
<span class="nowrap">{{cmd|achievement}}</span> | <span class="nowrap">{{cmd|achievement}}</span> | ||
| style="text-align:left;" |Gives or takes an achievement from a player | | style="text-align:left;" |Gives or takes an achievement from a player | ||
| data-sort-value="4 1.12 17w13a" |{{nowrap|Java Edition 1.12}}<br>(17w13a) | | data-sort-value="4 1.12 17w13a" |{{nowrap|[[Minecraft:Java Edition 1.12]]}}<br>([[Minecraft:Java Edition 17w13a|17w13a]]) | ||
| style="text-align:left;" |Achievements were superseded by advancements | | style="text-align:left;" |[[Minecraft:Achievements]] were superseded by [[Minecraft:advancements]] | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | | {{tc|-}} || {{tc|-}} || {{tc|yes|{{EnvSprite|player}}}} || {{tc|-}} | ||
| Line 1,480: | Line 1,480: | ||
| style="text-align:left;" |<span class="nowrap">{{cmd|banip}}</span> | | style="text-align:left;" |<span class="nowrap">{{cmd|banip}}</span> | ||
| style="text-align:left;" |Bans a player by IP number | | style="text-align:left;" |Bans a player by IP number | ||
| data-sort-value="2 0.31" |{{nowrap|Java Edition Indev 0.31}} | | data-sort-value="2 0.31" |{{nowrap|[[Minecraft:Java Edition Indev 0.31]]}} | ||
| style="text-align:left;" |Superseded by {{cmd|ban-ip}} | | style="text-align:left;" |Superseded by {{cmd|ban-ip}} | ||
| {{tc|yes|3}} || {{tc|yes}} | | {{tc|yes|3}} || {{tc|yes}} | ||
| Line 1,487: | Line 1,487: | ||
| style="text-align:left;" |{{nowrap|{{cmd|blockdata}}}} | | style="text-align:left;" |{{nowrap|{{cmd|blockdata}}}} | ||
| style="text-align:left;" |Modifies the data tag of a block | | style="text-align:left;" |Modifies the data tag of a block | ||
| data-sort-value="4 1.13 17w47a" |{{nowrap|Java Edition 1.13}}<br>([[Minecraft:Java Edition 17w47a|17w47a]]) | | data-sort-value="4 1.13 17w47a" |{{nowrap|[[Minecraft:Java Edition 1.13]]}}<br>([[Minecraft:Java Edition 17w47a|17w47a]]) | ||
| style="text-align:left;" |Superseded by {{cmd|data}} | | style="text-align:left;" |Superseded by {{cmd|data}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,494: | Line 1,494: | ||
| style="text-align:left;" |{{nowrap|{{cmd|broadcast}}}} | | style="text-align:left;" |{{nowrap|{{cmd|broadcast}}}} | ||
| style="text-align:left;" |Broadcasts a message across the entire server | | style="text-align:left;" |Broadcasts a message across the entire server | ||
| data-sort-value="1 0.0.16a_01" |Java Edition Classic 0.0.16a_01 | | data-sort-value="1 0.0.16a_01" |[[Minecraft:Java Edition Classic 0.0.16a_01]] | ||
| style="text-align:left;" |Superseded by {{cmd|say}} | | style="text-align:left;" |Superseded by {{cmd|say}} | ||
| {{tc|yes|1}} || {{tc|-}} | | {{tc|yes|1}} || {{tc|-}} | ||
| Line 1,501: | Line 1,501: | ||
| style="text-align:left;" |{{nowrap|{{cmd|chunk|link=none}}}} | | style="text-align:left;" |{{nowrap|{{cmd|chunk|link=none}}}} | ||
| style="text-align:left;" |Force chunks to load constantly or not | | style="text-align:left;" |Force chunks to load constantly or not | ||
| data-sort-value="4 1.13.1 pre1" |{{nowrap|Java Edition 1.13.1}}<br>(pre1) | | data-sort-value="4 1.13.1 pre1" |{{nowrap|[[Minecraft:Java Edition 1.13.1]]}}<br>([[Minecraft:Java Edition 1.13.1-pre1|pre1]]) | ||
| style="text-align:left;" |Superseded by {{cmd|forceload}} | | style="text-align:left;" |Superseded by {{cmd|forceload}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,508: | Line 1,508: | ||
| style="text-align:left;" |{{nowrap|{{cmd|entitydata}}}} | | style="text-align:left;" |{{nowrap|{{cmd|entitydata}}}} | ||
| style="text-align:left;" |Modifies the data tag of an entity | | style="text-align:left;" |Modifies the data tag of an entity | ||
| data-sort-value="4 1.13 17w45b" |{{nowrap|Java Edition 1.13}}<br>(17w45b) | | data-sort-value="4 1.13 17w45b" |{{nowrap|[[Minecraft:Java Edition 1.13]]}}<br>([[Minecraft:Java Edition 17w45b|17w45b]]) | ||
| style="text-align:left;" |Superseded by {{cmd|data}} | | style="text-align:left;" |Superseded by {{cmd|data}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,515: | Line 1,515: | ||
| style="text-align:left;" |{{nowrap|{{cmd|home}}}} | | style="text-align:left;" |{{nowrap|{{cmd|home}}}} | ||
| style="text-align:left;" |Teleports player to the [[Minecraft:world spawn]] | | style="text-align:left;" |Teleports player to the [[Minecraft:world spawn]] | ||
| data-sort-value="3 1.2.5" |{{nowrap|Java Edition Alpha v1.2.5}} | | data-sort-value="3 1.2.5" |{{nowrap|[[Minecraft:Java Edition Alpha v1.2.5]]}} | ||
| style="text-align:left;" |Superseded by {{cmd|kill}} | | style="text-align:left;" |Superseded by {{cmd|kill}} | ||
| {{tc|no|0}} || {{tc|-}} | | {{tc|no|0}} || {{tc|-}} | ||
| Line 1,522: | Line 1,522: | ||
| style="text-align:left;" |{{cmd|locatebiome}} | | style="text-align:left;" |{{cmd|locatebiome}} | ||
| style="text-align:left;" |Locates biomes | | style="text-align:left;" |Locates biomes | ||
| data-sort-value="4" 1.19 22w19a |{{nowrap|Java Edition 1.19<br>(22w19a)}} | | data-sort-value="4" 1.19 22w19a |{{nowrap|[[Minecraft:Java Edition 1.19]]<br>([[Minecraft:22w19a]])}} | ||
| style="text-align:left;" |Superseded by {{cmd|locate}} | | style="text-align:left;" |Superseded by {{cmd|locate}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,529: | Line 1,529: | ||
| style="text-align:left;" |{{cmd|placefeature}} | | style="text-align:left;" |{{cmd|placefeature}} | ||
| style="text-align:left;" |Used to place a configured feature at a given location | | style="text-align:left;" |Used to place a configured feature at a given location | ||
| data-sort-value="4 1.19 22w18a" |{{nowrap|Java Edition 1.19<br>(22w18a)}} | | data-sort-value="4 1.19 22w18a" |{{nowrap|[[Minecraft:Java Edition 1.19]]<br>([[Minecraft:Java Edition 22w18a|22w18a]])}} | ||
| style="text-align:left;" |Superseded by {{cmd|place}} | | style="text-align:left;" |Superseded by {{cmd|place}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,536: | Line 1,536: | ||
| style="text-align:left;" |{{nowrap|{{cmd|replaceitem}}}} | | style="text-align:left;" |{{nowrap|{{cmd|replaceitem}}}} | ||
| style="text-align:left;" |Replaces items in inventories | | style="text-align:left;" |Replaces items in inventories | ||
| data-sort-value="4 1.17 20w46a" |{{nowrap|Java Edition 1.17}}<br>(20w46a) | | data-sort-value="4 1.17 20w46a" |{{nowrap|[[Minecraft:Java Edition 1.17]]}}<br>([[Minecraft:Java Edition 20w46a|20w46a]]) | ||
| style="text-align:left;" |Superseded by {{cmd|item}} | | style="text-align:left;" |Superseded by {{cmd|item}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,543: | Line 1,543: | ||
| style="text-align:left;" |{{nowrap|{{cmd|setspawn}}}} | | style="text-align:left;" |{{nowrap|{{cmd|setspawn}}}} | ||
| style="text-align:left;" |Sets the current location as the default spawn location for new players | | style="text-align:left;" |Sets the current location as the default spawn location for new players | ||
| data-sort-value="2 0.31" |{{nowrap|Java Edition Indev 0.31}} | | data-sort-value="2 0.31" |{{nowrap|[[Minecraft:Java Edition Indev 0.31]]}} | ||
| style="text-align:left;" |Superseded by {{cmd|setworldspawn}} | | style="text-align:left;" |Superseded by {{cmd|setworldspawn}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,550: | Line 1,550: | ||
| style="text-align:left;" |{{nowrap|{{cmd|solid}}}} | | style="text-align:left;" |{{nowrap|{{cmd|solid}}}} | ||
| style="text-align:left;" |Toggles between placing stone or bedrock | | style="text-align:left;" |Toggles between placing stone or bedrock | ||
| data-sort-value="2 0.31" |{{nowrap|Java Edition Indev 0.31}} | | data-sort-value="2 0.31" |{{nowrap|[[Minecraft:Java Edition Indev 0.31]]}} | ||
| style="text-align:left;" |[[Minecraft:Bedrock]] was added to the Creative inventory as a separate item | | style="text-align:left;" |[[Minecraft:Bedrock]] was added to the Creative inventory as a separate item | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,557: | Line 1,557: | ||
| style="text-align:left;" |{{nowrap|{{cmd|stats}}}} | | style="text-align:left;" |{{nowrap|{{cmd|stats}}}} | ||
| style="text-align:left;" |Update objectives from command results | | style="text-align:left;" |Update objectives from command results | ||
| data-sort-value="4 1.13 17w45a" |{{nowrap|Java Edition 1.13}}<br>(17w45a) | | data-sort-value="4 1.13 17w45a" |{{nowrap|[[Minecraft:Java Edition 1.13]]}}<br>([[Minecraft:Java Edition 17w45a|17w45a]]) | ||
| style="text-align:left;" |Merged with {{cmd|execute}} | | style="text-align:left;" |Merged with {{cmd|execute}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,564: | Line 1,564: | ||
| style="text-align:left;" |{{cmd|testfor}} | | style="text-align:left;" |{{cmd|testfor}} | ||
| style="text-align:left;" |Counts entities matching specified conditions. | | style="text-align:left;" |Counts entities matching specified conditions. | ||
| data-sort-value="4 1.13 17w45a" |{{nowrap|Java Edition 1.13}}<br>(17w45a) | | data-sort-value="4 1.13 17w45a" |{{nowrap|[[Minecraft:Java Edition 1.13]]}}<br>([[Minecraft:Java Edition 17w45a|17w45a]]) | ||
| style="text-align:left;" |Merged with {{cmd|execute}} | | style="text-align:left;" |Merged with {{cmd|execute}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,571: | Line 1,571: | ||
| style="text-align:left;" |{{cmd|testforblock}} | | style="text-align:left;" |{{cmd|testforblock}} | ||
| style="text-align:left;" |Tests whether a block is in a location. | | style="text-align:left;" |Tests whether a block is in a location. | ||
| data-sort-value="4 1.13 17w45a" |{{nowrap|Java Edition 1.13}}<br>(17w45a) | | data-sort-value="4 1.13 17w45a" |{{nowrap|[[Minecraft:Java Edition 1.13]]}}<br>([[Minecraft:Java Edition 17w45a|17w45a]]) | ||
| style="text-align:left;" |Merged with {{cmd|execute}} | | style="text-align:left;" |Merged with {{cmd|execute}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,578: | Line 1,578: | ||
| style="text-align:left;" |{{cmd|testforblocks}} | | style="text-align:left;" |{{cmd|testforblocks}} | ||
| style="text-align:left;" |Tests whether the blocks in two regions match. | | style="text-align:left;" |Tests whether the blocks in two regions match. | ||
| data-sort-value="4 1.13 17w45a" |{{nowrap|Java Edition 1.13}}<br>(17w45a) | | data-sort-value="4 1.13 17w45a" |{{nowrap|[[Minecraft:Java Edition 1.13]]}}<br>([[Minecraft:Java Edition 17w45a|17w45a]]) | ||
| style="text-align:left;" |Merged with {{cmd|execute}} | | style="text-align:left;" |Merged with {{cmd|execute}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,585: | Line 1,585: | ||
| style="text-align:left;" |{{nowrap|{{cmd|toggledownfall}}}} | | style="text-align:left;" |{{nowrap|{{cmd|toggledownfall}}}} | ||
| style="text-align:left;" |Toggles the weather | | style="text-align:left;" |Toggles the weather | ||
| data-sort-value="4 1.13 17w45a" |{{nowrap|Java Edition 1.13}}<br>(17w45a) | | data-sort-value="4 1.13 17w45a" |{{nowrap|[[Minecraft:Java Edition 1.13]]}}<br>([[Minecraft:Java Edition 17w45a|17w45a]]) | ||
| style="text-align:left;" |Redundancy with {{cmd|weather}} | | style="text-align:left;" |Redundancy with {{cmd|weather}} | ||
| {{tc|yes|2}} || {{tc|-}} | | {{tc|yes|2}} || {{tc|-}} | ||
| Line 1,592: | Line 1,592: | ||
| style="text-align:left;" |{{nowrap|{{cmd|unban}}}} | | style="text-align:left;" |{{nowrap|{{cmd|unban}}}} | ||
| style="text-align:left;" |Pardons a banned player | | style="text-align:left;" |Pardons a banned player | ||
| data-sort-value="3 1.0.16" |{{nowrap|Java Edition Alpha v1.0.16}} | | data-sort-value="3 1.0.16" |{{nowrap|[[Minecraft:Java Edition Alpha v1.0.16]]}} | ||
| style="text-align:left;" |Superseded by {{cmd|pardon}} | | style="text-align:left;" |Superseded by {{cmd|pardon}} | ||
| {{tc|yes|3}} || {{tc|yes}} | | {{tc|yes|3}} || {{tc|yes}} | ||
| Line 1,648: | Line 1,648: | ||
| style="text-align:left;" |{{cmd|position}} | | style="text-align:left;" |{{cmd|position}} | ||
| style="text-align:left;" |Toggles player coordinates to be displayed on the HUD | | style="text-align:left;" |Toggles player coordinates to be displayed on the HUD | ||
| data-sort-value="7 1.0.21" |{{nowrap|Education Edition 1.0.21}} | | data-sort-value="7 1.0.21" |{{nowrap|[[Minecraft:Education Edition 1.0.21]]}} | ||
| style="text-align:left;" |Superseded by {{cmd|gamerule}} | | style="text-align:left;" |Superseded by {{cmd|gamerule}} | ||
| {{tc|-}} || {{tc|no|Removed}} | | {{tc|-}} || {{tc|no|Removed}} | ||
| Line 1,741: | Line 1,741: | ||
=== Joke commands === | === Joke commands === | ||
{{exclusive|java|section=1}} | {{exclusive|java|section=1}} | ||
These commands only exist in April Fools' Day joke versions of the game. | These commands only exist in [[Minecraft:April Fools' Day jokes|April Fools' Day joke]] versions of the game. | ||
*{{cmd|debugdim}} | *{{cmd|debugdim}} | ||
| Line 1,779: | Line 1,779: | ||
|{{HistoryLine||1.0.0|dev=Beta 1.9 Prerelease 5|Added {{cmd|xp}} and {{cmd|toggledownfall}}.}} | |{{HistoryLine||1.0.0|dev=Beta 1.9 Prerelease 5|Added {{cmd|xp}} and {{cmd|toggledownfall}}.}} | ||
|{{HistoryLine||1.3.1|dev=12w16a|Added cheats mode, allowing commands to be used in singleplayer. | |{{HistoryLine||1.3.1|dev=12w16a|Added cheats mode, allowing commands to be used in singleplayer. | ||
|"Enable Cheats" could be turned on in Hardcore mode.}} | |"Enable Cheats" could be turned on in [[Minecraft:Hardcore]] mode.}} | ||
|{{HistoryLine|||dev=12w17a|Added {{cmd|help}} and its alias {{cmd|?}}. | |{{HistoryLine|||dev=12w17a|Added {{cmd|help}} and its alias {{cmd|?}}. | ||
|"Enable Cheats" can no longer be turned on in Hardcore mode.}} | |"Enable Cheats" can no longer be turned on in Hardcore mode.}} | ||
| Line 1,812: | Line 1,812: | ||
|{{HistoryLine|||dev=14w32b|Added {{cmd|entitydata}}.}} | |{{HistoryLine|||dev=14w32b|Added {{cmd|entitydata}}.}} | ||
|{{HistoryLine||1.9.3|dev=pre2|Added {{Command|stopsound}}.}} | |{{HistoryLine||1.9.3|dev=pre2|Added {{Command|stopsound}}.}} | ||
|{{HistoryLine||1.11|dev=16w32a|Added block state support to commands.}} | |{{HistoryLine||1.11|dev=16w32a|Added [[Minecraft:block state]] support to commands.}} | ||
|{{HistoryLine|||dev=16w39a|Added {{Command|locate}}.}} | |{{HistoryLine|||dev=16w39a|Added {{Command|locate}}.}} | ||
|{{HistoryLine||1.12|dev=17w13a|Added {{Command|advancement}} and {{Command|recipe}}. | |{{HistoryLine||1.12|dev=17w13a|Added {{Command|advancement}} and {{Command|recipe}}. | ||
| Line 1,818: | Line 1,818: | ||
|{{HistoryLine|||dev=17w18a|Added {{Command|reload}}.}} | |{{HistoryLine|||dev=17w18a|Added {{Command|reload}}.}} | ||
|{{HistoryLine|||dev=pre1|Added {{Command|function}}.}} | |{{HistoryLine|||dev=pre1|Added {{Command|function}}.}} | ||
|{{HistoryLine||1.13|dev=17w45a|A new library named Brigadier is now used to parse commands. Different components of commands are displayed in different colors, and errors are displayed in red without having to run the command. Commands, for the most part, do not allow uppercase letters, and are now much faster and more efficient. | |{{HistoryLine||1.13|dev=17w45a|A new library named [[Minecraft:Brigadier]] is now used to parse commands. Different components of commands are displayed in different colors, and errors are displayed in red without having to run the command. Commands, for the most part, do not allow uppercase letters, and are now much faster and more efficient. | ||
|Removed {{Command|?}},{{Command|enchant}},{{Command|stats}},{{Command|testfor}},{{Command|testforblock}},{{Command|testforblocks}} and {{Command|toggledownfall}}. | |Removed {{Command|?}},{{Command|enchant}},{{Command|stats}},{{Command|testfor}},{{Command|testforblock}},{{Command|testforblocks}} and {{Command|toggledownfall}}. | ||
|Added {{cmd|tag}} and {{cmd|team}}. | |Added {{cmd|tag}} and {{cmd|team}}. | ||
| Line 1,842: | Line 1,842: | ||
|{{HistoryLine||1.13.1|dev=18w31a|Added {{cmd|chunk|link=/forceload}}.}} | |{{HistoryLine||1.13.1|dev=18w31a|Added {{cmd|chunk|link=/forceload}}.}} | ||
|{{HistoryLine|||dev=pre1|Renamed {{cmd|chunk|link=none}} to {{cmd|forceload}}.}} | |{{HistoryLine|||dev=pre1|Renamed {{cmd|chunk|link=none}} to {{cmd|forceload}}.}} | ||
|{{HistoryLine||September 26, 2018|link={{tweet|dinner|1044870699465216001}}|Brigadier [https://github.com/Mojang/brigadier open-sourced] under the MIT license. (Source code previously was available on the library site, with no license specified).}} | |{{HistoryLine||September 26, 2018|link={{tweet|dinner|1044870699465216001}}|[[Minecraft:Brigadier]] [https://github.com/Mojang/brigadier open-sourced] under the MIT license. (Source code previously was available on the library site, with no license specified).}} | ||
|{{HistoryLine||1.14|dev=18w43a|Added {{Command|drop|link=/loot}} and {{Command|schedule}}.}} | |{{HistoryLine||1.14|dev=18w43a|Added {{Command|drop|link=/loot}} and {{Command|schedule}}.}} | ||
|{{HistoryLine|||dev=18w45a|Renamed {{Command|drop|link=none}} to {{Command|loot}}. }} | |{{HistoryLine|||dev=18w45a|Renamed {{Command|drop|link=none}} to {{Command|loot}}. }} | ||
| Line 1,864: | Line 1,864: | ||
|{{HistoryLine||1.20|dev=23w16a|Added {{cmd|return}}.}} | |{{HistoryLine||1.20|dev=23w16a|Added {{cmd|return}}.}} | ||
|{{HistoryLine||1.20.2|dev=23w31a|The last 50 commands sent in chat is now remembered across game sessions, and can be accessed via up and down arrow keys. | |{{HistoryLine||1.20.2|dev=23w31a|The last 50 commands sent in chat is now remembered across game sessions, and can be accessed via up and down arrow keys. | ||
|Recent commands are now stored in {{cd|command_history.txt}} in the {{code|.minecraft}} folder. | |Recent commands are now stored in {{cd|command_history.txt}} in the {{code|[[Minecraft:.minecraft]]}} folder. | ||
|Added {{cmd|random}}.}} | |Added {{cmd|random}}.}} | ||
|{{HistoryLine||1.20.3|dev=23w43a|Added {{cmd|tick}}.}} | |{{HistoryLine||1.20.3|dev=23w43a|Added {{cmd|tick}}.}} | ||
| Line 1,874: | Line 1,874: | ||
|{{HistoryLine||1.21.6|dev=25w15a|Added {{cmd|version}}.}} | |{{HistoryLine||1.21.6|dev=25w15a|Added {{cmd|version}}.}} | ||
|{{HistoryLine||1.21.6|exp=Locator Bar|dev=25w15a|Added {{cmd|waypoint}}.}} | |{{HistoryLine||1.21.6|exp=Locator Bar|dev=25w15a|Added {{cmd|waypoint}}.}} | ||
|{{HistoryLine||1.21.6|dev=25w18a|{{cmd|waypoint}} can now be used without using the experiment Locator Bar.}} | |{{HistoryLine||1.21.6|dev=25w18a|{{cmd|waypoint}} can now be used without using the [[Minecraft:experiment]] [[Minecraft:Locator Bar]].}} | ||
|{{HistoryLine|||dev=25w20a|Added {{cmd|dialog}}.}} | |{{HistoryLine|||dev=25w20a|Added {{cmd|dialog}}.}} | ||
|{{HistoryLine||1.21.9|dev=25w34a|Added {{cmd|fetchprofile}}.}} | |{{HistoryLine||1.21.9|dev=25w34a|Added {{cmd|fetchprofile}}.}} | ||
| Line 1,885: | Line 1,885: | ||
|{{HistoryLine||v0.7.4|Added support for commands, though none are implemented yet.}} | |{{HistoryLine||v0.7.4|Added support for commands, though none are implemented yet.}} | ||
|{{HistoryLine||v0.16.0|dev=build 1|Added commands. | |{{HistoryLine||v0.16.0|dev=build 1|Added commands. | ||
|Functionality of most commands is equivalent to Java Edition 1.10 usage. Differences include: no support for [[#Data tags|data tags]].}} | |Functionality of most commands is equivalent to [[Minecraft:Java Edition 1.10]] usage. Differences include: no support for [[#Data tags|data tags]].}} | ||
|{{HistoryLine|pocket}} | |{{HistoryLine|pocket}} | ||
|{{HistoryLine||1.0.0|dev=alpha 0.17.0.1|Added {{cmd|locate}}, {{cmd|connect}}, and {{cmd|fly}}.}} | |{{HistoryLine||1.0.0|dev=alpha 0.17.0.1|Added {{cmd|locate}}, {{cmd|connect}}, and {{cmd|fly}}.}} | ||
| Line 1,941: | Line 1,941: | ||
|{{HistoryLine||1.19.10|dev=Preview 1.19.10.23|{{cmd|locate}} can now find biomes.}} | |{{HistoryLine||1.19.10|dev=Preview 1.19.10.23|{{cmd|locate}} can now find biomes.}} | ||
|{{HistoryLine||1.19.60|dev=Preview 1.19.60.22|Added {{cmd|scriptevent}}.}} | |{{HistoryLine||1.19.60|dev=Preview 1.19.60.22|Added {{cmd|scriptevent}}.}} | ||
|{{HistoryLine||1.19.80|dev=Preview 1.19.80.20|Added command suggestions for block states.}} | |{{HistoryLine||1.19.80|dev=Preview 1.19.80.20|Added command suggestions for [[Minecraft:block states]].}} | ||
|{{HistoryLine||1.19.80|dev=Preview 1.19.80.21|Added {{cmd|inputpermission}}.}} | |{{HistoryLine||1.19.80|dev=Preview 1.19.80.21|Added {{cmd|inputpermission}}.}} | ||
|{{HistoryLine||1.20.0|dev=Preview 1.20.0.22|Added {{cmd|camera}}.}} | |{{HistoryLine||1.20.0|dev=Preview 1.20.0.22|Added {{cmd|camera}}.}} | ||
| Line 1,950: | Line 1,950: | ||
|{{HistoryLine||1.21.20|dev=Preview 1.21.10.22|Removed {{cmd|volumearea}}.}} | |{{HistoryLine||1.21.20|dev=Preview 1.21.10.22|Removed {{cmd|volumearea}}.}} | ||
|{{HistoryLine||1.21.50|dev=Preview 1.21.50.20|Added {{cmd|set_movement_authority}}.}} | |{{HistoryLine||1.21.50|dev=Preview 1.21.50.20|Added {{cmd|set_movement_authority}}.}} | ||
|{{HistoryLine||1.21.50|exp=Aim Assist and Data-Driven Jigsaw Structures|dev=Preview 1.21.50.25|Added {{cmd|aimassist}} behind the "Aim Assist" experimental toggle.}} | |{{HistoryLine||1.21.50|exp=Aim Assist and Data-Driven Jigsaw Structures|dev=Preview 1.21.50.25|Added {{cmd|aimassist}} behind the "Aim Assist" [[Minecraft:experimental]] toggle.}} | ||
|{{HistoryLine|||dev=Preview 1.21.50.26|Added {{cmd|place}} behind the "Data-Driven Jigsaw Structures" experimental toggle.}} | |{{HistoryLine|||dev=Preview 1.21.50.26|Added {{cmd|place}} behind the "Data-Driven Jigsaw Structures" [[Minecraft:experimental]] toggle.}} | ||
|{{HistoryLine||26.0|dev=Preview 26.0.23|Added command macros.}} | |{{HistoryLine||26.0|dev=Preview 26.0.23|Added command macros.}} | ||
}} | }} | ||
| Line 1,968: | Line 1,968: | ||
*[[Minecraft:Argument types]] | *[[Minecraft:Argument types]] | ||
*[[Minecraft:Coordinates]] | *[[Minecraft:Coordinates]] | ||
*Entity format | *[[Minecraft:Entity format]] | ||
*Formatting codes | *[[Minecraft:Formatting codes]] | ||
*[[Minecraft:Text component format]] | *[[Minecraft:Text component format]] | ||
*[[Minecraft:Target selectors]] | *[[Minecraft:Target selectors]] | ||
| Line 1,990: | Line 1,990: | ||
[[Category:Server]] | [[Category:Server]] | ||
de:Befehl | [[Minecraft:de:Befehl]] | ||
es:Comandos | [[Minecraft:es:Comandos]] | ||
fr:Commandes | [[Minecraft:fr:Commandes]] | ||
hu:Szerverparancsok | [[Minecraft:hu:Szerverparancsok]] | ||
it:Comandi | [[Minecraft:it:Comandi]] | ||
ja:コマンド | [[Minecraft:ja:コマンド]] | ||
ko:명령어 | [[Minecraft:ko:명령어]] | ||
lzh:令 | [[Minecraft:lzh:令]] | ||
nl:Opdrachten | [[Minecraft:nl:Opdrachten]] | ||
pl:Polecenia | [[Minecraft:pl:Polecenia]] | ||
pt:Comandos | [[Minecraft:pt:Comandos]] | ||
ru:Команды консоли | [[Minecraft:ru:Команды консоли]] | ||
th:คำสั่ง | [[Minecraft:th:คำสั่ง]] | ||
tr:Komutlar | [[Minecraft:tr:Komutlar]] | ||
uk:Команди консолі | [[Minecraft:uk:Команди консолі]] | ||
zh:命令 | [[Minecraft:zh:命令]] | ||
Latest revision as of 11:11, 11 April 2026
Template:For Template:Redirect Template:Redirect
Commands (also known as console commands or slash commands) are a game mechanic that execute specific actions when entered as text or triggered by blocks or certain Minecraft:entities.
Usage
In the client, commands are entered via the Minecraft:chat window, which is displayed by pressing the Template:Key / Template:Key / File:Chat button.pngTemplate:Only / Template:XbuttonTemplate:Only or Template:Key key. Using the Template:Key key also enters the forward-slash that commands require as a prefix, so it is a useful shortcut. The Template:Key / Template:Xbutton and Template:Key / Template:Xbutton keys can be used to view previously entered text, including all previously executed commands.
When the cursor is at a location corresponding to some types of argument (such as an entity ID), a list of applicable values appears above the text box. If the argument already contains characters, the list displays only those values containing the typed text. Pressing Template:Key while entering commands cycles through possible commands or arguments, and can be used to auto-enter them.
Commands may also be entered in a multiplayer Minecraft:server's console but are not preceded by a Template:Key when entered this way. A server owner running commands in this way is often referred to as "ghosting".
Commands in Minecraft:command blocks can be preceded by a slash, but it is not required.
Commands can be executed in the following ways:
- Entered by a player in the chat screen.
- Executed by a Minecraft:command block or a Minecraft:minecart with command block.
- In a dedicated Minecraft:server, entered in the console.
- In Minecraft:functions, in a Minecraft:data pack or Minecraft:behavior pack.
- Clicking a Minecraft:text component that has "run_command" action.Template:Only
- Requested by a WebSocket server connected to a client.Template:Only
- Clicking a dialog's action button.Template:Only
- By an Minecraft:NPC dialogue.Template:Only
- In scripts, in a Minecraft:behavior pack.Template:Only
- In animation controllers, in a Minecraft:behavior pack.Template:Only
- In a block event response, in a Minecraft:behavior pack.Template:Only
- In an entity event response, in a Minecraft:behavior pack.Template:Only
Template:IN, commands can be executed through specified Minecraft:hotkeys on keyboard & mouse controls, known as command macros. The keybinds with commands can be customized below all other keybinds in the settings. For up to 10 macros, a command can be entered in a text input, which can be quickly executed in-game by pressing Template:Keys. Command macros can be preceded by a slash, but it is not required. This feature is not to be confused with Java Edition's function macros, where functions may reference additional parameters and use them in macro lines (see Template:Slink).
Commands guide
Syntax
Entry Meaning Template:Code Enter this literally, exactly as shown. Template:Code An argument, which should be replaced with an appropriate value. Note: the angle brackets should be replaced too; they only indicate the purpose of the text.
Decorator Meaning Template:Code This entry is optional. Template:Code
Template:Code
etc.Required. Pick one of these entries. Template:Code
Template:Code
etc.Optional. Pick one of these entries. Template:Code In the game, another full command is required.
In this wiki, some required parts are left out.
- For example: Template:Code is an optional argument. Template:Code is an optional plain text.
- For example: Template:Code, where Template:Code and Template:Code are plain texts that should be entered literally; Template:Code means we should pick one plain text from Template:Code and Template:Code; Template:Code and Template:Code are required arguments, which should be replaced with appropriate values; Template:Code is an optional argument.
Entry Meaning Template:Code Enter this literally, exactly as shown. Template:Code An argument, which should be replaced with an appropriate value. Template:Code Another full command is required. Template:Code
Template:Code
etc.Enter one of these texts literally.
Decorator Meaning Template:Code This entry is required. Template:Code This entry is optional. Template:Code In this wiki, some required parts are left out.
- The angle bracket decorator (Template:Code) is usually not used on a Template:Code. A required plain text does not need any decorator.
- For example, both Template:Code and Template:Code represent a required plain text, but the latter one is usually not used. Template:Code is a required argument.
In both Template:El and Template:El, square bracket decorator (Template:Code) mean that an entry is optional. Entries decorated with square brackets can only be at the end of a command. Multiple entries decorated with square brackets are allowed at the end of a command, for example, Template:Code at the end of a command indicates that only Template:Code, Template:Code, and Template:Code are valid.
Restrictions
Most commands require the executor to have a high enough Minecraft:permission level. That means most commands are only available in the singleplayer world if cheats are enabled, and are only available in multiplayer servers if the player is an operator. See Minecraft:permission level for details.
Some commands have restrictions on who can use the command or in what context.
- None: The command has no restriction.
- Cheats only: Applicable only to Template:El. When executed by the server, or a script, the command is available no matter whether cheats are enabled. (Commands from the console, a scheduled function or a ticking function are executed by the server.) When executed in other ways, the command is available only if cheats are enabled. When cheats are disabled, these commands can't be used unless executed by a server or a script, even if the executor has a high Minecraft:permission level.
- Template:IN, whether cheats are enabled only affects the permission level of a player. If an executor has a high enough permission level, it can use corresponding commands regardless of whether cheats are allowed.
- Dedicated server only: The command is available only on dedicated servers.
- No dedicated server: The command is not available on dedicated servers.
Cheats
Cheats can be enabled when creating a new world by Allow CommandsTemplate:Only / CheatsTemplate:Only options.
Template:IN, the "Allow Commands" option when creating a new world only affects the player in a singleplayer world or the owner of a LAN world. The "Allow Commands" option when opening a LAN world affects all players in the LAN world.
Template:IN, in singleplayer worlds where cheats were not enabled at creation, they can be enabled on a temporary basis by opening the current game session to LAN play ( Template:Key → "Open to LAN", then "Allow Cheats" button and "Start LAN World"). The player does not actually need to be on a LAN or have others join. This is not permanent but allows the use of commands until the player quits the world, and changes the player makes via commands (items spawned, etc.) are saved with the world. The player can do this each time the player starts playing the world again. Note that this disables game pausing for the duration, so while open to LAN, the player should get somewhere safe or reload their world before using the Game Menu. The player can disable the LAN world by reloading the world. To permanently enable cheats, the level.dat file has to be edited.
Template:IN, cheats can be toggled at any time in the "Cheats" tab of the settings menu. Enabling cheats in a world permanently prevents players from unlocking Minecraft:achievements in that world, even if cheats are later turned off. In Minecraft:Bedrock Dedicated Server, Template:Cmd command can be used to toggle cheats.
Argument types
Template:Main There are different argument types for arguments in commands. Minecraft:Coordinates, Minecraft:target selector, Minecraft:SNBT, Minecraft:text component, and so on are commonly used formats in arguments.
Parsing and execution
The command performing on the server side is divided into two stages: command parsing and command execution. During the command parsing stage, the game identifies the string as a command and checks whether the command is complete and whether arguments are specified correctly. During the command execution stage, the command fulfills its purpose.
When typing a command in the chat, or Minecraft:command block, the command is also be parsed in the client side first to provide autocompletion and help the player detect typing mistakes.
- When typing an argument into the chat, it's noticeable if an argument cannot be parsed in the client side. However, being able to be parsed in the client side does not guarantee that this argument can be parsed in the server side.
- Template:IN, if an argument can't be parsed by the client, the argument is marked in red, and a syntax error message is displayed above the chat bar.
- Template:IN, when typing in the chat, if an argument can be parsed in the client side, the next argument in syntax hint turns to white from gray. If all arguments (including optional arguments) are entered and parseable in the client side, the whole syntax hint turns to gray from white.
- Template:IN, typing a command in Minecraft:command block also behaves as above
- Template:IN, when typing a command in Minecraft:command block, autocompletion is provided without syntax hint.
Template:IN, when entering into a command block, the command is parsed on the server side once the command block screen is closed. If the command is unparseable in the server side, a syntax error message is outputted into its output box.
When attempting to execute an unparseable command, an error message is displayed.
- Template:IN, the message has a
<--[HERE]at its end. - Template:IN, the message is
Unknown commandorSyntax error: unexpected ... at ....
Commands in Minecraft:functions are all parsed when loading the function. If any command in a function file is unparseable, the function cannot be loaded by the game. Template:IN, macro lines are parsed when attempting to run the function, see also Template:Slink and Template:Slink.
Template:IN, if a command in a script is unparseable, an error is thrown when trying to execute the command.
Output
After trying to execute a command, it may yield output values, including success count and stored valuesTemplate:Only.
Success count is the value a command passes to the command block executing it. A command block can power a Minecraft:redstone comparator facing away from it (may be separated by a block) with signal strength being the success count. The signal strength reflects the success count of the last command executed. Even after the command block is deactivated, the success count is retained until the command is executed again. Template:IN, the success count is also returned to the script executing the command. Template:IN, commands that cannot be executed in command blocks have no success count. Template:IN, commands that cannot be executed in command blocks or scripts still have a success count, but it cannot be obtained. Template:IN, success count is always 0 or 1, except the Template:Cmd command. Template:IN, success count is an integer between 0 to 2,147,483,647 (both inclusive) related to the command (e.g., the number of players affected by the command, the number of blocks that were altered, etc.)
Stored valuesTemplate:Only include Template:Cd value and Template:Cd value, which are the values passed by other commands to the Template:Cmd command, when a command is executed by a Template:Cmd command. These two values can be stored to a specified location by the Template:Cd subcommand in the Template:Cmd command. The Template:Cd value is always 0 or 1. The Template:Cd value is an integer (rounded down if not). All commands may yield these two stored values after execution, with only two exceptions: Template:Cmd command itself does not yield these two stored values; Template:Cmd command may not yield these two stored values in certain situation.
Result
After trying to execute a command, it has a certain result. Possible results include "Unparseable", "Failed", "Successful", "Void"Template:Only, "Terminated"Template:Only, and "Error"Template:Only.
- Unparseable
- If the entered command is unable to be parsed in the server side, it is unparseable.
- ErrorTemplate:Only
- If an error occurs with a command, it means that there's a noticeable bug on the command. It may result in unintended side effects, and it jumps out the Template:Cmd command halfway through, causing some branches to not be executed.
- Technically, it means that an exception other than
brigadier.exceptions.CommandSyntaxExceptionis thrown during execution.
- VoidTemplate:Only
- Exclusive to Template:Cmd command. If it is void, the command has no Template:Code or Template:Code value to be stored by Template:Cmd.
- TerminatedTemplate:Only
- Exclusive to Template:Cmd command. When running a Template:Cmd command, if the number of execution branches becomes 0, the command terminates, ending before the last sub-command is executed.
- For example: Template:Cmd in a command block. The command block is not an entity, so it cannot be selected by a Minecraft:target selector. As a result, the command is terminated at Template:Cd.
- Failed and Successful
- If a command is not unparseable, erroring, void, nor terminated, it may be failed or successful.
- If the success count is 0, the command is failed. Otherwise, the command is successful.
- Template:IN, commands that cannot be executed in command blocks have no success count. It is failed when Template:Cmd stores 0, and successful when Template:Cmd stores 1.
- Template:IN, if the command cannot be executed in command blocks or scripts, it still has a success count, but it cannot be obtained.
- Note that when we say that a command is failed or successful, it must not be unparseable, error, void, or terminated. Though when being unparseable, error, void or terminated, the success count is 0, it is not considered as being failed nor successful.
- Note that not all "successful" commands actually do something, and not all "failed" commands fail to do something useful.
List of commands
The tables below will summarize all commands.
Available in Java Edition
Debugging commands
Debugging commands are not accessible by default, but can be enabled using Minecraft:debug properties.
Available in Bedrock Edition and Minecraft Education
Hidden commands
Template:Exclusive These commands are unavailable in general cases. Most of them can be accessed with a Websocket Server, NPC, the Scripting API or cheatsTemplate:Only. Note: You can easily check if a command is still in the game by typing Template:Cmd into a server console, or the ingame chat. If you do so, and it says Syntax error, then the command does not exist. If it either gives help on the command or says unknown command, then it is still in the game - for example, the command Template:Cmd will return Template:Code, while the command Template:Cmd will return Template:Code.
Removed commands
Removed from Java Edition
Removed from Bedrock Edition or Minecraft Education
Developer commands
Template:Main Template:Exclusive Developer commands are only enabled in internal development builds of Bedrock Edition, and are not normally accessible in release versions.
Agent commands
Template:Exclusive Superseded by Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
- Template:Cmd
Joke commands
Template:Exclusive These commands only exist in April Fools' Day joke versions of the game.
History
Template:See also Template:Info needed section
Command additions and changes
Java Edition
Bedrock Edition
April Fools commands
Issues
See also
References
External links
Template:Navbox commands Template:Navbox Java Edition technical Template:Navbox Bedrock Edition Template:Mojang featured
Minecraft:de:Befehl Minecraft:es:Comandos Minecraft:fr:Commandes Minecraft:hu:Szerverparancsok Minecraft:it:Comandi Minecraft:ja:コマンド Minecraft:ko:명령어 Minecraft:lzh:令 Minecraft:nl:Opdrachten Minecraft:pl:Polecenia Minecraft:pt:Comandos Minecraft:ru:Команды консоли Minecraft:th:คำสั่ง Minecraft:tr:Komutlar Minecraft:uk:Команди консолі Minecraft:zh:命令