Updated:

Unlock every recipe

/recipe give @s *

* means all recipes. Every recipe appears in the recipe book. Use @a to unlock them for everyone.

One recipe, or take them away

GoalCommand
Unlock one recipe/recipe give @s minecraft:crafting_table
Remove all recipes/recipe take @s *
Remove one recipe/recipe take @s minecraft:crafting_table

Recipe IDs usually match the item ID, but items with several recipes have their own names, such as minecraft:red_dye_from_poppy. Pick from the suggestions while typing.

Grant or revoke all advancements

/advancement grant @s everything
/advancement revoke @s everything

everything floods the chat with completion messages.

Grant part of the tree

CommandGrants
/advancement grant @s only minecraft:story/mine_stoneJust "Stone Age"
/advancement grant @s until minecraft:story/enter_the_netherEverything leading up to entering the Nether
/advancement grant @s from minecraft:story/rootThe advancement and everything after it
/advancement grant @s through minecraft:story/mine_stoneThe advancement with its parents and children

Advancement IDs are grouped as minecraft:story/…, nether/…, end/…, adventure/… and husbandry/….

Check if a player has an advancement

/execute as @a[advancements={minecraft:story/enter_the_nether=true}] run say I have been to the Nether

The advancements selector argument filters players by what they have earned. Use =false to target players who have not. This is handy for map gates, for example only letting players through after they reach the Nether.

Reset progress for a map or event

/advancement revoke @a everything
/recipe take @a *

Run both at the start of an event so every player begins with an empty advancement tree and recipe book. Revoking does not remove items or XP already earned.

Hide the chat messages

Granting many advancements at once fills the chat. Turn the announcements off first:

VersionCommand
Java 1.21.11 and later/gamerule minecraft:show_advancement_messages false
Java 1.21.10 and earlier/gamerule announceAdvancements false

The toast in the top right still appears for the player. See the game rule list for other renamed rules.

Bedrock Edition

Bedrock has no /advancement. Its achievements are a separate system, and worlds with cheats enabled cannot earn them. Recent Bedrock versions may have /recipe, but the syntax can differ, so follow the in-game suggestions.

Common problems

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.