Skip to main content

Advancement Definition

Advancement Definition

Defines a real Minecraft advancement. Every definition on the pages is written to a datapack the extension owns, so the advancement appears in the vanilla advancement screen (L) with its own tab, tree and toast — this is not a cosmetic toast. Nothing grants it on its own: the only criterion is minecraft:impossible, and [GrantAdvancementActionEntry] is what awards it. Set [parent] to hang this advancement under another one; leave it empty to make it the root of a tab, which is the only place [background] has an effect. Example: advancement_definition: namespace: "questcodex" key: "root" title: "<gold>Adventures" icon: GOLDEN_SWORD background: "minecraft:gui/advancements/backgrounds/stone" advancement_definition: namespace: "questcodex" key: "first_quest" title: "<green>First Steps" parent: <the root definition>

Fields

FieldTypeDefaultDescription
namespaceStringquestcodexNamespace of the advancement id. Lowercase letters, digits, '_', '.' and '-' only.
keyString—Key of the advancement id, unique within the namespace. '/' creates a folder.
parentRef<AdvancementDefinitionEntry>—Advancement this one hangs under. Leave empty to make it the root of its own tab.
iconMaterialBOOKItem shown as the advancement icon.
titleString—Title shown in the tree and on the toast.Colors
descriptionString—Description shown under the title in the tree.Colors
frameAdvancementFrameTASKFrame drawn around the icon. Challenges use the ornate frame and a distinct toast.Values:TASKGOALCHALLENGE
backgroundString—Tab background sprite, e.g. 'minecraft:gui/advancements/backgrounds/stone'. Only used on a root advancement.
showToastBooleantrueWhether earning this advancement pops a toast on screen.
announceToChatBooleanfalseWhether earning this advancement is announced in chat.
hiddenBooleanfalseWhether this advancement stays hidden in the tree until it is earned. Ignored on a root.
autoGrantBooleanfalseEarn this one as soon as the player plays, with no action. Use it on a root so its tab exists from the start.

How to use it​

Defines one Minecraft advancement. The id is namespace:key. A definition with no parent becomes the root of its own tab, and its background is used for that tab. frame is TASK, GOAL or CHALLENGE.

Definitions are written at startup into a datapack called questcodex_advancements in the world folder, and the server reloads its data when the content changed. A definition added later needs a restart. An advancement is earned only by a Grant Advancement action; set autoGrant on a root so its tab exists from the start.