Astral Realms Documentation Help

Actions

Actions are executable operations attached anywhere the configuration layer needs to "do something": menu items, menu open/close hooks, dialog buttons, item-pipeline link payloads, collection rewards, chat tag effects, and so on. They are written as strings following the format:

[action-id] <argument> <param=value> ...

Global optional parameters available on every action:

Parameter

Type

Description

delay

long (ticks)

Wait this many ticks before executing. 20 ticks = 1 second.

async

boolean

Run the action on an async thread instead of the main thread. Default false.

actions: LEFT: - "[sound] minecraft:ui.button.click <delay=5>" - "[console] save-all <async=true>"

All argument strings support placeholder substitution (%namespace_key%, %outer_{inner}%, $e(...) — see Placeholders) resolved through the caller's placeholder context.

Command Actions

console

Executes a command as the console (server operator).

- "[console] give %player_name% diamond 1"

player

Executes a command as the clicking player.

- "[player] warp spawn"

Player Actions

message

Sends a chat message to the player. Supports MiniMessage formatting.

- "[message] <green>Welcome, %player_name%!"

actionbar

Displays a message in the player's action bar.

- "[actionbar] <yellow>You have %player_health_rounded% HP"

sound

Plays a sound to the player. Adventure sound key format: namespace:key (volume/pitch are resolved by the Sound adapter when included in the key string).

- "[sound] minecraft:ui.button.click" - "[sound] minecraft:block.note_block.pling"

teleport

Teleports the player to a network location (cross-server aware).

- "[teleport] world,100,64,200"

connect

Transfers the player to another server group (resolved through the network's server registry).

- "[connect] survival"

give-item

Gives an item to the executing player. If a MailboxService is registered the item is delivered to the player's mailbox (giveOrAdd); otherwise it is added to their inventory and any overflow is dropped at their feet.

Arg

Type

Description

item

ItemStack placeholder

Required. A placeholder resolving to an ItemStack (e.g. %parameters_reward%, or a menu's wrapped item form). A plain material name is not accepted — the value must resolve to an item.

amount

int

Optional. Overrides the stack size. Default 1.

- "[give-item] %parameters_reward_item%" - "[give-item] %parameters_reward_item% 16"

Inventory Actions

close

Closes the player's currently open inventory.

- "[close]"

open-menu

Opens a menu by its ID. Parameters can be passed with :key=value syntax separated by colons.

- "[open-menu] shop" - "[open-menu] profile:tab=stats:player=%player_name%"

Parameters become available as %parameters_<key>% placeholders in the opened menu.

open-dialog

Opens a dialog by its ID. Parameters follow the same :key=value syntax as open-menu.

- "[open-dialog] confirm-purchase:item=%parameters_item%"

refresh

Fully recomputes the current menu (re-evaluates all variables, requirements, and items).

- "[refresh]"

refresh-slot

Recomputes a single slot index.

- "[refresh-slot] 22"

refresh-layout

Recomputes a named layout instance.

- "[refresh-layout] items"

refresh-title

Re-evaluates the menu's title blueprint and pushes the new title to every open inventory window for this menu. Useful after a set-variable that the title interpolates, since changing variables alone does not redraw the window chrome.

- "[set-variable] mode pvp" - "[refresh-title]"

Only the title is re-sent; item slots are untouched. Combine with [refresh] if you also need to recompute items.

next-page

Advances the named layout to the next page.

- "[next-page] items"

previous-page

Returns the named layout to the previous page.

- "[previous-page] items"

first-page

Resets the named layout to page 0.

- "[first-page] items"

go-to-page

Jumps the named layout to an explicit page index.

- "[go-to-page] items 3"

Item Actions

These actions are visual / packet-level effects targeting the executing player. They take an item-stack as input (any placeholder that resolves to an ItemStack, including the wrapped form used in menus).

toast

Displays a vanilla advancement toast in the top-right corner using packet-level advancement spoofing — no real advancement is granted. Arguments are parsed as a constructor:

Arg

Type

Description

item

ItemStack placeholder

Icon shown in the toast.

type

AdvancementType

TASK, GOAL, or CHALLENGE (controls border + sound).

title

MiniMessage

Toast title text.

- "[toast] %parameters_reward_item% CHALLENGE <gold>Collection Complete!"

totem-animation

Plays the totem-of-undying animation for the player using the supplied item as the icon, without consuming anything. Internally the action briefly equips the item to the off-hand, fires entity event 35, then restores the original hand contents.

Arg

Type

Description

item

ItemStack placeholder

Item displayed during the animation.

- "[totem-animation] %parameters_unlocked_item%"

Variable Actions

set-variable

Sets or updates a menu variable. The value supports arithmetic ($e(...)) and ternary expressions.

- "[set-variable] page 0" - "[set-variable] count $e(%variables_count%+1)" - "[set-variable] mode %variables_mode% == shop ? pvp : shop"

See Variables for the full expression syntax.

Action Summary Table

ID

Argument

Description

console

command string

Run command as console

player

command string

Run command as player

message

MiniMessage text

Send chat message

actionbar

MiniMessage text

Send action bar message

sound

sound key

Play Adventure sound

teleport

world,x,y,z

Teleport (network-aware)

connect

group name

Send player to a server group

give-item

item [amount]

Give an item to the player (mailbox if available)

close

Close inventory

open-menu

id[:key=val…]

Open menu with params

open-dialog

id[:key=val…]

Open dialog with params

refresh

Recompute full menu

refresh-slot

slot index

Recompute one slot

refresh-layout

layout id

Recompute one layout

refresh-title

Re-send the menu title to all viewers

next-page

layout id

Go to next page

previous-page

layout id

Go to previous page

first-page

layout id

Jump to first page

go-to-page

layout-id page

Jump to explicit page

set-variable

name expression

Set menu variable

toast

item type title

Show advancement toast (icon + title)

totem-animation

item

Play totem-of-undying animation with custom item

Last modified: 25 July 2026