Skip to content

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 IDDescription
codex_grant_advancementGrants one Codex node to an online player.
codex_revoke_advancementRevokes one Codex node from an online player.
codex_resync_advancementRe-pushes Codex advancement data to an online player through PacketEvents.
codex_reset_pageRevokes all completed nodes on one page from an online player.
codex_reset_allRevokes all registered Codex nodes from an online player.
showachievementtoastShows a client-side advancement toast without registering or granting a real advancement.

codex_grant_advancement

Grants one EmakiCodex advancement node to an online player.

ParameterTypeRequiredDefaultDescription
advancementSTRINGYesAdvancement ID. You can use page/node or a full NamespacedKey.
targetSTRINGNoAction context playerTarget online player name or UUID.
yaml
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 target is provided.
  • advancement is blank, not registered, or already completed by the player.

codex_revoke_advancement

Revokes one EmakiCodex advancement node from an online player.

ParameterTypeRequiredDefaultDescription
advancementSTRINGYesAdvancement ID. You can use page/node or a full NamespacedKey.
targetSTRINGNoAction context playerTarget online player name or UUID.
yaml
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 target is provided.
  • advancement is 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.

ParameterTypeRequiredDefaultDescription
targetSTRINGNoAction context playerTarget online player name or UUID.
yaml
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.

ParameterTypeRequiredDefaultDescription
pageSTRINGYesAdvancement page ID, such as example.
targetSTRINGNoAction context playerTarget online player name or UUID.
yaml
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.

ParameterTypeRequiredDefaultDescription
targetSTRINGNoAction context playerTarget online player name or UUID.
yaml
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.

ParameterTypeRequiredDefaultDescription
titleSTRINGYesToast title. MiniMessage is supported.
descriptionSTRINGNo""Toast description. MiniMessage is supported.
iconSTRINGNominecraft-bookToast icon item source. CoreLib item-source shorthand is supported; invalid values fall back to a vanilla material.
frameSTRINGNotaskToast frame: task, goal, or challenge.
idSTRINGNorandom UUIDClient-side temporary advancement ID, namespaced as emakicodex:toast/<id>.
remove_delayTIMENo20tDelay before removing the temporary advancement packet.
yaml
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; target can be an online player name or UUID.
  • If target is 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_advancement and showachievementtoast require 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.