Skip to content

ShutdownEvent

Package: com.hypixel.hytale.server.core.event.events Implements: IEvent<Void> Cancellable: No

Marker event dispatched during the server shutdown lifecycle. This event carries no data fields but defines static priority constants that govern the ordering of shutdown-phase listeners. Listeners register at specific priority levels to ensure graceful teardown (e.g., disconnecting players before unbinding network listeners).

Because the key type is Void, this event uses class-dispatch shorthand — no event object is constructed.

This event has no instance fields or accessors.

ConstantTypeValueDescription
DISCONNECT_PLAYERSshort-48Priority for listeners that disconnect players during shutdown.
UNBIND_LISTENERSshort-40Priority for listeners that unbind network listeners during shutdown.
SHUTDOWN_WORLDSshort-32Priority for listeners that shut down worlds during shutdown.

These constants define well-known priority values for ordering shutdown-phase listener execution. Lower (more negative) values execute first, ensuring players are disconnected before network listeners are unbound, and network listeners are unbound before worlds are shut down.

  • Dispatched by HytaleServer.shutdown0() (line 440) via eventBus.dispatch(ShutdownEvent.class). Fires during the server shutdown lifecycle using class-dispatch shorthand (no event object is constructed).
// Register at a specific shutdown phase priority
getEventRegistry().register(ShutdownEvent.class, ShutdownEvent.DISCONNECT_PLAYERS, event -> {
// Disconnect all players before other shutdown work
});
getEventRegistry().register(ShutdownEvent.class, ShutdownEvent.UNBIND_LISTENERS, event -> {
// Unbind network listeners after players are disconnected
});
getEventRegistry().register(ShutdownEvent.class, ShutdownEvent.SHUTDOWN_WORLDS, event -> {
// Shut down worlds after network is unbound
});
  • BootEvent — the corresponding lifecycle event fired when the server boots up.