Astral Realms Documentation Help

Events Reference

AstralCore fires the following custom Bukkit events. All events extend org.bukkit.event.Event and are registered on the server's event bus — listen to them with @EventHandler as usual.

Fired on the main thread just before a menu is opened for a player.

Cancellable: Yes — cancelling prevents the menu from opening.

Method

Return type

Description

getMenu()

Menu

The menu instance about to be opened.

getPlayer()

Player

The player the menu is being opened for.

@EventHandler public void onMenuOpen(MenuOpenEvent event) { if (event.getMenu().blueprint().id().equals("admin-panel") && !event.getPlayer().hasPermission("myplugin.admin")) { event.setCancelled(true); } }

Fired on the main thread when a menu is closed.

Cancellable: No.

Method

Return type

Description

getMenu()

Menu

The menu instance that was closed.

getPlayer()

Player

The player who closed the menu.

@EventHandler public void onMenuClose(MenuCloseEvent event) { // Save menu state, cleanup, analytics, etc. }

Fired when a player clicks a MenuItem inside a menu. May fire async (from packet listeners) when using packet-level inventory tracking.

Cancellable: Yes — cancelling prevents the item's actions from executing.

Method

Return type

Description

getMenu()

Menu

The menu containing the clicked item.

getPlayer()

Player

The player who clicked.

getSlot()

int

The raw slot index that was clicked.

getItem()

MenuItem

The MenuItem instance that was resolved for the slot.

@EventHandler public void onItemClick(MenuClickItemEvent event) { if (event.getItem().id().equals("buy-button")) { // custom pre-click logic } }

Player Network Events

These events are fired by PlayerService when the plugin detects a player joining or leaving the network (not just this server). Detection is based on Redis cache updates from all connected servers.

PlayerJoinNetworkEvent

Fired when a player connects to any server on the network.

Cancellable: No.

Method

Return type

Description

getMinecraftPlayer()

MinecraftPlayer

The joining player's network profile.

@EventHandler public void onNetworkJoin(PlayerJoinNetworkEvent event) { MinecraftPlayer mp = event.getMinecraftPlayer(); getLogger().info(mp.name() + " joined the network."); }

PlayerQuitNetworkEvent

Fired when a player disconnects from all servers on the network.

Cancellable: No.

Method

Return type

Description

getMinecraftPlayer()

MinecraftPlayer

The leaving player's network profile.

Event Summary

Event

Thread

Cancellable

Description

MenuOpenEvent

Main

Yes

Menu about to be opened

MenuCloseEvent

Main

No

Menu was closed

MenuClickItemEvent

Main or async

Yes

Item clicked in a menu

PlayerJoinNetworkEvent

Async

No

Player joined the network

PlayerQuitNetworkEvent

Async

No

Player left the network

23 April 2026