Argument types
This feature is exclusive to Java Edition. |
Contents
- 1 List of argument types
- 1.1 brigadier:bool
- 1.2 brigadier:double
- 1.3 brigadier:float
- 1.4 brigadier:integer
- 1.5 brigadier:long
- 1.6 brigadier:string
- 1.7 minecraft:block_pos
- 1.8 minecraft:block_predicate
- 1.9 minecraft:block_state
- 1.10 minecraft:color
- 1.11 minecraft:column_pos
- 1.12 minecraft:component
- 1.13 minecraft:dimension
- 1.14 minecraft:entity
- 1.15 minecraft:entity_anchor
- 1.16 minecraft:entity_summon
- 1.17 minecraft:float_range
- 1.18 minecraft:function
- 1.19 minecraft:game_profile
- 1.20 minecraft:int_range
- 1.21 minecraft:item_enchantment
- 1.22 minecraft:item_predicate
- 1.23 minecraft:item_slot
- 1.24 minecraft:item_stack
- 1.25 minecraft:message
- 1.26 minecraft:mob_effect
- 1.27 minecraft:nbt_compound_tag
- 1.28 minecraft:nbt_path
- 1.29 minecraft:nbt_tag
- 1.30 minecraft:objective
- 1.31 minecraft:objective_criteria
- 1.32 minecraft:operation
- 1.33 minecraft:particle
- 1.34 minecraft:resource_location
- 1.35 minecraft:rotation
- 1.36 minecraft:score_holder
- 1.37 minecraft:scoreboard_slot
- 1.38 minecraft:swizzle
- 1.39 minecraft:team
- 1.40 minecraft:time
- 1.41 minecraft:vec2
- 1.42 minecraft:vec3
This page contains a list of all argument types in Java Edition.
List of argument types[edit]
brigadier:bool[edit]
Represents a boolean.
Must be either true
or false
.
Official examples
true
false
brigadier:double[edit]
Represents a Double-precision floating-point format number argument.
Each double argument has 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[edit]
Represents a Single-precision floating-point format number argument.
Each float argument type has 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[edit]
Represents a 32-bit integer.
Each integer argument type has 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[edit]
Represents a 64-bit long.
Note: Although a long argument type is present in brigadier, it is not used by Minecraft.
Each long argument type has 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[edit]
Represents 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:block_pos[edit]
Represents a block position.
Accepts tilde and caret notations.
Official examples
0 0 0
~ ~ ~
^ ^ ^
^1 ^ ^-5
~0.5 ~1 ~-5
minecraft:block_predicate[edit]
Represents a predicate for a block in a world.
Checks its block state properties and NBT data (for block entities if present). Accepts block tags for block type checking.
Official examples
stone
minecraft:stone
stone[foo=bar]
#stone
#stone[foo=bar]{baz:nbt}
minecraft:block_state[edit]
Represents a predicate for a block state.
Checks for an exact match for a block state and the block entity NBT must include the NBT given.
Official examples
stone
minecraft:stone
stone[foo=bar]
foo{bar:baz}
minecraft:color[edit]
Represents a color used in chat formatting.
Can be reset
or one of the 16 chat colors.
Official examples
red
green
minecraft:column_pos[edit]
Represents a column position.
Accepts tilde and caret notations.
Official examples
0 0
~ ~
~1 ~-2
^ ^
^-1 ^0
minecraft:component[edit]
Represents a raw JSON text.
Official examples
"hello world"
""
"{"text":"hello world"}"
[""]
minecraft:dimension[edit]
Represents a Dimension.
Accepts a valid namespaced ID for a dimension.
Official examples
minecraft:overworld
minecraft:the_nether
minecraft:entity[edit]
Represents a target selector.
Accepts player names, UUIDs or target selectors variables. 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[edit]
Represents the set of positions/rotations of an entity for tilde and caret notations to interpret.
Only accepts eyes
or feet
.
- Eyes: Tilde notations will refer to the eye position and caret notations will modify the pitch and yaw[verify]
- Feet: The default behavior; tilde notations refer to the feet position.
Official examples
eyes
feet
minecraft:entity_summon[edit]
Represents an entity type that can be summoned.
Accepts an entity type ID. The entity type must be summonable.
Official examples
minecraft:pig
cow
minecraft:float_range[edit]
Represents a range acceptable for float values.
General Format:
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.2
0
-5.4
-100.76..
..100
minecraft:function[edit]
Represents one or a collection of functions.
Can accept a namespaced ID, which refers to single functions, or one prefixed with a #
, which refers to single tags.
Official examples
foo
foo:bar
#foo
minecraft:game_profile[edit]
Represents a collection of game profiles (player profiles).
It is backed by a target selector that only selects players.
Official examples
Player
0123
dd12be42-52a9-4a91-a8a1-11c01849e498
@e
minecraft:int_range[edit]
Represents a range acceptable for integer values.
General Format:
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_enchantment[edit]
Represents an enchantment.
Accepts a namespaced ID that refers to a valid enchantment.
Official examples
unbreaking
silk_touch
minecraft:item_predicate[edit]
Represents a predicate for an item by checking the item type and its NBT data.
Tags are accepted for item type checking. The item NBT data must contain the given NBT data.
Official examples
stick
minecraft:stick
#stick
#stick{foo:bar}
minecraft:item_slot[edit]
Represents a slot in an inventory.
Accepts certain string notations that refer to certain slots in inventories. The slot reference will be mapped to an integer.
Slot Valid slot_number Mapped index armor.chest
102 armor.feet
100 armor.head
103 armor.legs
101 weapon
98 weapon.mainhand
98 weapon.offhand
99 container.slot_number
0–53 0-53 enderchest.slot_number
0–26 200-226 hotbar.slot_number
0–8 0-8 inventory.slot_number
0–26 9-35 horse.saddle
400 horse.chest
499 horse.armor
401 horse.slot_number
0–14 500-514 villager.slot_number
0–7 300-307
Then, restrictions will be applied to mapped indexes.
Official examples
container.5
12
weapon
minecraft:item_stack[edit]
Represents an item stack.
Does not accept tags. When used to check item matching, the NBT of the item checked against must include the NBT provided by this item.
Official examples
stick
minecraft:stick
stick{foo:bar}
minecraft:message[edit]
Represents a message with changeable entity reference.
Accepts a string with spaces and replaces entity selectors in the message with selected entities' names.
Official examples
Hello world!
foo
@e
Hello @p :)
minecraft:mob_effect[edit]
Represents a status effect.
Accepts a namespaced ID that refers to a valid status effect.
Official examples
spooky
effect
minecraft:nbt_compound_tag[edit]
Represents a compound NBT in SNBT format.
Official examples
{}
{foo:bar}
minecraft:nbt_path[edit]
Represents an NBT/data path.
Format:
.
: Directory separator.foo.bar
means foo's child called bar.[]
: Array/list index indicator.foo[0]
means element 0 of foo;bar[-1]
means the last element of bar.""
: Escapes.
, etc. in directory names."quoted strings"
may be used if a name of a key needs to be escaped.
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[edit]
Represents an NBT tag in SNBT format.
Official examples
0
0b
0l
0.0
"foo"
{foo:bar}
minecraft:objective[edit]
Represents a scoreboard objective.
Additionally it enforces the 16-character name length limit.
Official examples
foo
*
012
minecraft:objective_criteria[edit]
Represents a scoreboard objective criterion.
They are not referenced with namespaced IDs, even though they are stored by ID in the game.
Official examples
foo
foo.bar.baz
minecraft:foo
minecraft:operation[edit]
Represents arithmetic operators for score comparison, etc.
Valid values include =
(assignment), +=
(addition), -=
(subtraction), *=
(multiplication), /=
(floor division), %=
(floor remainder), <
(choose minimum) and >
(choose maximum).
Official examples
=
>
<
minecraft:particle[edit]
Represents a particle effect.
Accepts a namespaced ID referring to a valid particle followed by particle parameters that are particle-specific.
Official examples
foo
foo:bar
particle with options
minecraft:resource_location[edit]
Represents a namespaced ID.
Accepts a namespaced ID. No other characters allowed, including #
prefix for tags.
Official examples
foo
foo:bar
012
minecraft:rotation[edit]
Represents a rotation (pitch and yaw).
Official examples
0 0
~ ~
~-5 ~5
minecraft:score_holder[edit]
Represents a selection of score holders.
Each score holder argument may specify if it can select only one score holder or multiple score holders. It may be either backed by a target selector, a literal name reference, or *
for all 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[edit]
Represents a scoreboard display slot.
Accepts a string that refers to a display slot.
Official examples
sidebar
foo.bar
minecraft:swizzle[edit]
Represents a collection of axes.
Axes can be declared in any order, but they cannot duplicate.
Official examples
xyz
x
minecraft:team[edit]
Represents a scoreboard team.
Official examples
foo
123
minecraft:time[edit]
Represents a time in Minecraft.
Accepts a single-precision floating point number suffixed with a unit. Units:
d
: an in-game day, 24000 ticks;s
: a second, 20 ticks;t
: a single tick; the default unit.
The time will be set to the closest integer tick after unit conversion. For example. .5d
is same as 12000 ticks.
Official examples
0d
0s
0t
0
minecraft:vec2[edit]
Represents a two-dimensional vector with floating-point number elements.
Accepts tilde and caret notations.
Official examples
0 0
~ ~
0.1 -0.5
~1 ~-2
minecraft:vec3[edit]
Represents a three-dimensional vector 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