CoreLib Actions
When EmakiCodex is enabled, it adds advancement-management actions to the CoreLib action registry. They can be used in rewards, triggers, scripts, or action templates from other modules to grant, revoke, resync, reset Codex nodes, or show client-only advancement toasts.
This page documents only CoreLib actions registered by EmakiCodex. CoreLib built-in actions are documented in CoreLib Actions.
All Codex actions use emakicodex as their source and codex as their category. Current canonical action IDs use underscores; old hyphenated IDs are no longer the documented form.
Action overview
| Action ID | Description |
|---|---|
codex_grant_advancement | Grants one Codex node to an online player. |
codex_revoke_advancement | Revokes one Codex node from an online player. |
codex_resync_advancement | Re-pushes Codex advancement data to an online player through PacketEvents. |
codex_reset_page | Revokes all completed nodes on one page from an online player. |
codex_reset_all | Revokes all registered Codex nodes from an online player. |
showachievementtoast | Shows a client-side advancement toast without registering or granting a real advancement. |
codex_grant_advancement
Grants one EmakiCodex advancement node to an online player.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
advancement | STRING | Yes | — | Advancement ID. You can use page/node or a full NamespacedKey. |
target | STRING | No | Action context player | Target online player name or UUID. |
actions:
- 'codex_grant_advancement advancement=example/first_step'
- 'codex_grant_advancement advancement=emakicodex:example/challenge target=Steve'Failure cases:
- There is no action-context player and no online
targetis provided. advancementis blank, not registered, or already completed by the player.
codex_revoke_advancement
Revokes one EmakiCodex advancement node from an online player.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
advancement | STRING | Yes | — | Advancement ID. You can use page/node or a full NamespacedKey. |
target | STRING | No | Action context player | Target online player name or UUID. |
actions:
- 'codex_revoke_advancement advancement=example/first_step'
- 'codex_revoke_advancement advancement=emakicodex:example/challenge target=Steve'Failure cases:
- There is no action-context player and no online
targetis provided. advancementis blank, not registered, or not currently completed by the player.
codex_resync_advancement
Re-pushes currently registered Codex advancement data to an online player. This action depends on PacketEvents and fails when PacketEvents is unavailable.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
target | STRING | No | Action context player | Target online player name or UUID. |
actions:
- 'codex_resync_advancement'
- 'codex_resync_advancement target=Steve'Typical uses:
- Refresh the client advancement tree after a configuration reload without requiring a reconnect.
- Refresh display after a custom grant or reset flow.
codex_reset_page
Revokes all registered Codex nodes on one page from an online player. Nodes are revoked in reverse registration order, which is suitable for revoking children before parents.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
page | STRING | Yes | — | Advancement page ID, such as example. |
target | STRING | No | Action context player | Target online player name or UUID. |
actions:
- 'codex_reset_page page=example'
- 'codex_reset_page page=example target=Steve'The result includes mode, page, nodes, and revoked for debugging action execution.
codex_reset_all
Revokes every currently registered Codex node from an online player.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
target | STRING | No | Action context player | Target online player name or UUID. |
actions:
- 'codex_reset_all'
- 'codex_reset_all target=Steve'The result includes mode=all, nodes, and revoked.
showachievementtoast
Shows a client-side advancement toast to the current player without registering, granting, or saving a real advancement. This action requires PacketEvents and a player context.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
title | STRING | Yes | — | Toast title. MiniMessage is supported. |
description | STRING | No | "" | Toast description. MiniMessage is supported. |
icon | STRING | No | minecraft-book | Toast icon item source. CoreLib item-source shorthand is supported; invalid values fall back to a vanilla material. |
frame | STRING | No | task | Toast frame: task, goal, or challenge. |
id | STRING | No | random UUID | Client-side temporary advancement ID, namespaced as emakicodex:toast/<id>. |
remove_delay | TIME | No | 20t | Delay before removing the temporary advancement packet. |
actions:
- 'showachievementtoast title="<gold>Codex discovery</gold>" description="<gray>A new chapter is unlocked</gray>" icon=minecraft-book frame=goal id=codex_discovery remove_delay=20t'Notes
- These actions only operate on online players;
targetcan be an online player name or UUID. - If
targetis omitted, the current CoreLib ActionContext player is used. - Visibility, parent-child relationships, toast behavior, broadcast behavior, and completion actions are still controlled by
advancements/*.yml. codex_resync_advancementandshowachievementtoastrequire PacketEvents; grant/revoke/reset actions do not.- Documentation, examples, and configuration should use only the current underscore canonical IDs and should not continue old hyphenated forms.