Commands/advancement

From Minecraft Wiki
Jump to: navigation, search
Information icon.svg
This feature is exclusive to Java Edition.
advancement
Restrictions

Operator

Gives or takes an advancement from one or more players.

Syntax[edit]

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 children 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 children advancements.
Think of specifying everything through the specified advancement, going both backwards and forwards.
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[edit]

grant|revoke

Specifies whether to add or remove the to-be-specified advancement(s).

<targets>: entity

Must be a player name, a target selector or a UUID. And the target selector must be of player type.
Specifies one player or more.

<advancement>: resource_location

Must be a namespaced ID.
Specifies a valid namespaced id of the advancement to target.

<criterion>: string

Must be a 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.

Result[edit]

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
if <entity> fails to resolve to one or more online players Failed
there's no advancement/criterion added to/remove from any player Error
... only <advancement> <criterion>the <criterion> is invalid for the <advancement>
anyOn successgrants or removes the specified advancement(s) or criterion(s) to the player(s).

Output[edit]

CommandEditionSituationSuccess Count/execute store succeess .../execute store result ...
anyJava EditionOn error0unchangedunchanged
On fail000
On success11the total number of advancements/criterions added to/removed from each player.

Examples[edit]

  • To grant the "Cover Me With Diamonds" advancement to your player, execute the command /advancement grant @s only minecraft:story/shiny_gear.
  • To grant the all advancements to every player, execute /advancement grant @a everything.

History[edit]

Java Edition
1.1217w13aAdded advancement.
1.1317w45aRemoved advancement test in favor of advancement target selectors.

See also[edit]