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
| Field | Type | Default | Description |
|---|---|---|---|
namespace | String | questcodex | Namespace of the advancement id. Lowercase letters, digits, '_', '.' and '-' only. |
key | String | — | Key of the advancement id, unique within the namespace. '/' creates a folder. |
parent | Ref<AdvancementDefinitionEntry> | — | Advancement this one hangs under. Leave empty to make it the root of its own tab. |
icon | Material | BOOK | Item shown as the advancement icon. |
title | String | — | Title shown in the tree and on the toast.Colors |
description | String | — | Description shown under the title in the tree.Colors |
frame | AdvancementFrame | TASK | Frame drawn around the icon. Challenges use the ornate frame and a distinct toast.Values:TASKGOALCHALLENGE |
background | String | — | Tab background sprite, e.g. 'minecraft:gui/advancements/backgrounds/stone'. Only used on a root advancement. |
showToast | Boolean | true | Whether earning this advancement pops a toast on screen. |
announceToChat | Boolean | false | Whether earning this advancement is announced in chat. |
hidden | Boolean | false | Whether this advancement stays hidden in the tree until it is earned. Ignored on a root. |
autoGrant | Boolean | false | Earn 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.