Minecraft:Argument types
More actions
This page contains a list of all command argument types. Template:TOC
Java Edition
brigadier:bool
Official examples
brigadier:double
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
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The maximum value of this double argument.
- Template:Nbt: The minimum value of this double argument.
brigadier:float
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
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The maximum value of this float argument.
- Template:Nbt: The minimum value of this float argument.
brigadier:integer
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
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The maximum value of this integer argument.
- Template:Nbt: The minimum value of this integer argument.
brigadier:long
Note: Although a long argument type is present in Minecraft: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
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The maximum value of this long argument.
- Template:Nbt: The minimum value of this long argument.
brigadier: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
Quotable phrase
Greedy phrase
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The type of this string argument. Can be Template:Cd, Template:Cd, or Template:Cd
minecraft:angle
Official examples
minecraft:block_pos
Official examples
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_idis required, and it should be in the format of Minecraft: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
- Minecraft:Block states are inside
[], comma-separated and properties and values must be supported by the block or all blocks in the tag. They are optional.minecraft:stone[doesntexist=purpleberry]is unparseable, becausestonedoesn't havedoesntexist.minecraft:redstone_wire[power=tuesday]is unparseable, becauseredstone_wire'spoweris a number between 0 and 15.
- Data tags are inside
{}. They are optional. - When test for block, only the states provided are tested.
- If a command tests for
redstone_wire[power=15], it checks only power, but ignores other states such asnorth.
- If a command tests for
Official examples
- Template:Cd
- Template:Cd
stone[foo=bar]- Template:Cd
#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_idis required, and it should be in the format of Minecraft:resource location (if namespace isn't set it defaults tominecraft:).- Minecraft:Block states are inside
[], comma-separated and must be properties/values supported by the blocks. They are optional.minecraft:stone[doesntexist=purpleberry]is unparseable, becausestonedoesn't havedoesntexist.minecraft:redstone_wire[power=tuesday]is unparseable, becauseredstone_wire'spoweris a number between 0 and 15.
- Data tags are inside
{}. They are optional. - When placing blocks, any states provided are set, but anything omitted retain their default values, depending on the block type.
- If a command sets
redstone_wire[power=15], it is setpowerto 15, butnorthis a default value (in this case, set tonone).
- If a command sets
Official examples
- Template:Cd
- Template:Cd
stone[foo=bar]foo{bar:baz}
minecraft:color
Official examples
minecraft:column_pos
Official examples
minecraft:component
Official examples
minecraft:dimension
Official examples
minecraft:entity
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
- Template:Cd
- Template:Cd
- Template:Cd
@e[type=foo]- Template:Cd
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The amount of entities that can be selected. Can be Template:Cd or Template:Cd.
- Template:Nbt: The target entity type. Can be Template:Cd or Template:Cd.
minecraft:entity_anchor
Official examples
minecraft:float_range
Official examples
minecraft:function
Official examples
minecraft:game_profile
Official examples
minecraft:gamemode
Official examples
minecraft:heightmap
Official examples
minecraft:int_range
Official examples
minecraft:item_predicate
The format of item_predicate parameters is <item_type>[<list of tests>], in which the list of tests with [] can be omitted when not needed.
<item_type>is required.- It can be in the format of Minecraft:resource location (if namespace isn't set it defaults to
minecraft:). - 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 a wildcard character
*to match any item type.
- It can be in the format of Minecraft:resource location (if namespace isn't set it defaults to
- The list of tests is optional. Test entries are inside
[]and separated with<separator>. - A test entry can be:
<component_id>- Checks if a component exists.<component_id>is the ID of a Minecraft:data component.
<component_id>=<value>- Matches exact value of a component.<value>is a representation of component value in SNBT format.
<predicate_id>~<value>- Checks an item sub-predicate<predicate_id>is the ID of an Minecraft:item sub-predicate.<value>is a representation of item sub-predicate in SNBT format.- Example:
*[damage~{durability:{min:3}}]matches any stack with at least 3 uses left.
minecraft:count- Matches the stack size.count- Always passes.count=<positive_int>- Passes only when the stack size equals to the given value.count~<positive_int>- Passes only when the stack size equals to the given value.count~<int_range>- Passes when the stack size is in the specified range.<int_range>is an SNBT of{min:<min value>, max:<max value>}. Both min and max are optional.
- Example:
*[count~{max:2}]matches any stack with count <= 2.
- Any test entry above can be negated by prefixing with
!.- Example:
*[!count=1]matches any stack that has count other than 1.
- Example:
- A
<separator>can be:|- Logical OR.,- Logical AND.- Unlike most programming languages, the precedence of
|(Logical OR) is higher than,(Logical AND). - That means tests entries joined with | are treated as a single entry to check multiple alternatives.
- Example:
*[!damage|damage=0, count=1]looks for items without damage component or with 0 damage, and its count must be 1.
Official examples
minecraft:item_slot
Official examples
minecraft:item_slots
Official examples
minecraft:item_stack
The format of item_stack is <item_id>[<list of components>], in which the list of components with [] can be omitted when not needed.
<item_id>is required, and it should be in the format of Minecraft:resource location (if namespace isn't set it defaults tominecraft:).- The list of data components is optional. Data component entries are inside
[]separated with,.- A data component entry can be:
<component_id>=<value>- Sets value of a data component.<component_id>is the ID of a Minecraft:data component.<value>is a representation of component value in SNBT format.
!<component_id>- Removes a default data component of the item.
- A data component entry can be:
- When giving items, any components provided are set or removed, but anything omitted retain their default values, depending on the item type.
Official examples
- Template:Cd
- Template:Cd
stick{foo:bar}Template:Sic
minecraft:loot_modifier
Official examples
minecraft:loot_predicate
Official examples
minecraft:loot_table
Official examples
minecraft:message
Official examples
minecraft:nbt_compound_tag
Official examples
{}{foo:bar}
minecraft:nbt_path
An example
- Template:Cd
- Template:Cd
- <the first list element>
- <the second list element>
- Template:Cd
Official examples
- Template:Cd
- Template:Cd
- Template:Cd
- Template:Cd
[]{foo:bar}
minecraft:nbt_tag
Official examples
- Template:Cd
- Template:Cd
- Template:Cd
- Template:Cd
- Template:Cd
{foo:bar}
minecraft:objective
Official examples
minecraft:objective_criteria
Official examples
minecraft:operation
Official examples
minecraft:particle
Official examples
minecraft:resource
Official examples
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The registry ID.
minecraft:resource_key
Official examples
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The registry ID.
minecraft:resource_location
Template:Arg desc It is resolved during command execution into the unregistered content, or sent to the client to resolve into a client-side content.
Official examples
minecraft:resource_or_tag
Official examples
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The registry ID.
minecraft:resource_or_tag_key
Official examples
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The registry ID.
minecraft:resource_selector
Similar to resouce_location except enables the use of wildcard characters.
*- matches from 0 to any number of characters?- matches exactly one character
Official examples
- Template:Cd - matches all IDs
- Template:Cd - matches everthing in the
minecraftnamespace - Template:Cd - matches IDs in the
foldersubfolder in thecustomnamespace that end in_test_followed by one additional character.
minecraft:rotation
Official examples
minecraft:score_holder
Each score holder argument may specify if it can select only one score holder or multiple score holders.
Examples
Official examples
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The amount of score holders that can be selected. Can be Template:Cd or Template:Cd.
minecraft:scoreboard_slot
Official examples
minecraft:style
Official examples
minecraft:swizzle
Official examples
minecraft:team
Official examples
minecraft:template_mirror
Official examples
minecraft:template_rotation
Official examples
minecraft:time
Official examples
JSON properties in command syntax output
- Template:Nbt: The root properties object.
- Template:Nbt: The minimum time in game ticks.
minecraft:uuid
Official examples
minecraft:vec2
Official examples
minecraft:vec3
Official examples
Removed
minecraft:entity_summon
Official examples
minecraft:item_enchantment
Official examples
minecraft:mob_effect
Official examples
Bedrock Edition
BlockStateCommandParam
Also known as BLOCK_STATE_ARRAY.
CommandCompareOperator
Also known as COMPAREOPERATOR.
CommandFilePath
Also known as PATHCOMMAND.
CommandIntegerRange
Also known as FULLINTEGERRANGE.
CommandMessage
Also known as MESSAGE_ROOT.
CommandOperator
Also known as OPERATOR.
CommandPosition
Also known as POSITION.
CommandPositionFloat
Also known as POSITION_FLOAT.
CommandRawText
Also known as RAWTEXT.
Template:Arg desc Template:AnchorTemplate:Anchor
CommandSelector<Actor> and CommandSelector<Player>
Also known as SELECTION.
CommandSelector<Actor> is used to specify entities. Template:Arg desc
CommandSelector<Player> is used to specify players. Template:Arg desc
CommandWildcardInt
Also known as WILDCARDINT.
Must be a 32-bit integer, or an asterisk (Template:Cd) to represent MIN_INT(-2,147,483,648),
float
Also known as VAL.
int
Also known as INT.
Json::Value
Also known as JSON_OBJECT.
RelativeFloat
Also known as RVAL.
Template:Arg desc Template:Anchor
std::basic_string
Also known as ID.
Template:Arg desc Template:Anchor
std::unique_ptr<Command>
Also known as SLASHCOMMAND.
Represents a complete command.
WildcardCommandSelector<Actor>
Also known as WILDCARDSELECTION.
Template:Arg desc Template:Anchor
Enum
Must be an unquoted string without space.
History
References
<references/>
Minecraft:fr:Types d'arguments Minecraft:ja:引数の型 Minecraft:lzh:附項之類 Minecraft:pt:Tipos de argumentos Minecraft:ru:Типы аргументов Minecraft:zh:参数类型