Astral Realms Documentation Help

Actions

AstralVote#onEnable registers two AstralCore actions with registerActionGlobally, so both are callable from any plugin's menu/dialog/action-list configuration, not just AstralVote's own.

this.registerActionGlobally("claim-vote", ClaimVoteAction.class); this.registerActionGlobally("toggle-votes-reminders", ToggleVoteRemindersAction.class);

Neither action takes arguments; both always act on context.executor().

claim-vote

Claims all of the executor's unclaimed votes, wrapping VoteService#claimVote.

Arg

Type

Description

(none)

Acts on the executor.

- "[claim-vote]"

If a claim is already in progress for the player, a second invocation is silently ignored. Otherwise it re-fetches unclaimed votes from the database; with none, sends NO_PENDING_VOTES. Otherwise it marks every unclaimed vote processed in a batch update, then — back on the main thread — runs the configured claim-actions list once per claimed vote (three unclaimed votes claimed at once runs the whole list three times) and sends VOTE_CLAIMED with %amount% set to the number of votes claimed. A database failure during the update rolls back both the vote rows and the in-memory unclaimed-vote cache, and sends UNEXPECTED_ERROR. See Claiming votes.

toggle-votes-reminders

Flips the executor's vote-reminder preference, wrapping their VotePlayerData.

Arg

Type

Description

(none)

Acts on the executor.

- "[toggle-votes-reminders]"

Looks up the executor's VotePlayerData via SyncAPI#findData; if it isn't loaded yet, throws an unhandled IllegalStateException — no player-facing message is sent in that case. Otherwise it inverts voteRemindersEnabled and sends REMINDERS_ENABLED or REMINDERS_DISABLED to match the new state. The resulting state is exposed back for rendering a toggle button via %votes_remindersEnabled% — see Placeholders.

Action Summary Table

ID

Scope

Arguments

Effect

claim-vote

Global

(none)

Claims all of the executor's unclaimed votes and runs claim-actions once per claimed vote.

toggle-votes-reminders

Global

(none)

Toggles the executor's vote-reminder preference.

See also

  • AstralCore Actions — the [action-id] <argument> <param=value> syntax and global delay/async parameters shared by every action on the network.

  • Configuration — the claim-actions list claim-vote runs.

  • Overview — the full claim flow.

  • Placeholders%votes_unclaimed%, %votes_weekly%, %votes_remindersEnabled%.

Last modified: 25 July 2026