Commands/advancement

From Minecraft Wiki
Jump to: navigation, search
advancement
Restrictions

Operator

First introduced

1.12 (17w13a)

Gives or takes an advancement from a player, or tests whether a player has an advancement.

Syntax
advancement <grant|revoke> <player> <only|until|from|through> <advancement> [criterion]
advancement <grant|revoke> <player> everything
advancement test <player> <advancement> [criterion]
Arguments
player
Must be a player name or a target selector.
only
Grants/revokes only the specified advancement from the player.
until
Grants/revokes the specified advancement, its parent advancement, its parent's parent advancement, etc. from the player. From the start until the specified advancement. The exact order of granting/revoking is "parent" > "parent's parent" > ... > "start" > "specified advancement".
from
Grants/revokes the specified advancement, its children advancements, its children's children advancements, etc. from the player. All the way forward from the specified advancement. The exact order of granting/revoking is "specified advancement" > "child" > "child's child", when a branch is found it will iterate through the top branch entirely before going through the other branches.
through
Acts as until and from combined; all advancements through the specified advancement, going both backwards and forwards. The exact order of granting/revoking is the same as for until and from, until being done before from.
everything
Grants/revokes every loaded advancement from the player.
advancement
Specifies which advancement to grant, revoke or test. Must be a valid advancement identifier.
criterion (optional)
Specifies which criterion of the advancement to grant, revoke or test. Must be a valid advancement criteria identifier.
If specified, the command will refer to merely the criterion, and not the entire advancement.
If absent, the command will refer to the entire advancement.
Result
Fails if the arguments aren't specified correctly, or if player fails to resolve to one or more online players.
On success, grants or removes the specified advancement(s) to the player(s).
Examples
To test yourself for the "iron leggings" criterion of the "Obtain armor" advancement: advancement test @p minecraft:story/obtain_armor iron_leggings
To grant the "Shiny gear" advancement to yourself: advancement grant @p only minecraft:story/shiny_gear