This page contains a list of all command argument types.
Java Edition[]
brigadier:bool[]
Must be a boolean (either true
or false
).
Official examples
true
false
brigadier:double[]
Must be a Double-precision floating-point format number.
Each double argument may have a custom minimum and maximum value.
Precision varies throughout number line; the maximum absolute value is about 1.8*10308.
Official examples
0
1.2
.5
-1
-.5
-1234.56
JSON properties in command syntax output
- properties: The root properties object.
- max: The maximum value of this double argument.
- min: The minimum value of this double argument.
brigadier:float[]
Must be a Single-precision floating-point format number.
Each float argument type may have a custom minimum and maximum value.
Precision varies throughout number line; the maximum absolute value is about 3.4*1038.
Official examples
0
1.2
.5
-1
-.5
-1234.56
JSON properties in command syntax output
- properties: The root properties object.
- max: The maximum value of this float argument.
- min: The minimum value of this float argument.
brigadier:integer[]
Must be a 32-bit integer number.
Each integer argument type may have a custom minimum and maximum value.
Maximum range is from −(231) to (231 − 1), or from (−2,147,483,648) to (2,147,483,647).
Official examples
0
123
-123
JSON properties in command syntax output
- properties: The root properties object.
- max: The maximum value of this integer argument.
- min: The minimum value of this integer argument.
brigadier:long[]
Must be a 64-bit long.
Note: Although a long argument type is present in brigadier, it is not used by Minecraft.
Each long argument type may have a custom minimum and maximum value.
Maximum range is from −(263) to (263−1), or from (−9,223,372,036,854,775,808) to (9,223,372,036,854,775,807).
Official examples
0
123
-123
JSON properties in command syntax output
- properties: The root properties object.
- max: The maximum value of this long argument.
- min: The minimum value of this long argument.
brigadier:string[]
Must be a string.
Each string argument type can accept either a single word (no spaces), a quotable phrase (either single word or quoted string), or a greedy phrase (taking the rest of the command as the string argument).
Official examples
Single word
word
word_with_underscores
Quotable phrase
"quoted phrase"
word
""
Greedy phrase
word
words with spaces
"and symbols"
JSON properties in command syntax output
- properties: The root properties object.
- type: The type of this string argument. Can be
word
,phrase
, orgreedy
- type: The type of this string argument. Can be
minecraft:angle[]
Must be a yaw angle, measured in degrees with float number. -180.0 for due north, -90.0 for due east, 0.0 for due south, 90.0 for due west, to 179.9 for just west of due north, before wrapping back around to -180.0. Tilde notation can be used to specify a rotation relative to the execution yaw angle.
Official examples
0
~
~-0.5
minecraft: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.
Official examples
0 0 0
~ ~ ~
^ ^ ^
^1 ^ ^-5
~0.5 ~1 ~-5
minecraft:block_predicate[]
The format of block_predicate parameters is block_id[block_states]{data_tags}
, in which block states and data tags can be omitted when they are not needed.
block_id
is required, and it should be in the format of resource location(if namespace isn't set it defaults tominecraft:
).- It can also be the resource location of a block tag prefixed with
#
, such as#minecraft:planks
.
- It can also be the resource location of a block tag prefixed with
- Block states are inside
[]
, comma-separated and must be properties/values supported by the blocks. They are optional.minecraft:stone[doesntexist=purpleberry]
is unparseable, becausestone
doesn't havedoesntexist
.minecraft:redstone_wire[power=tuesday]
is unparseable, becauseredstone_wire
'spower
is a number between 0 and 15.
- Data tags are inside
{}
. It's optional. - When test for block, only the states provided are tested.
- If command tests
redstone_wire[power=15]
, it checks only power, but ignores other states such asnorth
.
- If command tests
Official examples
stone
minecraft:stone
stone[foo=bar]
#stone
#stone[foo=bar]{baz:nbt}
minecraft:block_state[]
The format of block_state parameters is block_id[block_states]{data_tags}
, in which block states and data tags can be omitted when they are not needed.
block_id
is required, and it should be in the format of resource location (if namespace isn't set it defaults tominecraft:
).- Block states are inside
[]
, comma-separated and must be properties/values supported by the blocks. They are optional.minecraft:stone[doesntexist=purpleberry]
is unparseable, becausestone
doesn't havedoesntexist
.minecraft:redstone_wire[power=tuesday]
is unparseable, becauseredstone_wire
'spower
is a number between 0 and 15.
- Data tags are inside
{}
. It's optional. - When placing blocks, any states provided are set, but anything omitted retain their default values, depending on the block type.
- If command sets
redstone_wire[power=15]
, it is setpower
to 15, butnorth
is a default value (in this case, set tonone
).
- If command sets
Official examples
stone
minecraft:stone
stone[foo=bar]
foo{bar:baz}
minecraft:color[]
Must be a team color (reset
or one of the 16 chat colors.)
Official examples
red
green
minecraft:column_pos[]
Must be a column coordinates composed of <x>
and <z>
, each of which must be an integer or tilde notation.
Official examples
0 0
~ ~
~1 ~-2
minecraft:component[]
Must be a raw JSON text.
Official examples
"hello world"
""
{"text":"hello world"}
[""]
minecraft:dimension[]
It must be the resource location, which will be resolved during command execution into a dimension.
Official examples
minecraft:overworld
minecraft:the_nether
minecraft:entity[]
Must be a player name, a target selector or a UUID.
Each entity argument may place limits on the number of entities (single/multiple) selected or the type of entities (player/any entity) selected.
Official examples
Player
0123
@e
@e[type=foo]
dd12be42-52a9-4a91-a8a1-11c01849e498
JSON properties in command syntax output
- properties: The root properties object.
- amount: The amount of entities that can be selected. Can be
single
ormultiple
. - type: The target entity type. Can be
players
orentities
.
- amount: The amount of entities that can be selected. Can be
minecraft:entity_anchor[]
Must be either eyes
or feet
.
Official examples
eyes
feet
minecraft:float_range[]
Must be a range acceptable for float values. (e.g. 0.1
- exact match of 0.1. ..0.1
- less than or equal to 0.1. 0.1..
- more than or equal to 0.1. 0.1..1
- between 0.1 and 1, inclusive.)
Official examples
0..5.2
0
-5.4
-100.76..
..100
minecraft:function[]
It must be a resource location, which refers to a single function, or one prefixed with a #
, which refers to a function tag.
Official examples
foo
foo:bar
#foo
minecraft: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.
Official examples
Player
0123
dd12be42-52a9-4a91-a8a1-11c01849e498
@e
minecraft:gamemode[]
Must be one of the following:
survival
for Survival modecreative
for Creative modeadventure
for Adventure modespectator
for Spectator mode
Note that "hardcore" is not a valid option, as it is technically not a game mode.
Official examples
survival
creative
minecraft:heightmap[]
Must be one of world_surface
, motion_blocking
, motion_blocking_no_leaves
, and ocean_floor
.
Official examples
world_surface
ocean_floor
minecraft:int_range[]
Must be a range acceptable for integer values. (e.g. 0
- exact match of 0. ..0
- less than or equal to 0. 0..
- more than or equal to 0. 0..1
- between 0 and 1, inclusive.)
Official examples
0..5
0
-5
-100..
..100
minecraft:item_predicate[]
The format of item_predicate parameters is item_id{data_tags}
, in which data tags can be omitted when not needed.
item_id
is required, and it should be in the format of resource location (if namespace isn't set it defaults tominecraft:
).- It can also be the resource location of a block tag or item tag with the prefix of
#
, such as#minecraft:planks
.
- It can also be the resource location of a block tag or item tag with the prefix of
- Data tags are inside
{}
. It's optional.- When clear or test for item, only the states provided are tested.
Official examples
stick
minecraft:stick
#stick
#stick{foo:bar}
minecraft:item_slot[]
Must be a string notation that refer to certain slots in the inventory, which consists of "slot type" and optional "slot number", in the format of <slot_type>
or <slot_type>.<slot_number>
. See Slot for details.
Official examples
container.5
12
[sic]weapon
minecraft:item_stack[]
The format of item_stack parameters is item_id{data_tags}
, in which data tags can be omitted when not needed.
item_id
is required, and it should be in the format of resource location (if namespace isn't set it defaults tominecraft:
).- Data tags are inside
{}
. It's optional. - When giving items, any states provided are set, but anything omitted retain their default values, depending on the item type.
Official examples
stick
minecraft:stick
stick{foo:bar}
minecraft: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.
Official examples
Hello world!
foo
@e
Hello @p :)
minecraft:nbt_compound_tag[]
Must be a compound NBT in SNBT format.
Official examples
{}
{foo:bar}
minecraft:nbt_path[]
Must be an NBT path.
An example
foo.bar[0]."A [crazy name]".baz.
foo
bar
- <the first list element>
A [crazy name]
baz
- <the second list element>
- <the first list element>
Official examples
foo
foo.bar
foo[0]
[0]
[]
{foo:bar}
minecraft:nbt_tag[]
Must be an NBT tag of any type in SNBT format.
Official examples
0
0b
0l
0.0
"foo"
{foo:bar}
minecraft:objective[]
It must be a valid scoreboard objective name.
Official examples
foo
*
012
minecraft:objective_criteria[]
Must be a scoreboard objective criterion.
Official examples
foo
foo.bar.baz
minecraft:foo
minecraft:operation[]
Must be an arithmetic operator for /scoreboard
.
Valid values include =
(assignment), +=
(addition), -=
(subtraction), *=
(multiplication), /=
(floor division), %=
(modulus), ><
(swapping), <
(choosing minimum) and >
(choosing maximum).
Official examples
=
>
<
minecraft:particle[]
It must be a resource location of a particle followed by particle parameters that are particle-specific.
block
,block_marker
, andfalling_dust
has a parameter inblock_id[block_state=foo]
format to specify a block, in which block states can be omitted when unneeded. For example:/particle block minecraft:grass_block[snowy=true]
dust
requires three color channel parameters to be set along with the name, representing red, green, and blue, each being a value in the range 0 to 1; and an additional parameter representing size. For example:/particle dust 1.0 0.5 0.5 1.0
creates a pink particle at regular size. If one or more values are greater than 1, the particles change their colors. The greater the values the greater is the range of different colors.dust_color_transition
requires three color channel parameters likedust
representing the start color, a number parameter representing size, and another three color channel parameters representing the end color. For example:/particle dust_color_transition 1.0 0.0 0.0 1.0 0.0 0.0 1.0
creates a particle transitioning from red to blue at regular size.item
requires an item as a parameter in the format ofitem_id{NBT}
, in which NBT can be omitted when unneeded. It appears, however, that NBT values do not change anything in how the particle looks. For example:/particle item minecraft:apple
sculk_charge
requires a float parameter specifying the angle the particle displays at in radians.shriek
requires an int parameter specifying the delay in ticks. For example:/particle shriek 100
creates a shriek particle that doesn't show up until 100 game ticks (5 seconds) in.vibration
requires a position parameter representing the destination, and an integer parameter representing the duration of the move. For example:/particle vibration 5.0 64.0 0.0 200
creates a particle taking 200 ticks moving from the current position to5.0 64.0 0.0
.
Official examples
foo
foo:bar
particle with options
minecraft:resource[]
Must be an existing registered resource location in correct registry.
Official examples
foo
foo:bar
012
JSON properties in command syntax output
- properties: The root properties object.
- registry: The registry ID.
minecraft:resource_key[]
Must be a resource location which will be resolved during command execution into a registry entry in correct registry.
Official examples
foo
foo:bar
012
JSON properties in command syntax output
- properties: The root properties object.
- registry: The registry ID.
minecraft:resource_location[]
Must be a resource location which will be resolved during command execution into unregistered content or client-side content.
Official examples
foo
foo:bar
012
minecraft:resource_or_tag[]
Must be an existing registered resource location or tag in correct registry.
Official examples
foo
foo:bar
012
#skeletons
#minecraft:skeletons
JSON properties in command syntax output
- properties: The root properties object.
- registry: The registry ID.
minecraft:resource_or_tag_key[]
Must be a resource location or a tag, which will be resolved during command execution into an entry or tag in correct registry.
Official examples
foo
foo:bar
012
#skeletons
#minecraft:skeletons
JSON properties in command syntax output
- properties: The root properties object.
- registry: The registry ID.
minecraft:rotation[]
Must be a rotation with double number elements, including yaw and pitch, measured in degrees.
- For the horizontal rotation (yaw), -180.0 for due north, -90.0 for due east, 0.0 for due south, 90.0 for due west, to 179.9 for just west of due north, before wrapping back around to -180.0.
- For the vertical rotation (pitch), -90.0 for straight up to 90.0 for straight down.
Tilde notation can be used to specify a rotation relative to the execution rotation.
Official examples
0 0
~ ~
~-5 ~5
minecraft:score_holder[]
Must be a selection of score holders. It may be either a target selector, a player name, a UUID, or *
for all score holders tracked by the scoreboard. Named player needn't be online, and it even needn't be a real player's name.
Each score holder argument may specify if it can select only one score holder or multiple score holders.
Official examples
Player
0123
*
@e
JSON properties in command syntax output
- properties: The root properties object.
- amount: The amount of score holders that can be selected. Can be
single
ormultiple
.
- amount: The amount of score holders that can be selected. Can be
minecraft:scoreboard_slot[]
Must be a scoreboard display slot.
Official examples
sidebar
foo.bar
minecraft:swizzle[]
Any non-repeating combination of the characters 'x', 'y', and 'z'. Axes can be declared in any order, but they cannot duplicate. (For example, x
, xz
, zyx
, or yz
.)
Official examples
xyz
x
minecraft:team[]
Must be a team name of an unquoted string. Allowed characters include: -
, +
, .
, _
, A
-Z
, a
-z
, and 0
-9
.
Official examples
foo
123
minecraft:template_mirror[]
Must be one of none
, front_back
, and left_right
.
Official examples
none
left_right
minecraft:template_rotation[]
Must be one of none
, clockwise_90
, counterclockwise_90
, and 180
.
Official examples
none
clockwise_90
minecraft: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.
Official examples
0d
0s
0t
0
JSON properties in command syntax output
- properties: The root properties object.
- min: The minimum time in game ticks.
minecraft:uuid[]
Must be a UUID in the hyphenated hexadecimal format. Allowed characters include:
-
A
-F
a
-f
0
-9
Official examples
dd12be42-52a9-4a91-a8a1-11c01849e498
minecraft:vec2[]
Must be a two-dimensional coordinates with floating-point number elements. Accepts tilde and caret notations.
Official examples
0 0
~ ~
0.1 -0.5
~1 ~-2
minecraft:vec3[]
Must be a three-dimensional coordinates with floating-point number elements. Accepts tilde and caret notations.
Official examples
0 0 0
~ ~ ~
^ ^ ^
^1 ^ ^-5
0.1 -0.5 .9
~0.5 ~1 ~-5
Removed[]
minecraft:entity_summon[]
Must be a resource location of a summonable entity type.
Official examples
minecraft:pig
cow
minecraft:item_enchantment[]
Must be an ID of an enchantment.
Official examples
unbreaking
silk_touch
minecraft:mob_effect[]
Must be an ID of a status effect.
Official examples
spooky
effect
Bedrock Edition[]
BlockStateCommandParam[]
Must be a blockstate argument as ["<state1>":<value1>,"<state2>":<value2>,...]
. For example: ["old_leaf_type":"birch","persistent_bit":true]
.
CommandIntegerRange[]
Must be a range acceptable for integer values. (e.g. 0
- exact match of 0. ..0
- less than or equal to 0. 0..
- more than or equal to 0. 0..1
- between 0 and 1, inclusive.)
CommandFilePath[]
It must be of the format path/to/function/file
, which refers to a function located at [behavior_pack]/functions/path/to/function/file.mcfunction
.
CommandMessage[]
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.@here
can be used to mention all players.
CommandOperator[]
Must be an arithmetic operator for /scoreboard
.
Valid values include =
(assignment), +=
(addition), -=
(subtraction), *=
(multiplication), /=
(floor division), %=
(modulus), ><
(swapping), <
(choosing minimum) and >
(choosing maximum).
CommandPosition[]
Must be a three-dimensional coordinates composed of <x>
, <y>
and <z>
, each of which must be a floating-point number or tilde and caret notation.
CommandPositionFloat[]
Must be a three-dimensional coordinates with floating-point number elements. Accepts tilde and caret notations.
CommandRawText[]
It is a greedy phrase string argument (taking the rest of the command as the string argument).
CommandSelector<Actor>[]
Represents entities. Must be a player name or a target selector.
CommandSelector<Player>[]
Represents players. Must be a player name or a target selector.
CommandWildcardInt[]
Must be a 32-bit integer, or a asterisk (*
) to represent MIN_INT(-2,147,483,648),
float[]
Must be a Single-precision floating-point format number.
int[]
Must be a 32-bit integer number.
Json::Value[]
Must be a JSON Object.
RelativeFloat[]
Must be a float or a tilde and caret notation.
std::basic_string[]
Must be a string. And it must be a single word that has no space or a quoted string.
std::unique_ptr<Command>[]
Represents a complete command.
WildcardCommandSelector<Actor>[]
Must be a selection of score holders. It may be either a target selector, a player name, a unique ID of an entity, or *
for all score holders tracked by the scoreboard. Named player needn't be online, and it even needn't be a real player's name.
Enum[]
Must be an unquoted string without space.
History[]
Java Edition | |||||
---|---|---|---|---|---|
1.13 | 17w45a | Command arguments are now handled with Brigadier. | |||
1.14 | 19w08a | Now allows single quotes for strings in commands.[1] | |||
1.16 | 20w17a | Added minecraft:uuid argument type. | |||
1.16.2 | 20w29a | Added angle arguments to /spawnpoint and /setworldspawn , with a argument type that is not registered.[2] | |||
20w30a | Added minecraft:angle argument type.
| ||||
Now /spawnpoint and /setworldspawn use this argument type.[2] | |||||
? | Now minecraft:dimension argument type checks whether the dimension exists during execution instead of parsing. | ||||
1.17 | 20w45a | Now minecraft:angle argument type does not accept NaN or Infinite.[3] | |||
21w10a | Now minecraft:block_pos arguments in /spawnpoint and /setworldspawn require <x> and <z> to be in the range of [-30000000, 30000000), and <y> to be in the range of [-20000000, 20000000) when executing.[4] | ||||
1.18 | 21w37a | Removed 16-character limit in minecraft:objective argument type.[5] | |||
1.18.2 | Pre-release 3 | Added minecraft:resource and minecraft:resource_or_tag argument types.
| |||
Now minecraft:resource_location is used only for pack contents, while minecraft:resource is used for registry entries. | |||||
1.19 | 22w11a | Now minecraft:item_predicate and minecraft:block_predicate require tag to exist when parsing instead of executing.[6] | |||
22w19a | Added minecraft:template_mirror and minecraft:template_rotation argument types. | ||||
1.19.3 | 22w42a | Added minecraft:resource_key and minecraft:resource_or_tag_key argument types, which are used for reloadable registry entries (i.e. registered pack contents).
| |||
Now minecraft:resource and minecraft:resource_or_tag are used only for un-reloadable registry entries. | |||||
Removed minecraft:mob_effect , minecraft:entity_summon and minecraft:item_enchantment argument types. Replaced by minecraft:resource . | |||||
22w45a | Added minecraft:gamemode argument type. | ||||
1.19.4 | 23w03a | Added min property to minecraft:time argument type.[7]
| |||
The min value of minecraft:time is always 0 before this update. | |||||
1.19.4-pre1 | Added minecraft:heightmap argument type. |
References[]
- ↑ "Allow single quote in strings by boq · Pull Request #52" – Mojang/brigadier – GitHub.
- ↑ a b MC-195052 — resolved as "Fixed".
- ↑ MC-198414 — resolved as "Fixed".
- ↑ MC-210408 — resolved as "Fixed".
- ↑ MC-123277 — resolved as "Fixed".
- ↑ MC-124984 — resolved as "Fixed".
- ↑ MC-122595 — resolved as "Fixed".