Core Server Events
Package: com.hypixel.hytale.server.core.event.events
These are the fundamental server lifecycle events.
BootEvent
Section titled “BootEvent”Fired when the server has finished booting and is ready to accept connections.
Class: com.hypixel.hytale.server.core.event.events.BootEvent
| Property | Value |
|---|---|
| Implements | IEvent<Void> |
| Async | No |
| Cancellable | No |
| KeyType | Void |
Fields
Section titled “Fields”None - this is a simple marker event.
When Fired
Section titled “When Fired”Fired once during server startup, after all systems are initialized but before accepting player connections.
ShutdownEvent
Section titled “ShutdownEvent”Fired when the server is shutting down. Handlers should clean up resources.
Class: com.hypixel.hytale.server.core.event.events.ShutdownEvent
| Property | Value |
|---|---|
| Implements | IEvent<Void> |
| Async | No |
| Cancellable | No |
| KeyType | Void |
Fields
Section titled “Fields”None - this is a simple marker event.
Priority Constants
Section titled “Priority Constants”The ShutdownEvent class defines priority constants for ordered shutdown:
| Constant | Value | Purpose |
|---|---|---|
DISCONNECT_PLAYERS | -48 | Disconnect players first |
UNBIND_LISTENERS | -40 | Unbind network listeners |
SHUTDOWN_WORLDS | -32 | Shutdown world processing |
When Fired
Section titled “When Fired”Fired when the server receives a shutdown signal (command, SIGTERM, etc.).
Example
Section titled “Example”// handle shutdown before worlds are stoppedevents.register(ShutdownEvent.SHUTDOWN_WORLDS + 1, ShutdownEvent.class, event -> { saveAllPlayerData();});
// handle shutdown after worlds are stoppedevents.register(ShutdownEvent.SHUTDOWN_WORLDS - 1, ShutdownEvent.class, event -> { closeConnections(); releaseResources();});PrepareUniverseEvent
Section titled “PrepareUniverseEvent”Deprecated: This event is deprecated and may be removed in future versions.
Fired during the universe preparation phase, before worlds are loaded.
Class: com.hypixel.hytale.server.core.event.events.PrepareUniverseEvent
| Property | Value |
|---|---|
| Implements | IEvent<Void> |
| Async | No |
| Cancellable | No |
| KeyType | Void |
Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
worldConfigProvider | WorldConfigProvider | Provider for world configuration |
Methods
Section titled “Methods”| Method | Return Type | Description |
|---|---|---|
getWorldConfigProvider() | WorldConfigProvider | Gets the world configuration provider |
setWorldConfigProvider(WorldConfigProvider) | void | Sets the world configuration provider |
When Fired
Section titled “When Fired”Fired during server startup, after basic initialization but before worlds are created/loaded.