Advancement grant/revoke API

Advancement

The Advancement class lets you grant or revoke Minecraft advancements (achievements) for players, and inspect their progress.


Class Methods

grant

progress = await Advancement.grant(player, key)

Grant an advancement to a player (awards all remaining criteria).

progress = await Advancement.grant(player, "minecraft:story/mine_stone")

revoke

progress = await Advancement.revoke(player, key)

Revoke an advancement from a player (removes all awarded criteria).

await Advancement.revoke(player, "minecraft:story/mine_stone")

Attributes

key

The advancement's namespaced key.


AdvancementProgress

Returned by grant() and revoke(), this object tracks per-criterion completion.

Attributes

is_done

Whether all criteria have been awarded.

remaining_criteria

Criteria names that have not been awarded yet.

awarded_criteria

Criteria names that have been awarded.

Methods

award_criteria

result = await progress.award_criteria(name)

Award a single criterion.

revoke_criteria

result = await progress.revoke_criteria(name)

Revoke a single criterion.


Common Advancement Keys

Key Description
minecraft:story/mine_stone Mine stone with a pickaxe
minecraft:story/upgrade_tools Craft a stone pickaxe
minecraft:story/smelt_iron Smelt an iron ingot
minecraft:story/obtain_armor Craft any armor piece
minecraft:story/enter_the_nether Enter the Nether
minecraft:story/enter_the_end Enter the End
minecraft:end/kill_dragon Kill the Ender Dragon

You can also use server.get_advancement(key) to get the advancement object:

adv = await server.get_advancement("minecraft:story/mine_stone")