Minecraft Wiki
Advertisement

ability[]

player: target: actor

Must be a player name or a target selector.
Specifies the target to grant/revoke player ability. Must be a player name or target selector.

ability: Ability: string

Specifies the player ability.
These abilities are:
  • worldbuilder gives the selector the ability to become a world builder.
  • mayfly lets the selector fly.
  • mute mutes the selector. If they chat, no-one can hear (or see) them.

value: Boolean: bool

Must be a boolean (either true or false).
Specifies the value to set the ability to.

CommandTriggerBedrock Edition
anythe arguments are not specified correctly Failed
if player: target fails to resolve to one or more online players
OtherwiseSets or queries the player's ability.

CommandEditionSituationSuccess Count
anyBedrock EditionOn fail0
On successHow many players are modified or queried.

advancement[]

Template:Literal

Specifies whether to add or remove the to-be-specified advancement(s).

<targets>: entity

Must be a player name, a target selector or a UUID. And the target selector must be of player type.
Specifies one player or more.

<advancement>: resource_location

Must be a resource location which will be resolved during command execution into unregistered content or client-side content.
Specifies a valid namespaced id of the advancement to target.

<criterion>: string

Must be a string.
Specifies a valid criterion of the advancement to manipulate.
The command defaults to the entire advancement.
If specified, the command refers to merely the criterion and not the entire advancement.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if <entity> fails to resolve to one or more online players Failed
there's no advancement/criterion added to/remove from any player Error
... only <advancement> <criterion>the <criterion> is invalid for the <advancement>
anyOtherwisegrants or removes the specified advancement(s) or criterion(s) to the player(s).

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn exception0unchangedunchanged
On success11the total number of advancements/criterions added to/removed from each player.

attribute[]

<target>: entity

Must be a player name, a target selector or a UUID. And the target selector must be in single type.
The entity that the attribute is applied to. Only players, armor stands, and mobs have attributes.

<attribute>: resource_location

Must be a resource location which will be resolved during command execution into unregistered content or client-side content.
Specifies the attribute.

<scale>: double

Must be a Double-precision floating-point format number.
The number the value is multiplied with before being returned.

<uuid>: uuid

Must be a UUID in the hyphenated hexadecimal format. Allowed characters include:
  • -
  • A-F
  • a-f
  • 0-9
Specifies the modifier. Modifiers with the same UUID do not stack.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
<targets> fails to resolve to a player, a armor stand, or a mob Failed
... modifier add ...the modifier is already present
anyOtherwiseChanges or returns the attribute value.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
... get [<scale>]On success11The attribute value (multiplied by <scale>).
... base get [<scale>]On success11The attribute base value (multiplied by <scale>).
... modifier value get <uuid> [<scale>]On success11The modifier value (multiplied by <scale>).
... base set ...
... modifier add ...
... modifier remove ...
On success111


ban[]

<targets>: game_profile

Must be a collection of game profiles (player profiles), which can be a player name (must be a real one if the server is in online mode), or a player-type target selector.
Specifies the player profile(s) to be added to the blacklist.

<reason>: message

Must be a plain text. Can include spaces as well as target selectors. The game replaces entity selectors in the message with the list of selected entities' names, which is formatted as "name1 and name2" for two entities, or "name1, name2, ... and namen" for n entities.
Message to display to the banned player, to other operators, and in the server logs. If unspecified, defaults to Banned by an operator.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if the target selector fails to resolve to one or more online players Failed
does not add any new player profile to blacklist
Otherwisethe player profile(s) is added to the server blacklist,
which prevents anyone from connecting to the server with uuids of these profiles.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success11the number of new player names added to blacklist.

ban-ip[]

<targets>: string

Must be a string. And it must be in a single word (Allowed characters include: -, +, ., _, A-Z, a-z, and 0-9).
Specifies the IP address to be added to the blacklist. Can also be a name of a online player, which represents the IP of that player.

<reason>: message

Must be a plain text. Can include spaces as well as target selectors. The game replaces entity selectors in the message with the list of selected entities' names, which is formatted as "name1 and name2" for two entities, or "name1, name2, ... and namen" for n entities.
Message to display to the banned player, to other operators, and in the server logs. If unspecified, defaults to Banned by an operator.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
does not add any new IP address to blacklist Failed
Otherwisethe narrowly-specified address or that of the named, online player is added to the server blacklist,
preventing anyone from connecting to the server from that address.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success11the number of online players that connecting with the specified IP.

banlist[]

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn success11the number of entries in the specified list.

bossbar[]

<id>: resource_location

Must be a resource location which will be resolved during command execution into unregistered content or client-side content.
Specifies a unique boss bar.

<name>: component

Must be a raw JSON text.
The display name of the boss bar.

<max>: integer

Must be a 32-bit integer number. And it must be between 1 and 2147483647 (inclusive).
The boss bar's maximum value.

<targets>: entity

Must be a player name, a target selector or a UUID. And the target selector must be of player type.
The set of players to whom the bar is visible

<value>: integer

Must be a 32-bit integer number. And it must be between 0 and 2147483647 (inclusive).
The boss bar's current value.

<visible>: bool

Must be a boolean (either true or false).
The boss bar's visibility.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
/bossbar set ...
/bossbar remove ...
/bossbar get
if specified boss bar doesn't exist Failed
/bossbar add ...if a boss bar with specified id have already existed
/bossbar set ...if the boss bar's property have already been the same as the specified value
anyOtherwiseCreates, modifies or lists boss bar(s).

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
/bossbar add ...
/bossbar list
/bossbar remove ...
On success11The number of custom bosbars that exist after the command is executed.
Bosbars created by the game (such as the boss bar of the ender dragon) isn't included.
/bossbar get <id> max
/bossbar set <id> max
On success11The boss bar's maximum value after the command is executed.
/bossbar get <id> value
/bossbar set <id> value
On success11The boss bar's value after the command is executed.
/bossbar get <id> players
/bossbar set <id> players
On success11The number of players to whom the bar is visible after the command is executed.
/bossbar get <id> visibleOn success111 if the boss bar is visible; otherwise 0.
/bossbar set <id> color
/bossbar set <id> name
/bossbar set <id> style
/bossbar set <id> visible
On success110

data[]

<targetPos>: block_pos

Must be a block position composed of <x>, <y> and <z>, each of which must be an integer or a tilde and caret notation.
The position of the target block entity whose NBT is to be operated on.

<target>: entity (in entity <target> mode)

Must be a player name, a target selector or a UUID. And the target selector must be in single type.
Speciafies an entity whose NBT is to be operated on.

<target>: resource_location (in storage <target> mode)

Must be a resource location which will be resolved during command execution into unregistered content or client-side content.
Specifies a storage to be operated on.

<path>: nbt_path

Must be an NBT path.
Specifies the NBT to retrieve or remove.

<scale>: double

Must be a Double-precision floating-point format number.
Scalar for the command's return value.

<nbt>: nbt_compound_tag

Must be a Double-precision floating-point format number.
Specifies a compound tag to be merged into somewhere.

<targetPath>: nbt_path

Must be an NBT path.
Specifies target NBT to modify.

<index>: integer

Must be a 32-bit integer number.
Specifies an item's index within a list.

<sourcePos>: block_pos

Must be a block position composed of <x>, <y> and <z>, each of which must be an integer or a tilde and caret notation.
The position of the target block entity whose NBT is to be used.

<sourceEntity>: entity

Must be a player name, a target selector or a UUID. And the target selector must be in single type.
Speciafies an entity whose NBT is to be used by modify.

<sourceStorage>: resource_location

Must be a resource location which will be resolved during command execution into unregistered content or client-side content.
Specifies a storage to be used by modify.

<sourcePath>: nbt_path

Must be an NBT path.
Specifies the source NBT to be used by modify.

<value>: nbt_tag

Must be an NBT tag of any type in SNBT format.
Value used in modifying the target NBT. Should match in data type.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if <targetPos> is unloaded or out of the world Failed
if the block at <targetPos> is not a block entity
if <target> (in entity <target> mode) fails to resolve to an entity (named player must be online)
/data get ...if more than one tag is got
/data get ... <path>if <path> does not exist
/data get ... <path> <scale>if the tag obtained is not a numeric tag
/data merge ...
/data remove ...
/data modify ...
if nothing is changed
try to edit player's data
/data remove ...if <path> is {}(the root tag)
/data modify ... from block ...if <sourcePos> is unloaded or out of the world
if the block at <sourcePos> is not a block entity
/data modify ... from entity ...if <sourceEntity> fails to resolve to an entity (named player must be online)
/data modify ... from ... <sourcePath>if <sourcePath> does not exist
/data modify ... append ...
/data modify ... insert <index> ...
/data modify ... prepend ...
if the target tag isn't a list or array
if source data isn't of an item type appropriate for the list
/data modify ... insert <index> ...if the index is invalid
/data modify ... merge ...if the target path does not specify a compound tag
if the source data is not a compound tag
anyOtherwiseGet, merge, modify, and remove NBT data.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
/data get ...On success111
/data get ... <path>if a numeric tag is got11the value obtained after rounding down[1]
if a list or array tag is got11The number of elements in this list or array
if a string tag is got11The length of the string
if a compound tag is got11The number of key-value pairs contained in the compound tag
/data get ... <path> <scale>On success11the value obtained multiplied by <scale>, then rounded down[2]
/data merge ...On success111
/data remove ...On success111
/data modify ... append ...
/data modify ... insert <index> ...
/data modify ... prepend ...
On success11the number of new elements added into the list or array
/data modify ... set ...On success11the number of target tags that was successfully modified
/data modify ... merge ...On success11the number of target compound tags that was successfully modified


datapack[]

<name>: string

Must be a string. And it must be a quotable phrase, which is either a single word (allowed characters: -, +, ., _, A-Z, a-z, and 0-9) or a double-quoted string.
Specifies the name of the data pack.

<existing>: string

Must be a string. And it must be a quotable phrase, which is either a single word (allowed characters: -, +, ., _, A-Z, a-z, and 0-9) or a double-quoted string.
Specifies the name of an existing enabled data pack.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
/datapack enable ...
/datapack disable ...
if <name> is not a valid data pack Failed
if the data pack have already been enabled/disabled
/datapack enable ... <existing>if <existing> is not an existing enabled data pack
anyOtherwiseDisable/enable/list datapack(s).

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
/datapack enable ...
/datapack disable ...
On success11The number of packs that are loaded after executing.
/datapack list [available|enabled]On success11the number of data packs that are listed

debug[]

CommandTriggerJava Edition
/debug startif a debug profiling session have already been started Failed
/debug stopif there's no debug profiling session running.
anyOtherwiseStart/stop the debug profiling, or get more detailed information.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
/debug startOn success110
/debug startOn success11the average tps (ticks per second) during debug profiling
/debug reportfailed to save debug dump110
/debug reportsuccessful to save debug dump111

defaultgamemode[]

CommandTriggerJava Edition
anyOtherwiseSets the default game mode.
New players who join the world are put into the default game mode.
In multiplayer, if force-gamemode in the server.properties file is true, set all online players to the specified game mode.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionIf in multiplayer, and force-gamemode in the server.properties file is true11the number of online players whose game mode is changed
Java EditionOtherwise110

forceload[]

<from>: column_pos and <to>: column_pos

Must be a column coordinates composed of <x> and <z>, each of which must be an integer or tilde notation.
Specifies the selected chunks.

<pos>: column_pos

Must be a column coordinates composed of <x> and <z>, each of which must be an integer or tilde notation.
Specifies the chunk to query.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
/forceload add ...if more than 256 chunks are specified Failed
if there's a specified chunk that is out of the world
/forceload add ...if all specified chunks have already been forced to be loaded
/forceload remove <from> [<to>]if none of specified chunks have been forced to be loaded
/forceload query <pos>if the specified chunk hasn't been forced to be loaded
anyOtherwiseForce/unfoced chunks to load constantly
Or list/query the forceloaded chunk(s).

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
/forceload add ...On success11the number of forceloaded chunks that is newly added.
/forceload remove <from> [<to>]On success11the number of forceloaded chunks that is successfully removed.
/forceload remove allOn success110
/forceload queryOn success11The number of forceloaded blocks in the current dimension.
/forceload query <pos>On success111

locatebiome[]

todo

loot[]

todo

pardon[]

<targets>: game_profile

Must be a collection of game profiles (player profiles), which can be a player name (must be a real one if the server is in online mode), or a player-type target selector.
Specifies the name to remove from the banlist.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if target selector fails to resolve to one or more online players Failed
if all specified player names have not been banned
OtherwiseRemove the name(s) from the banlist,
allowing anyone to connect to the server by that name.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success11the number of player names that is successfully unbanned.

pardon-ip[]

<target>: string

Must be a string. And it must be in a single word (Allowed characters include: -, +, ., _, A-Z, a-z, and 0-9).
Specifies the IP address to remove from the banlist. Should be a valid IP address.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if <string> fails to resolve as a IP Failed
if all specified IPs have not been banned
OtherwiseRemove the IP address(es) from the banlist,
allowing anyone to connect to the server from that IP address.


CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success111

publish[]

<port>: integer

Must be a 32-bit integer number. And it must be between 0 and 65535 (inclusive).
The port to host on. If not specified, a random port above 1024 is chosen.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if the world is already published to LAN Failed
if the specified port could not be bound (e.g. a reserved port, or already in use by another application).
OtherwiseOpen the world to the local network.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success11the port allocated for this LAN world.

recipe[]

<target>: entity

Must be a player name, a target selector or a UUID. And the target selector must be of player type.
Speciafies the player(s) to give or take the recipe from.

<recipe>: resource_location

Must be a resource location which will be resolved during command execution into unregistered content or client-side content.
Speciafies a recipe to give or take.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if <target> fails to resolve to one or more online players Failed
does not give or take any recipe to/from any player
OtherwiseUnlock or take recipes for players.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success11the total number of recipes given to/taken from each player.

save-all[]

Always successful. (may be a bug)

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn success111

save-off[]

CommandTriggerJava Edition
anyif automatic saving have already been turned off Failed
OtherwiseTurn off automatic saving.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success111

save-on[]

CommandTriggerJava Edition
anyif automatic saving have not been turned off Failed
OtherwiseTurn on automatic saving.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success111

schedule[]

Cannot set two schedules to execute the same function at the same game tick. <function>: function (in /schedule function ... mode)

It must be a resource location, which refers to a single function, or one prefixed with a #, which refers to a function tag.
Specify the function to be run.

<time>: time

It must be a single-precision floating point number suffixed with a unit. Units include:
  • d: an in-game day, 24000 gameticks;
  • s: a second, 20 gameticks;
  • t (default and omitable): a single gametick; the default unit.
The time is set to the closest integer tick after unit conversion. For example. .5d is same as 12000 ticks.
Specify the delay time.

<function>: string (in /schedule function ... mode)

Must be a string. And it is a greedy phrase (taking the rest of the command as the string argument).
Specify the function to be cleared. Should be a namespaced ID (minecraft: cannot be omitted) or a function tag(minecraft: cannot be omitted).

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
/schedule function ...if is 0 Failed
if specified <function> does not exist
/schedule clear ...if schedule for <function> can't be found
anyOtherwiseSet or clear schedule(s) of function.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
/schedule function ...On success11The game tick the function is to execute at modulo 2147483647
/schedule clear ...On success11the number of schedules that are cleared.

seed[]

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn success11the long type seed casted to a 32-bit integer

setidletimeout[]

<minutes>: integer

Must be a 32-bit integer number. And it must be between 0 and 2147483647 (inclusive).
Specifies the idle kick timer.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn success11the specified <minutes>

spectate[]

<target>: entity

Must be a player name, a target selector or a UUID. And the target selector must be in single type.
Specifies the target to be spectated.

<player>: entity

Must be a player name, a target selector or a UUID. And the target selector must be of single-player type.
Specifies the spectating player.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if <target> fails to resolve to an entity (named player must be online) Failed
if <player> fails to resolve to a online player
if <player> is not specified and the command executor is not a player.
if <player> and <target> are the same.
if <player> isn't in spectator mode.
OtherwiseCause a player to spectate another entity or stop spectating.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success111

stop[]

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn success111

team[]

todo

teammsg[]

<message>: message

Must be a plain text. Can include spaces as well as target selectors. The game replaces entity selectors in the message with the list of selected entities' names, which is formatted as "name1 and name2" for two entities, or "name1, name2, ... and namen" for n entities.
Specifies the message to send to team.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if <target> fails to resolve to an entity (named player must be online) Failed
if executor is not an entity
if executor is not on any team
OtherwiseSend message to only player(s) on the same team.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success11the number of players on the same team

trigger[]

<objective> <objective>: objective

It must be a valid scoreboard objective name.
An enabled scoreboard objective with the "trigger" criterion.

<value>: integer

Must be a 32-bit integer number.
Specifies the value to be set to or added to the objective.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if the objective does not exsit Failed
if the objective isn't the "trigger" type
if executor is not a player
if executor isn't on the scoreboard objective.
if the objective has not been "enabled" for the player
OtherwiseChange the value of the objective and the objective is un-enabled for the player.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success11The score of the objective of the player after the command is executed.

whitelist[]

<targets>: game_profile

Must be a collection of game profiles (player profiles), which can be a player name (must be a real one if the server is in online mode), or a player-type target selector.
Specifies the player name(s) to be added to or removed from the whitelist. Does not have to be online or even real.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
/whitelist onif the whitelist is already enabled Failed
/whitelist offif the whitelist is already disabled
if the target selector fails to resolve to one or more online players
/whitelist add <targets>does not add any new player name to the whitelist
/whitelist remove <targets>if all specified names is not in the whitelist
anyOtherwiseManage the whitelist.

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
/whitelist on
/whitelist off
/whitelist reload
On success111
/whitelist listOn success11the number of players in the list.
/whitelist add <targets>On success11the number of new player names added to the whitelist.
/whitelist add <targets>On success11the number of player names removed from the whitelist.

worldborder[]

<distance>: float (in add mode)

Must be a Single-precision floating-point format number. And it must be between -60,000,000 and 60,000,000 (inclusive).
Specifies the number of blocks to add to the world border diameter.

<time>: integer (in add and set mode)

Must be a 32-bit integer number. And it must be between 0 and 2147483647 (inclusive).
Specifies the number of seconds it should take for the world border to move from its current diameter to the new diameter. If not specified, defaults to 0.

<pos>: vec2

Must be a two-dimensional coordinates with floating-point number elements. Accepts tilde and caret notations.
Specifies the horizontal coordinates of the world border's center.

<damagePerBlock>: float

Must be a Single-precision floating-point format number. And it must be greater than or equal to 0.0.
Specifies the damage a player takes per second per block past the world border buffer. For example, if <damagePerBlock> is 0.1, a player 5 blocks outside the world border buffer takes 0.5 damage per second (damage less than half a heart might not change the visual health display, but still accumulates). Initially set to 0.2.

<distance>: float (in damage buffer mode)

Must be a Single-precision floating-point format number. And it must be greater than or equal to 0.0.
Specifies the distance outside the world buffer a player must be before they start taking damage. Initially set to 5.0.

<distance>: float (in set mode)

Must be a Single-precision floating-point format number. And it must be between -60,000,000 and 60,000,000 (inclusive).
Specifies the new diameter for the world border.

<distance>: integer (in warning distance mode)

Must be a Single-precision floating-point format number. And it must be greater than or equal to 0.
Specifies the distance from the world border at which players begins to see a visual warning of the world border's proximity. Initially set to 5.

<time>: integer (in warning time mode)

Must be a 32-bit integer number. And it must be between 0 and 2147483647 (inclusive).
Specifies the number of seconds that a player begins to see a visual warning before a moving world border passes their position. Initially set to 15.

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
/worldborder add ...
/worldborder set ...
if the size is unchanged Failed
if the new size is less than 1.0 or greater than 60,000,000
/worldborder center ...if the center is unchanged
/worldborder damage amount ...if the damage amount is unchanged
/worldborder damage buffer ...if the damage buffer is unchanged
/worldborder warning distance ...if the warning distance is unchanged
/worldborder warning time ...if the warning time is unchanged
anyOtherwiseManage the world border.

Maximum number of loops have been performed
CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
  1. double n = (double)value
    int output = n < (int)n ? (int)n - 1 :(int)n
  2. double n = (double)value * scale
    int output = n < (int)n ? (int)n - 1 :(int)n
Advertisement