Minecraft:Argument types: Difference between revisions
More actions
Fix template calls: add MC/ prefix |
Sync: updated from Minecraft |
||
| Line 1: | Line 1: | ||
This page contains a list of all '''command argument types'''. | This page contains a list of all '''command argument types'''. | ||
{{ | {{TOC|right}} | ||
== ''Java Edition'' == | == ''Java Edition'' == | ||
<!-- Note: This list's framework is generated with a Java application that dumps all argument types from the game. The headers and the official examples should be automated and User:Liachmodded will try to publish the software he used to generate this soon. --> | <!-- Note: This list's framework is generated with a Java application that dumps all argument types from the game. The headers and the official examples should be automated and User:Liachmodded will try to publish the software he used to generate this soon. --> | ||
=== brigadier:bool === | === brigadier:bool === | ||
{{ | {{Arg desc|je=bool}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|true}} | ||
* {{ | * {{cd|false}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|double}} | ||
=== brigadier:double === | === brigadier:double === | ||
{{ | {{Arg desc|je=double}} | ||
Each double argument may have a custom minimum and maximum value. | Each double argument may have a custom minimum and maximum value. | ||
| Line 24: | Line 24: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0}} | ||
* {{ | * {{cd|1.2}} | ||
* {{ | * {{cd|.5}} | ||
* {{ | * {{cd|-1}} | ||
* {{ | * {{cd|-.5}} | ||
* {{ | * {{cd|-1234.56}} | ||
</div></div> | </div></div> | ||
| Line 35: | Line 35: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|double|max}}: The maximum value of this double argument. | ||
** {{ | ** {{nbt|double|min}}: The minimum value of this double argument. | ||
</div></div> | </div></div> | ||
=== brigadier:float === | === brigadier:float === | ||
{{ | {{Arg desc|je=float}} | ||
Each float argument type may have a custom minimum and maximum value. | Each float argument type may have a custom minimum and maximum value. | ||
| Line 49: | Line 49: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0}} | ||
* {{ | * {{cd|1.2}} | ||
* {{ | * {{cd|.5}} | ||
* {{ | * {{cd|-1}} | ||
* {{ | * {{cd|-.5}} | ||
* {{ | * {{cd|-1234.56}} | ||
</div></div> | </div></div> | ||
| Line 60: | Line 60: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|float|max}}: The maximum value of this float argument. | ||
** {{ | ** {{nbt|float|min}}: The minimum value of this float argument. | ||
</div></div> | </div></div> | ||
{{ | {{anchor|integer}} | ||
=== brigadier:integer === | === brigadier:integer === | ||
{{ | {{Arg desc|je=integer}} | ||
Each integer argument type may have a custom minimum and maximum value. | Each integer argument type may have a custom minimum and maximum value. | ||
| Line 75: | Line 75: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0}} | ||
* {{ | * {{cd|123}} | ||
* {{ | * {{cd|-123}} | ||
</div></div> | </div></div> | ||
| Line 83: | Line 83: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|int|max}}: The maximum value of this integer argument. | ||
** {{ | ** {{nbt|int|min}}: The minimum value of this integer argument. | ||
</div></div> | </div></div> | ||
{{ | {{anchor|long}} | ||
=== brigadier:long === | === brigadier:long === | ||
{{ | {{Arg desc|je=long}} | ||
Note: Although a long argument type is present in brigadier, it is not used by ''Minecraft''. | 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. | Each long argument type may have a custom minimum and maximum value. | ||
| Line 101: | Line 101: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0}} | ||
* {{ | * {{cd|123}} | ||
* {{ | * {{cd|-123}} | ||
</div></div> | </div></div> | ||
| Line 109: | Line 109: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|long|max}}: The maximum value of this long argument. | ||
** {{ | ** {{nbt|long|min}}: The minimum value of this long argument. | ||
</div></div> | </div></div> | ||
{{ | {{anchor|string}} | ||
=== brigadier:string === | === brigadier:string === | ||
{{ | {{Arg desc|je=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). | 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). | ||
| Line 123: | Line 123: | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
Single word | Single word | ||
* {{ | * {{cd|word}} | ||
* {{ | * {{cd|word_with_underscores}} | ||
Quotable phrase | Quotable phrase | ||
* {{ | * {{cd|"quoted phrase"}} | ||
* {{ | * {{cd|word}} | ||
* {{ | * {{cd|""}} | ||
Greedy phrase | Greedy phrase | ||
* {{ | * {{cd|word}} | ||
* {{ | * {{cd|words with spaces}} | ||
* {{ | * {{cd|"and symbols"}} | ||
</div></div> | </div></div> | ||
| Line 138: | Line 138: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|string|type}}: The type of this string argument. Can be {{cd|word}}, {{cd|phrase}}, or {{cd|greedy}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|angle}} | ||
=== minecraft:angle === | === minecraft:angle === | ||
{{ | {{Arg desc|je=angle}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0}} | ||
* {{ | * {{cd|~}} | ||
* {{ | * {{cd|~-0.5}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|block_pos}} | ||
=== minecraft:block_pos === | === minecraft:block_pos === | ||
{{ | {{Arg desc|je=block_pos}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0 0 0}} | ||
* {{ | * {{cd|~ ~ ~}} | ||
* {{ | * {{cd|^ ^ ^}} | ||
* {{ | * {{cd|^1 ^ ^-5}} | ||
* {{ | * {{cd|~0.5 ~1 ~-5}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|block_predicate}} | ||
=== minecraft:block_predicate === | === minecraft:block_predicate === | ||
<!--{{ | <!--{{Arg desc|je=block_predicate}}--> | ||
The format of block_predicate parameters is <code>''block_id''[''block_states'']{''data_tags''}</code>, in which block states and data tags can be omitted when they are not needed. | The format of block_predicate parameters is <code>''block_id''[''block_states'']{''data_tags''}</code>, in which block states and data tags can be omitted when they are not needed. | ||
* <code>block_id</code> is required, and it should be in the format of resource location(if namespace isn't set it defaults to <code>minecraft:</code>). | * <code>block_id</code> is required, and it should be in the format of [[Minecraft:resource location]](if namespace isn't set it defaults to <code>minecraft:</code>). | ||
** It can also be the resource location of a block tag prefixed with <code>#</code>, such as <code>#minecraft:planks</code>. | ** It can also be the resource location of a [[Minecraft:Tags|block tag]] prefixed with <code>#</code>, such as <code>#minecraft:planks</code>. | ||
* Block | * [[Minecraft:Block state]]s are inside <code>[]</code>, comma-separated and properties and values must be supported by the block or all blocks in the tag. They are optional. | ||
** <code>minecraft:stone[doesntexist=purpleberry]</code> is unparseable, because <code>stone</code> doesn't have <code>doesntexist</code>. | ** <code>minecraft:stone[doesntexist=purpleberry]</code> is unparseable, because <code>stone</code> doesn't have <code>doesntexist</code>. | ||
** <code>minecraft:redstone_wire[power=tuesday]</code> is unparseable, because <code>redstone_wire</code>'s <code>power</code> is a number between 0 and 15. | ** <code>minecraft:redstone_wire[power=tuesday]</code> is unparseable, because <code>redstone_wire</code>'s <code>power</code> is a number between 0 and 15. | ||
* Data tags are inside <code>{}</code>. They are optional. | * [[Minecraft:NBT format|Data tags]] are inside <code>{}</code>. They are optional. | ||
* When test for block, only the states provided are tested. | * When test for block, only the states provided are tested. | ||
** If a command tests for <code>redstone_wire[power=15]</code>, it checks only power, but ignores other states such as <code>north</code>. | ** If a command tests for <code>redstone_wire[power=15]</code>, it checks only power, but ignores other states such as <code>north</code>. | ||
| Line 181: | Line 181: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|stone}} | ||
* {{ | * {{cd|minecraft:stone}} | ||
* <code>stone[foo=bar]</code> | * <code>stone[foo=bar]</code> | ||
* {{ | * {{cd|#stone}} | ||
* <code>#stone[foo=bar]{baz:nbt}</code> | * <code>#stone[foo=bar]{baz:nbt}</code> | ||
</div></div> | </div></div> | ||
{{ | {{anchor|block_state}} | ||
=== minecraft:block_state === | === minecraft:block_state === | ||
<!--{{ | <!--{{Arg desc|je=block_state}}--> | ||
The format of block_state parameters is <code>''block_id''[''block_states'']{''data_tags''}</code>, in which block states and data tags can be omitted when they are not needed. | The format of block_state parameters is <code>''block_id''[''block_states'']{''data_tags''}</code>, in which block states and data tags can be omitted when they are not needed. | ||
* <code>block_id</code> is required, and it should be in the format of resource location (if namespace isn't set it defaults to <code>minecraft:</code>). | * <code>block_id</code> is required, and it should be in the format of [[Minecraft:resource location]] (if namespace isn't set it defaults to <code>minecraft:</code>). | ||
* Block | * [[Minecraft:Block state]]s are inside <code>[]</code>, comma-separated and must be properties/values supported by the blocks. They are optional. | ||
** <code>minecraft:stone[doesntexist=purpleberry]</code> is unparseable, because <code>stone</code> doesn't have <code>doesntexist</code>. | ** <code>minecraft:stone[doesntexist=purpleberry]</code> is unparseable, because <code>stone</code> doesn't have <code>doesntexist</code>. | ||
** <code>minecraft:redstone_wire[power=tuesday]</code> is unparseable, because <code>redstone_wire</code>'s <code>power</code> is a number between 0 and 15. | ** <code>minecraft:redstone_wire[power=tuesday]</code> is unparseable, because <code>redstone_wire</code>'s <code>power</code> is a number between 0 and 15. | ||
* Data tags are inside <code>{}</code>. They are optional. | * [[Minecraft:NBT format|Data tags]] are inside <code>{}</code>. They are optional. | ||
* When placing blocks, any states provided are set, but anything omitted retain their default values, depending on the block type. | * When placing blocks, any states provided are set, but anything omitted retain their default values, depending on the block type. | ||
** If a command sets <code>redstone_wire[power=15]</code>, it is set <code>power</code> to 15, but <code>north</code> is a default value (in this case, set to <code>none</code>). | ** If a command sets <code>redstone_wire[power=15]</code>, it is set <code>power</code> to 15, but <code>north</code> is a default value (in this case, set to <code>none</code>). | ||
| Line 203: | Line 203: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|stone}} | ||
* {{ | * {{cd|minecraft:stone}} | ||
* <code>stone[foo=bar]</code> | * <code>stone[foo=bar]</code> | ||
* <code>foo{bar:baz}</code> | * <code>foo{bar:baz}</code> | ||
</div></div> | </div></div> | ||
{{ | {{anchor|color}} | ||
=== minecraft:color === | === minecraft:color === | ||
{{ | {{Arg desc|je=color}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|red}} | ||
* {{ | * {{cd|green}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|column_pos}} | ||
=== minecraft:column_pos === | === minecraft:column_pos === | ||
{{ | {{Arg desc|je=column_pos}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0 0}} | ||
* {{ | * {{cd|~ ~}} | ||
* {{ | * {{cd|~1 ~-2}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|component}} | ||
=== minecraft:component === | === minecraft:component === | ||
{{ | {{Arg desc|je=component}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|"hello world"}} | ||
* {{ | * {{cd|""}} | ||
* {{cd|{"text":"hello world"} }} | * {{cd|{"text":"hello world"} }} | ||
* {{ | * {{cd|[""]}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|dimension}} | ||
=== minecraft:dimension === | === minecraft:dimension === | ||
{{ | {{Arg desc|je=dimension}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|minecraft:overworld}} | ||
* {{ | * {{cd|minecraft:the_nether}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|entity}} | ||
=== minecraft:entity === | === minecraft:entity === | ||
{{ | {{Arg desc|je=entity}} | ||
Each entity argument may place limits on the number of entities (single/multiple) selected or the type of entities (player/any entity) selected. | Each entity argument may place limits on the number of entities (single/multiple) selected or the type of entities (player/any entity) selected. | ||
| Line 261: | Line 261: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|Player}} | ||
* {{ | * {{cd|0123}} | ||
* {{ | * {{cd|@e}} | ||
* <code>@e[type=foo]</code> | * <code>@e[type=foo]</code> | ||
* {{ | * {{cd|dd12be42-52a9-4a91-a8a1-11c01849e498}} | ||
</div></div> | </div></div> | ||
| Line 271: | Line 271: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|string|amount}}: The amount of entities that can be selected. Can be {{cd|single}} or {{cd|multiple}}. | ||
** {{ | ** {{nbt|string|type}}: The target entity type. Can be {{cd|players}} or {{cd|entities}}. | ||
</div></div> | </div></div> | ||
{{ | {{anchor|entity_anchor}} | ||
=== minecraft:entity_anchor === | === minecraft:entity_anchor === | ||
{{ | {{Arg desc|je=entity_anchor}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|eyes}} | ||
* {{ | * {{cd|feet}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|float_range}} | ||
=== minecraft:float_range === | === minecraft:float_range === | ||
{{ | {{Arg desc|je=float_range}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
| Line 293: | Line 293: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0..5.2}} | ||
* {{ | * {{cd|0}} | ||
* {{ | * {{cd|-5.4}} | ||
* {{ | * {{cd|-100.76..}} | ||
* {{ | * {{cd|..100}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|function}} | ||
=== minecraft:function === | === minecraft:function === | ||
{{ | {{Arg desc|je=function}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|foo:bar}} | ||
* {{ | * {{cd|#foo}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|game_profile}} | ||
=== minecraft:game_profile === | === minecraft:game_profile === | ||
{{ | {{Arg desc|je=game_profile}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|Player}} | ||
* {{ | * {{cd|0123}} | ||
* {{ | * {{cd|dd12be42-52a9-4a91-a8a1-11c01849e498}} | ||
* {{ | * {{cd|@e}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|gamemode}} | ||
=== minecraft:gamemode === | === minecraft:gamemode === | ||
{{ | {{Arg desc|je=gamemode}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|survival}} | ||
* {{ | * {{cd|creative}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|heightmap}} | ||
=== minecraft:heightmap=== | === minecraft:heightmap=== | ||
{{ | {{Arg desc|je=heightmap}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|world_surface}} | ||
* {{ | * {{cd|ocean_floor}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|int_range}} | ||
=== minecraft:int_range === | === minecraft:int_range === | ||
{{ | {{Arg desc|je=int_range}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0..5}} | ||
* {{ | * {{cd|0}} | ||
* {{ | * {{cd|-5}} | ||
* {{ | * {{cd|-100..}} | ||
* {{ | * {{cd|..100}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|item_predicate}} | ||
=== minecraft:item_predicate === | === minecraft:item_predicate === | ||
The format of item_predicate parameters is <code><''item_type''>[<''list of tests''>]</code>, in which the list of tests with <code>[]</code> can be omitted when not needed. | The format of item_predicate parameters is <code><''item_type''>[<''list of tests''>]</code>, in which the list of tests with <code>[]</code> can be omitted when not needed. | ||
* <code><''item_type''></code> is required. | * <code><''item_type''></code> is required. | ||
** It can be in the format of resource location (if namespace isn't set it defaults to <code>minecraft:</code>). | ** It can be in the format of [[Minecraft:resource location]] (if namespace isn't set it defaults to <code>minecraft:</code>). | ||
** It can also be the resource location of a block tag or item tag with the prefix of <code>#</code>, such as <code>#minecraft:planks</code>. | ** It can also be the resource location of a [[Minecraft:Tags|block tag or item tag]] with the prefix of <code>#</code>, such as <code>#minecraft:planks</code>. | ||
** It can also be a wildcard character <code>*</code> to match any item type. | ** It can also be a wildcard character <code>*</code> to match any item type. | ||
* The list of tests is optional. Test entries are inside <code>[]</code> and separated with <code><''separator''></code>. | * The list of tests is optional. Test entries are inside <code>[]</code> and separated with <code><''separator''></code>. | ||
* A test entry can be: | * A test entry can be: | ||
** <code><''component_id''></code> - Checks if a component exists. | ** <code><''component_id''></code> - Checks if a component exists. | ||
*** <code><''component_id''></code> is the ID of a data component. | *** <code><''component_id''></code> is the ID of a [[Minecraft:data component]]. | ||
** <code><''component_id''>=<''value''></code> - Matches exact value of a component. | ** <code><''component_id''>=<''value''></code> - Matches exact value of a component. | ||
*** <code><''value''></code> is a representation of component value in SNBT format. | *** <code><''value''></code> is a representation of component value in SNBT format. | ||
** <code><''predicate_id''>~<''value''></code> - Checks an item sub-predicate | ** <code><''predicate_id''>~<''value''></code> - Checks an item sub-predicate | ||
*** <code><''predicate_id''></code> is the ID of an item sub-predicate. | *** <code><''predicate_id''></code> is the ID of an [[Minecraft:item sub-predicate]]. | ||
*** <code><''value''></code> is a representation of item sub-predicate in SNBT format. | *** <code><''value''></code> is a representation of item sub-predicate in SNBT format. | ||
*** Example: <code>*[damage~{durability:{min:3}}]</code> matches any stack with at least 3 uses left. | *** Example: <code>*[damage~{durability:{min:3}}]</code> matches any stack with at least 3 uses left. | ||
| Line 392: | Line 392: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|stick}} | ||
* {{ | * {{cd|minecraft:stick}} | ||
* {{ | * {{cd|#stick}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|item_slot}} | ||
=== minecraft:item_slot === | === minecraft:item_slot === | ||
{{ | {{Arg desc|je=item_slot}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|container.5}} | ||
* {{ | * {{cd|weapon}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|item_slots}} | ||
=== minecraft:item_slots === | === minecraft:item_slots === | ||
{{ | {{Arg desc|je=item_slots}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|container.*}} | ||
* {{ | * {{cd|container.5}} | ||
* {{ | * {{cd|weapon}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|item_stack}} | ||
=== minecraft:item_stack === | === minecraft:item_stack === | ||
The format of item_stack is <code><''item_id''>[<''list of components''>]</code>, in which the list of components with <code>[]</code> can be omitted when not needed. | The format of item_stack is <code><''item_id''>[<''list of components''>]</code>, in which the list of components with <code>[]</code> can be omitted when not needed. | ||
* <code><''item_id''></code> is required, and it should be in the format of resource location (if namespace isn't set it defaults to <code>minecraft:</code>). | * <code><''item_id''></code> is required, and it should be in the format of [[Minecraft:resource location]] (if namespace isn't set it defaults to <code>minecraft:</code>). | ||
* The list of data components is optional. Data component entries are inside <code>[]</code> separated with <code>,</code>. | * The list of [[Minecraft:Data component format|data components]] is optional. Data component entries are inside <code>[]</code> separated with <code>,</code>. | ||
** A data component entry can be: | ** A data component entry can be: | ||
*** <code><''component_id''>=<''value''></code> - Sets value of a data component. | *** <code><''component_id''>=<''value''></code> - Sets value of a data component. | ||
**** <code><''component_id''></code> is the ID of a data component. | **** <code><''component_id''></code> is the ID of a [[Minecraft:data component]]. | ||
**** <code><''value''></code> is a representation of component value in SNBT format. | **** <code><''value''></code> is a representation of component value in SNBT format. | ||
*** <code>!<''component_id''></code> - Removes a default data component of the item. | *** <code>!<''component_id''></code> - Removes a default data component of the item. | ||
| Line 436: | Line 436: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|stick}} | ||
* {{ | * {{cd|minecraft:stick}} | ||
* <code>stick{foo:bar}</code>{{sic}} | * <code>stick{foo:bar}</code>{{sic}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|loot_modifier}} | ||
=== minecraft:loot_modifier === | === minecraft:loot_modifier === | ||
{{ | {{Arg desc|je=loot_modifier}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo: bar}} | ||
* {{cd|<nowiki>{function: set_components, components: {"!damage": {}}}</nowiki>}} | * {{cd|<nowiki>{function: set_components, components: {"!damage": {}}}</nowiki>}} | ||
* {{cd|<nowiki>{function: set_count, count: 10, add: true}</nowiki>}} | * {{cd|<nowiki>{function: set_count, count: 10, add: true}</nowiki>}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|loot_predicate}} | ||
=== minecraft:loot_predicate === | === minecraft:loot_predicate === | ||
{{ | {{Arg desc|je=loot_predicate}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo: bar}} | ||
* {{cd|<nowiki>{condition:weather_check, raining:true}</nowiki>}} | * {{cd|<nowiki>{condition:weather_check, raining:true}</nowiki>}} | ||
* {{cd|<nowiki>{condition:random_chance, chance: 0.5}</nowiki>}} | * {{cd|<nowiki>{condition:random_chance, chance: 0.5}</nowiki>}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|loot_table}} | ||
=== minecraft:loot_table === | === minecraft:loot_table === | ||
{{ | {{Arg desc|je=loot_table}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo: bar}} | ||
* {{cd|<nowiki>{pools: [{rolls: 2, entries: [{type: item, weight: 1, name: stick}, {type: item, weight: 1, name: blaze_rod}]}]}</nowiki>}} | * {{cd|<nowiki>{pools: [{rolls: 2, entries: [{type: item, weight: 1, name: stick}, {type: item, weight: 1, name: blaze_rod}]}]}</nowiki>}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|message}} | ||
=== minecraft:message === | === minecraft:message === | ||
{{ | {{Arg desc|je=message}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|Hello world!}} | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|@e}} | ||
* {{ | * {{cd|Hello @p :)}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|nbt_compound_tag}} | ||
=== minecraft:nbt_compound_tag === | === minecraft:nbt_compound_tag === | ||
{{ | {{Arg desc|je=nbt_compound_tag}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
| Line 498: | Line 498: | ||
* <code>{foo:bar}</code> | * <code>{foo:bar}</code> | ||
</div></div> | </div></div> | ||
{{ | {{anchor|nbt_path}} | ||
=== minecraft:nbt_path === | === minecraft:nbt_path === | ||
{{ | {{Arg desc|je=nbt_path}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
An example | An example | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
{{ | {{cd|foo.bar[0]."A [crazy name]".baz.}} | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{ | * {{cd|foo}} | ||
** {{ | ** {{cd|bar}} | ||
*** ''<the first list element>'' | *** ''<the first list element>'' | ||
**** {{ | **** {{cd|A [crazy name]}} | ||
***** '''{{ | ***** '''{{cd|baz}}''' | ||
*** ''<the second list element>'' | *** ''<the second list element>'' | ||
</div></div></div> | </div></div></div> | ||
| Line 518: | Line 518: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|foo.bar}} | ||
* {{ | * {{cd|foo[0]}} | ||
* {{ | * {{cd|[0]}} | ||
* <code>[]</code> | * <code>[]</code> | ||
* <code>{foo:bar}</code> | * <code>{foo:bar}</code> | ||
</div></div> | </div></div> | ||
{{ | {{anchor|nbt_tag}} | ||
=== minecraft:nbt_tag === | === minecraft:nbt_tag === | ||
{{ | {{Arg desc|je=nbt_tag}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0}} | ||
* {{ | * {{cd|0b}} | ||
* {{ | * {{cd|0xFF}} | ||
* {{ | * {{cd|0.0}} | ||
* {{ | * {{cd|"foo"}} | ||
* <code>{foo:bar}</code> | * <code>{foo:bar}</code> | ||
</div></div> | </div></div> | ||
{{ | {{anchor|objective}} | ||
=== minecraft:objective === | === minecraft:objective === | ||
{{ | {{Arg desc|je=objective}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|*}} | ||
* {{ | * {{cd|012}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|objective_criteria}} | ||
=== minecraft:objective_criteria === | === minecraft:objective_criteria === | ||
{{ | {{Arg desc|je=objective_criteria}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|foo.bar.baz}} | ||
* {{ | * {{cd|minecraft:foo}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|operation}} | ||
=== minecraft:operation === | === minecraft:operation === | ||
{{ | {{Arg desc|je=operation}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
| Line 570: | Line 570: | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* <code>=</code> | * <code>=</code> | ||
* {{ | * {{cd|>}} | ||
* {{ | * {{cd|<}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|particle}} | ||
=== minecraft:particle === | === minecraft:particle === | ||
{{ | {{Arg desc|je=particle}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|foo:bar}} | ||
* {{ | * {{cd|particle with options}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|resource}} | ||
=== minecraft:resource === | === minecraft:resource === | ||
{{ | {{Arg desc|je=resource}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|foo:bar}} | ||
* {{ | * {{cd|012}} | ||
</div></div> | </div></div> | ||
| Line 599: | Line 599: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|string|registry}}: The registry ID. | ||
</div></div> | </div></div> | ||
{{ | {{anchor|resource_key}} | ||
=== minecraft:resource_key === | === minecraft:resource_key === | ||
{{ | {{Arg desc|je=resource_key}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|foo:bar}} | ||
* {{ | * {{cd|012}} | ||
</div></div> | </div></div> | ||
| Line 617: | Line 617: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|string|registry}}: The registry ID. | ||
</div></div> | </div></div> | ||
{{ | {{anchor|resource_location}} | ||
=== minecraft:resource_location === | === minecraft:resource_location === | ||
{{ | {{Arg desc|je=resource_location}} It is resolved during command execution into the unregistered content, or sent to the client to resolve into a client-side content. | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|foo:bar}} | ||
* {{ | * {{cd|012}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|resource_or_tag}} | ||
=== minecraft:resource_or_tag === | === minecraft:resource_or_tag === | ||
{{ | {{Arg desc|je=resource_or_tag}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|foo:bar}} | ||
* {{ | * {{cd|012}} | ||
* {{ | * {{cd|#skeletons}} | ||
* {{ | * {{cd|#minecraft:skeletons}} | ||
</div></div> | </div></div> | ||
| Line 649: | Line 649: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|string|registry}}: The registry ID. | ||
</div></div> | </div></div> | ||
{{ | {{anchor|resource_or_tag_key}} | ||
=== minecraft:resource_or_tag_key === | === minecraft:resource_or_tag_key === | ||
{{ | {{Arg desc|je=resource_or_tag_key}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|foo:bar}} | ||
* {{ | * {{cd|012}} | ||
* {{ | * {{cd|#skeletons}} | ||
* {{ | * {{cd|#minecraft:skeletons}} | ||
</div></div> | </div></div> | ||
| Line 669: | Line 669: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|string|registry}}: The registry ID. | ||
</div></div> | </div></div> | ||
{{ | {{anchor|resource_selector}} | ||
=== minecraft:resource_selector === | === minecraft:resource_selector === | ||
Similar to '''resouce_location''' except enables the use of wildcard characters. | Similar to '''resouce_location''' except enables the use of wildcard characters. | ||
| Line 681: | Line 681: | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|*:*}} - matches all IDs | ||
* {{ | * {{cd|*}} - matches everything in the <code>minecraft</code> namespace | ||
* {{ | * {{cd|custom:folder/*_test_?}} - matches IDs in the <code>folder</code> subfolder in the <code>custom</code> namespace that end in <code>_test_</code> followed by one additional character. | ||
</div></div> | </div></div> | ||
{{ | {{anchor|rotation}} | ||
=== minecraft:rotation === | === minecraft:rotation === | ||
{{ | {{Arg desc|je=rotation}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0 0}} | ||
* {{ | * {{cd|~ ~}} | ||
* {{ | * {{cd|~-5 ~5}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|score_holder}} | ||
=== minecraft:score_holder === | === minecraft:score_holder === | ||
{{ | {{Arg desc|je=score_holder}} | ||
Each score holder argument may specify if it can select only one score holder or multiple score holders. | Each score holder argument may specify if it can select only one score holder or multiple score holders. | ||
| Line 706: | Line 706: | ||
Examples | Examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|#hidden}} | ||
* {{ | * {{cd|.top}} | ||
</div></div> | </div></div> | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|Player}} | ||
* {{ | * {{cd|0123}} | ||
* {{ | * {{cd|*}} | ||
* {{ | * {{cd|@e}} | ||
</div></div> | </div></div> | ||
| Line 721: | Line 721: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|string|amount}}: The amount of score holders that can be selected. Can be {{cd|single}} or {{cd|multiple}}. | ||
</div></div> | </div></div> | ||
{{ | {{anchor|scoreboard_slot}} | ||
=== minecraft:scoreboard_slot === | === minecraft:scoreboard_slot === | ||
{{ | {{Arg desc|je=scoreboard_slot}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|sidebar}} | ||
* {{ | * {{cd|foo.bar}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|style}} | ||
=== minecraft:style === | === minecraft:style === | ||
{{ | {{Arg desc|je=style}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
| Line 744: | Line 744: | ||
* {{cd|{"bold": true<nowiki>}</nowiki>}} | * {{cd|{"bold": true<nowiki>}</nowiki>}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|swizzle}} | ||
=== minecraft:swizzle === | === minecraft:swizzle === | ||
{{ | {{Arg desc|je=swizzle}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|xyz}} | ||
* {{ | * {{cd|x}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|team}} | ||
=== minecraft:team === | === minecraft:team === | ||
{{ | {{Arg desc|je=team}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|foo}} | ||
* {{ | * {{cd|123}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|template_mirror}} | ||
=== minecraft:template_mirror === | === minecraft:template_mirror === | ||
{{ | {{Arg desc|je=template_mirror}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|none}} | ||
* {{ | * {{cd|left_right}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|template_rotation}} | ||
=== minecraft:template_rotation === | === minecraft:template_rotation === | ||
{{ | {{Arg desc|je=template_rotation}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|none}} | ||
* {{ | * {{cd|clockwise_90}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|time}} | ||
=== minecraft:time === | === minecraft:time === | ||
{{ | {{Arg desc|je=time}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0d}} | ||
* {{ | * {{cd|0s}} | ||
* {{ | * {{cd|0t}} | ||
* {{ | * {{cd|0}} | ||
</div></div> | </div></div> | ||
| Line 801: | Line 801: | ||
JSON properties in command syntax output | JSON properties in command syntax output | ||
<div class="collapsible-content treeview"> | <div class="collapsible-content treeview"> | ||
* {{ | * {{nbt|compound|properties}}: The root properties object. | ||
** {{ | ** {{nbt|int|min}}: The minimum time in game ticks. | ||
</div></div> | </div></div> | ||
{{ | {{anchor|uuid}} | ||
=== minecraft:uuid === | === minecraft:uuid === | ||
{{ | {{Arg desc|je=uuid}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|dd12be42-52a9-4a91-a8a1-11c01849e498}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|vec2}} | ||
=== minecraft:vec2 === | === minecraft:vec2 === | ||
{{ | {{Arg desc|je=vec2}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0 0}} | ||
* {{ | * {{cd|~ ~}} | ||
* {{ | * {{cd|0.1 -0.5}} | ||
* {{ | * {{cd|~1 ~-2}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|vec3}} | ||
=== minecraft:vec3 === | === minecraft:vec3 === | ||
{{ | {{Arg desc|je=vec3}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|0 0 0}} | ||
* {{ | * {{cd|~ ~ ~}} | ||
* {{ | * {{cd|^ ^ ^}} | ||
* {{ | * {{cd|^1 ^ ^-5}} | ||
* {{ | * {{cd|0.1 -0.5 .9}} | ||
* {{ | * {{cd|~0.5 ~1 ~-5}} | ||
</div></div> | </div></div> | ||
=== Removed === | === Removed === | ||
{{ | {{anchor|entity_summon}} | ||
==== minecraft:entity_summon ==== | ==== minecraft:entity_summon ==== | ||
{{ | {{Arg desc|je=entity_summon}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|minecraft:pig}} | ||
* {{ | * {{cd|cow}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|item_enchantment}} | ||
==== minecraft:item_enchantment ==== | ==== minecraft:item_enchantment ==== | ||
{{ | {{Arg desc|je=item_enchantment}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|unbreaking}} | ||
* {{ | * {{cd|silk_touch}} | ||
</div></div> | </div></div> | ||
{{ | {{anchor|mob_effect}} | ||
==== minecraft:mob_effect ==== | ==== minecraft:mob_effect ==== | ||
{{ | {{Arg desc|je=mob_effect}} | ||
<div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | <div class="collapsible collapsed collapsetoggle-inline" data-expandtext="show" data-collapsetext="hide"> | ||
Official examples | Official examples | ||
<div class="collapsible-content"> | <div class="collapsible-content"> | ||
* {{ | * {{cd|spooky}} | ||
* {{ | * {{cd|effect}} | ||
</div></div> | </div></div> | ||
== Bedrock Edition == | == Bedrock Edition == | ||
<!-- Note: This list is from disassembly code of BDS (CommandRegistry::parse<T>), and https://github.com/Mojang/bedrock-samples/blob/main/metadata/command_modules/mojang-commands.json.--> | <!-- Note: This list is from disassembly code of BDS (CommandRegistry::parse<T>), and https://github.com/Mojang/bedrock-samples/blob/main/metadata/command_modules/mojang-commands.json.--> | ||
{{ | {{update|section=1}} | ||
===BlockStateCommandParam=== | ===BlockStateCommandParam=== | ||
Also known as BLOCK_STATE_ARRAY. | Also known as BLOCK_STATE_ARRAY. | ||
{{ | {{Arg desc|be=BlockStateCommandParam}} | ||
===CommandCompareOperator=== | ===CommandCompareOperator=== | ||
Also known as COMPAREOPERATOR. | Also known as COMPAREOPERATOR. | ||
{{ | {{Arg desc|be=CommandCompareOperator}} | ||
===CommandFilePath=== | ===CommandFilePath=== | ||
Also known as PATHCOMMAND. | Also known as PATHCOMMAND. | ||
{{ | {{Arg desc|be=CommandFilePath}} | ||
===CommandIntegerRange=== | ===CommandIntegerRange=== | ||
Also known as FULLINTEGERRANGE. | Also known as FULLINTEGERRANGE. | ||
{{ | {{Arg desc|be=CommandIntegerRange}} | ||
===CommandMessage=== | ===CommandMessage=== | ||
Also known as MESSAGE_ROOT. | Also known as MESSAGE_ROOT. | ||
{{ | {{Arg desc|be=CommandMessage}} | ||
===CommandOperator=== | ===CommandOperator=== | ||
Also known as OPERATOR. | Also known as OPERATOR. | ||
{{ | {{Arg desc|be=CommandOperator}} | ||
===CommandPosition=== | ===CommandPosition=== | ||
Also known as POSITION. | Also known as POSITION. | ||
{{ | {{Arg desc|be=CommandPosition}} | ||
===CommandPositionFloat=== | ===CommandPositionFloat=== | ||
Also known as POSITION_FLOAT. | Also known as POSITION_FLOAT. | ||
{{ | {{Arg desc|be=CommandPositionFloat}} | ||
===CommandRawText=== | ===CommandRawText=== | ||
Also known as RAWTEXT. | Also known as RAWTEXT. | ||
{{ | {{arg desc|be=rawtext}} | ||
{{ | {{anchor|<nowiki>CommandSelector<Actor></nowiki>}}{{anchor|<nowiki>CommandSelector<Player></nowiki>}} | ||
===CommandSelector<Actor> and CommandSelector<Player>=== | ===CommandSelector<Actor> and CommandSelector<Player>=== | ||
Also known as SELECTION. | Also known as SELECTION. | ||
CommandSelector<Actor> is used to specify entities. {{ | CommandSelector<Actor> is used to specify entities. {{Arg desc|be=CommandSelector<Actor>}} | ||
CommandSelector<Player> is used to specify players. {{ | CommandSelector<Player> is used to specify players. {{Arg desc|be=CommandSelector<Player>}} | ||
===CommandWildcardInt=== | ===CommandWildcardInt=== | ||
Also known as WILDCARDINT. | Also known as WILDCARDINT. | ||
Must be a 32-bit integer, or an asterisk ({{ | Must be a 32-bit integer, or an asterisk ({{cd|*}}) to represent MIN_INT(-2,147,483,648), | ||
===float=== | ===float=== | ||
Also known as VAL. | Also known as VAL. | ||
{{ | {{Arg desc|be=float}} | ||
===int=== | ===int=== | ||
Also known as INT. | Also known as INT. | ||
{{ | {{Arg desc|be=int}} | ||
===Json::Value=== | ===Json::Value=== | ||
Also known as JSON_OBJECT. | Also known as JSON_OBJECT. | ||
{{ | {{Arg desc|be=Json::Value}} | ||
===RelativeFloat=== | ===RelativeFloat=== | ||
Also known as RVAL. | Also known as RVAL. | ||
{{ | {{Arg desc|be=RelativeFloat}} | ||
{{ | {{anchor|basic_string}} | ||
===std::basic_string=== | ===std::basic_string=== | ||
Also known as ID. | Also known as ID. | ||
{{ | {{Arg desc|be=basic_string}} | ||
{{ | {{anchor|<nowiki>unique_ptr<Command></nowiki>}} | ||
===std::unique_ptr<Command>=== | ===std::unique_ptr<Command>=== | ||
| Line 955: | Line 955: | ||
Also known as WILDCARDSELECTION. | Also known as WILDCARDSELECTION. | ||
{{ | {{Arg desc|be=WildcardCommandSelector<Actor>}} | ||
{{ | {{anchor|enum}} | ||
===Enum=== | ===Enum=== | ||
Must be an unquoted string without space. | Must be an unquoted string without space. | ||
==History== | ==History== | ||
{{Missing information|{{ | {{Missing information|{{BE}}}} | ||
{{HistoryTable | {{HistoryTable | ||
|{{ | |{{HistoryLine|java}} | ||
|{{ | |{{HistoryLine||1.13|dev=17w45a|[[Minecraft:Command]] arguments are now handled with Brigadier.}} | ||
|{{HistoryLine||1.14|dev=19w08a|Now allows single quotes for strings in commands.<ref>{{ | |{{HistoryLine||1.14|dev=19w08a|Now allows single quotes for strings in commands.<ref>{{Link|url=https://github.com/Mojang/brigadier/pull/52|title=Allow single quote in strings by boq · Pull Request #52 |website=Mojang/brigadier – GitHub}}</ref>}} | ||
|{{ | |{{HistoryLine||1.16|dev=20w17a|Added <code>minecraft:uuid</code> argument type.}} | ||
|{{HistoryLine||1.16.2|dev=20w29a|Added angle arguments to {{ | |{{HistoryLine||1.16.2|dev=20w29a|Added angle arguments to {{cmd|spawnpoint}} and {{cmd|setworldspawn}}, with an argument type that is not registered.<ref name="MC-195052">{{Bug|MC-195052|resolution=Fixed}}</ref>}} | ||
|{{HistoryLine|||dev=20w30a|Added <code>minecraft:angle</code> argument type. | |{{HistoryLine|||dev=20w30a|Added <code>minecraft:angle</code> argument type. | ||
|Now {{ | |Now {{cmd|spawnpoint}} and {{cmd|setworldspawn}} use this argument type.<ref name="MC-195052"/>}} | ||
|{{ | |{{HistoryLine|||dev=?|Now <code>minecraft:dimension</code> argument type checks whether the dimension exists during execution instead of parsing.}} | ||
|{{HistoryLine||1.17|dev=20w45a|Now <code>minecraft:angle</code> argument type does not accept NaN or Infinite.<ref>{{bug|MC-198414|resolution=Fixed}}</ref>}} | |{{HistoryLine||1.17|dev=20w45a|Now <code>minecraft:angle</code> argument type does not accept NaN or Infinite.<ref>{{bug|MC-198414|resolution=Fixed}}</ref>}} | ||
|{{HistoryLine|||dev=21w10a|Now <code>minecraft:block_pos</code> arguments in {{ | |{{HistoryLine|||dev=21w10a|Now <code>minecraft:block_pos</code> arguments in {{cmd|spawnpoint}} and {{cmd|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.<ref>{{bug|MC-210408|resolution=Fixed}}</ref>}} | ||
|{{HistoryLine||1.18|dev=21w37a|Removed 16-character limit in <code>minecraft:objective</code> argument type.<ref>{{bug|MC-123277|resolution=Fixed}}</ref>}} | |{{HistoryLine||1.18|dev=21w37a|Removed 16-character limit in <code>minecraft:objective</code> argument type.<ref>{{bug|MC-123277|resolution=Fixed}}</ref>}} | ||
|{{ | |{{HistoryLine||1.18.2|dev=Pre-release 3|Added <code>minecraft:resource</code> and <code>minecraft:resource_or_tag</code> argument types. | ||
|Now <code>minecraft:resource_location</code> is used only for pack contents, while <code>minecraft:resource</code> is used for registry entries.}} | |Now <code>minecraft:resource_location</code> is used only for pack contents, while <code>minecraft:resource</code> is used for registry entries.}} | ||
|{{HistoryLine||1.19|dev=22w11a|Now <code>minecraft:item_predicate</code> and <code>minecraft:block_predicate</code> require tag to exist when parsing instead of executing.<ref>{{bug|MC-124984|resolution=Fixed}}</ref>}} | |{{HistoryLine||1.19|dev=22w11a|Now <code>minecraft:item_predicate</code> and <code>minecraft:block_predicate</code> require tag to exist when parsing instead of executing.<ref>{{bug|MC-124984|resolution=Fixed}}</ref>}} | ||
|{{ | |{{HistoryLine|||dev=22w19a|Added <code>minecraft:template_mirror</code> and <code>minecraft:template_rotation</code> argument types.}} | ||
|{{ | |{{HistoryLine||1.19.3|dev=22w42a|Added <code>minecraft:resource_key</code> and <code>minecraft:resource_or_tag_key</code> argument types, which are used for reloadable registry entries (i.e. [[Minecraft:Resource location#Registered pack contents|registered pack contents]]). | ||
|Now <code>minecraft:resource</code> and <code>minecraft:resource_or_tag</code> are used only for un-reloadable registry entries. | |Now <code>minecraft:resource</code> and <code>minecraft:resource_or_tag</code> are used only for un-reloadable registry entries. | ||
|Removed <code>minecraft:mob_effect</code>, <code>minecraft:entity_summon</code> and <code>minecraft:item_enchantment</code> argument types. Replaced by <code>minecraft:resource</code>.}} | |Removed <code>minecraft:mob_effect</code>, <code>minecraft:entity_summon</code> and <code>minecraft:item_enchantment</code> argument types. Replaced by <code>minecraft:resource</code>.}} | ||
|{{ | |{{HistoryLine|||dev=22w45a|Added <code>minecraft:gamemode</code> argument type.}} | ||
|{{HistoryLine||1.19.4|dev=23w03a|Added <code>min</code> property to <code>minecraft:time</code> argument type.<ref>{{bug|MC-122595|resolution=Fixed}}</ref> | |{{HistoryLine||1.19.4|dev=23w03a|Added <code>min</code> property to <code>minecraft:time</code> argument type.<ref>{{bug|MC-122595|resolution=Fixed}}</ref> | ||
|The min value of <code>minecraft:time</code> is always 0 before this update.}} | |The min value of <code>minecraft:time</code> is always 0 before this update.}} | ||
|{{ | |{{HistoryLine|||dev=1.19.4-pre1|Added <code>minecraft:heightmap</code> argument type.}} | ||
|{{ | |{{HistoryLine||1.20.3|dev=23w46a|Added <code>minecraft:style</code> argument type.}} | ||
|{{ | |{{HistoryLine||1.20.5|dev=24w10a|Added <code>minecraft:item_slots</code> argument type.}} | ||
}} | }} | ||
| Line 993: | Line 993: | ||
== Navigation == | == Navigation == | ||
{{ | {{Navbox commands}} | ||
[[Category:Commands]] | [[Category:Commands]] | ||
fr:Types d'arguments | [[Minecraft:fr:Types d'arguments]] | ||
ja:引数の型 | [[Minecraft:ja:引数の型]] | ||
lzh:附項之類 | [[Minecraft:lzh:附項之類]] | ||
pt:Tipos de argumentos | [[Minecraft:pt:Tipos de argumentos]] | ||
ru:Типы аргументов | [[Minecraft:ru:Типы аргументов]] | ||
zh:参数类型 | [[Minecraft:zh:参数类型]] | ||
Revision as of 11:02, 13 May 2026
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 everything 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:参数类型