Minecraft:Commands/advancement: Difference between revisions
More actions
imported>ProBot m Bot: Adding lzh:令/advancement |
Fix template calls: add MC/ prefix |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
{{ | {{MC/Exclusive|java}} | ||
{{Infobox command | {{Infobox command | ||
|name=advancement | |name=advancement | ||
| Line 5: | Line 5: | ||
}} | }} | ||
Gives or takes an | Gives or takes an advancement or its criterion from one or more players. | ||
== Syntax == | == Syntax == | ||
| Line 29: | Line 29: | ||
: Specifies whether to add or remove the to-be-specified advancement(s). | : Specifies whether to add or remove the to-be-specified advancement(s). | ||
{{ | {{MC/Argument|targets|entity}} | ||
: Specifies one player or more. | : Specifies one player or more. | ||
: {{ | : {{MC/Arg desc|je=entity|amount=multiple|type=players}} | ||
{{ | {{MC/Argument|advancement|resource_location}} | ||
: Specifies a valid resource location of the advancement to target. | : Specifies a valid resource location of the advancement to target. | ||
: {{ | : {{MC/Arg desc|je=resource_location}} | ||
{{ | {{MC/Argument|criterion|string}} | ||
: Specifies a valid criterion of the advancement to manipulate. | : Specifies a valid criterion of the advancement to manipulate. | ||
: The command defaults to the entire advancement. | : The command defaults to the entire advancement. | ||
: If specified, the command refers to merely the criterion and not the entire advancement. | : If specified, the command refers to merely the criterion and not the entire advancement. | ||
: {{ | : {{MC/Arg desc|je=string|type=greedy}} | ||
== Result == | == Result == | ||
| Line 48: | Line 48: | ||
{{Result table|<code><targets></code> fails to resolve to one or more online players.|fail}} | {{Result table|<code><targets></code> fails to resolve to one or more online players.|fail}} | ||
{{Result table|There's no advancement (or criterion) added to (or remove from) any player.}} | {{Result table|There's no advancement (or criterion) added to (or remove from) any player.}} | ||
{{Result table|cmd=/... only <advancement> <criterion>|The {{ | {{Result table|cmd=/... only <advancement> <criterion>|The {{MC/Cd|<criterion>}} is invalid for the {{MC/Cd|<advancement>}}.}} | ||
{{Result table|cmd=|succeed}} | {{Result table|cmd=|succeed}} | ||
{{Result table}} | {{Result table}} | ||
== Output == | == Output == | ||
{{Output table}} | {{MC/Output table}} | ||
{{Output table|edition=je|On fail|0|0|0}} | {{MC/Output table|edition=je|On fail|0|0|0}} | ||
{{Output table|On success|1|1|the total number of advancements(or criterions) added to (or removed from) each player.}} | {{MC/Output table|On success|1|1|the total number of advancements(or criterions) added to (or removed from) each player.}} | ||
{{Output table}} | {{MC/Output table}} | ||
== Examples == | == Examples == | ||
| Line 66: | Line 66: | ||
== History == | == History == | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|java}} | |{{MC/HistoryLine|java}} | ||
|{{HistoryLine||1.12|dev=17w13a|Added {{ | |{{HistoryLine||1.12|dev=17w13a|Added {{MC/Cd|/advancement}}.}} | ||
|{{HistoryLine||1.13|dev=17w45a|Removed {{ | |{{HistoryLine||1.13|dev=17w45a|Removed {{MC/Cd|/advancement test}} in favor of [[Minecraft:Commands#Selecting targets by advancements|advancement target selectors]].}} | ||
|{{HistoryLine||1.20.3|dev=23w45a|The {{ | |{{HistoryLine||1.20.3|dev=23w45a|The {{MC/Cd|/advancement}} no longer throws unhandled expections when fails.}} | ||
}} | }} | ||
== See also == | == See also == | ||
* {{ | * {{MC/Cmd|gamerule announceAdvancements}} | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
de:Befehl/advancement | |||
es:Comandos/advancement | |||
ja:コマンド/advancement | |||
lzh:令/advancement | |||
nl:Opdrachten/advancement | |||
pt:Comandos/advancement | |||
ru:Команды консоли/advancement | |||
uk:Команди консолі/advancement | |||
zh:命令/advancement | |||
Latest revision as of 20:07, 9 April 2026
Script error: No such module "Exclusive". Template:Infobox command
Gives or takes an advancement or its criterion from one or more players.
Syntax
advancement (grant|revoke) <targets> everything- Adds or removes all loaded advancements.
advancement (grant|revoke) <targets> only <advancement> [<criterion>]- Adds or removes a single advancement or criterion.
advancement (grant|revoke) <targets> from <advancement>- Adds or removes an advancement and all its child advancements.
- Think of specifying everything from that advancement to the end.
- The exact order the operation is carried out in is
specified advancement > child > child's child > ...When it operates on a child that branches, it iterates through all its children before continuing.
advancement (grant|revoke) <targets> through <advancement>- Specifies an advancement, and adds or removes all its parent advancements, and all its child advancements.
- Think of specifying everything through the specified advancement, going both backward and forward.
- The exact order the operation is as if the command were executed with "until" specified, then with "from" specified:
parent > parent's parent > ... > root > specified advancement > child > child's child > ...
advancement (grant|revoke) <targets> until <advancement>- Adds or removes an advancement and all its parent advancements until the root for addition/removal.
- Think of specifying everything from the start until that advancement.
- The exact order the operation is carried out in is:
parent > parent's parent > ... > root > specified advancement.
Arguments
- Specifies whether to add or remove the to-be-specified advancement(s).
<targets>: entity
- Specifies one player or more.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|entity}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
<advancement>: resource_location
- Specifies a valid resource location of the advancement to target.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|resource_location}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
<criterion>: string
- Specifies a valid criterion of the advancement to manipulate.
- The command defaults to the entire advancement.
- If specified, the command refers to merely the criterion and not the entire advancement.
- {{#vardefine:onlyje|}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|string}}{{#vardefine:be-arg|}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|0}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the total number of advancements(or criterions) added to (or removed from) each player.}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
Examples
- To grant the "Cover Me With Diamonds" advancement to the player, execute the command
/advancement grant @s only minecraft:story/shiny_gear. - To grant all advancements to every player, execute
/advancement grant @a everything. - To revoke "Cover Me With Diamonds" advancement from the player, execute the command
/advancement revoke @s only minecraft:story/shiny_gear. - To revoke all advancements from every player, execute
/advancement revoke @a everything.
History
See also
- REDIRECT Template:Command
de:Befehl/advancement es:Comandos/advancement ja:コマンド/advancement lzh:令/advancement nl:Opdrachten/advancement pt:Comandos/advancement ru:Команды консоли/advancement uk:Команди консолі/advancement zh:命令/advancement