/advancement
< Commands
This feature is exclusive to Java Edition.
/advancement| Permission level required |
2 |
|---|---|
| Restrictions |
None |
{
"title": "<code>/advancement</code>",
"rows": [
{
"field": "2",
"label": "(link to Permission level article, displayed as Permission level<br>required)"
},
{
"field": "None",
"label": "(link to Commands#Restrictions article, displayed as Restrictions)"
}
],
"invimages": [],
"images": []
}
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 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
grant|revoke
- Specifies whether to add or remove the to-be-specified advancement(s).
<targets>: entity
- Specifies one player or more.
- Must be a player name, a target selector or a UUID. And the target selector must be of player type.
<advancement>: resource_location
- Specifies a valid resource location of the advancement to target.
- Must be a resource location for an unregistered content.
<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.
- Must be a string. And it is a greedy phrase (taking the rest of the command as the string argument).
Result
| Command | Trigger | Java Edition |
|---|---|---|
| Any | The command is incomplete, or any argument is not specified correctly. | Unparseable |
<targets> fails to resolve to one or more online players. | Failed | |
| There's no advancement (or criterion) added to (or remove from) any player. | ||
/... only <advancement> <criterion> | The <criterion> is invalid for the <advancement>. | |
| Any | Otherwise | Successful |
Output
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| Any | Java Edition | On fail | 0 | 0 | 0 |
| On success | 1 | 1 | the total number of advancements(or criterions) added to (or removed from) each player. |
Examples
- To grant the "Cover Me With Diamonds" advancement to your 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 your 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
| Java Edition | |||||||
|---|---|---|---|---|---|---|---|
| 1.12 | 17w13a | Added /advancement. | |||||
| 1.13 | 17w45a | Removed /advancement test in favor of advancement target selectors. | |||||
| 1.20.3 | 23w45a | The /advancement no longer throws unhandled expections when fails. | |||||
See also
/gamerule announceAdvancements