Astral Realms Documentation Help

Commands

Base command: /crate (alias /crates). Every subcommand requires the class-level permission crates.command in addition to its own node — ACF applies @CommandPermission cumulatively, so a sender needs both nodes to run /crate reload.

/crate reload

Syntax

Permission

Description

/crate reload

crates.command + crates.command.reload

Reloads config.yml, every crate definition under crates/, menus, and messages.yml.

onReloadCommand calls AstralCrates#loadConfiguration() directly — the same method run on enable — which re-reads the main configuration, calls CrateService#load() to re-parse the crate files, reloads the menu container, and reloads the CratesMessages enum, in that order (see Load order & reloading). Console and players can both run it. On success it sends a gray "Reloading…" message followed by a green confirmation; if loadConfiguration() throws, it sends a red error message and logs the exception instead.

# /crate reload # Reloading crate configurations... # Crate configurations reloaded successfully.

Reloading does not re-register listeners: the crates-enabled toggle from config.yml is only read once during onEnable(), so flipping it and reloading will not add or remove CrateListener at runtime. See Configuration.

Tab-completion and argument resolution

Two ACF handlers are registered globally in onEnable(), ahead of any command, so they are available to any future or reflectively-invoked command argument of the corresponding type:

Registration

Type

Behavior

registerCompletion("crates", …)

Completion handler

Returns every loaded crate's id (CrateConfiguration::id) as a completion list.

registerContext(CrateConfiguration.class, …)

Context resolver

Pops the first argument, looks it up via CrateService#findById, and throws InvalidCommandArgument ("Crate '<name>' does not exist.") if no crate matches.

CrateCommand currently exposes only reload, which takes no arguments, so neither handler is exercised by this plugin's own command tree today — they exist so a CrateConfiguration parameter (with @CommandCompletion("@crates")) can be added to a future subcommand without extra plumbing.

Giving keys

There is no built-in /crate give (or similar) command. Keys are dispensed entirely through AstralCore's item-supplier system: AstralPaperAPI.registerItemStackSupplier("crates", new CrateItemSupplier(this)) registers the plugin under the crates namespace, so any AstralCore call site that accepts an item-supplier key also accepts crates:<crate-id> — most commonly AstralCore's own /give <player> crates:<crate-id> [amount] command (astralrealms.command.give), or a [give-item] crates:<crate-id> action inside a menu or command config. Either resolves to that crate's key ItemStack (tagged with its astralcrates:crate PDC id). See Developer API for the CrateItemSupplier implementation and AstralCore's item-supplier registry for the general mechanism.

Permission summary

Node

Grants

crates.command

Base node for /crate; required by every subcommand.

crates.command.reload

/crate reload (in addition to crates.command).

Last modified: 25 July 2026