Skip to content

Event System

The Hytale server implements an event system that allows mods to react to game events, modify behavior, and communicate with each other.

The system is built around a central EventBus that manages event registration and dispatch. Events can be:

  • Synchronous (IEvent) - Handlers called immediately in priority order
  • Asynchronous (IAsyncEvent) - Handlers use CompletableFuture for async processing
  • Cancellable (ICancellable) - Handlers can prevent the action from occurring
  • Keyed - Events filtered by key (world name, asset type, etc.)
TaskGuide
Listen for eventsListening to Events
Create custom eventsCreating Custom Events
Dispatch eventsDispatching Events
Event referenceEvent Reference
  1. Event Created - Code creates an event instance
  2. Dispatcher Obtained - eventBus.dispatchFor(EventClass.class) or with key
  3. Dispatch - dispatcher.dispatch(event) calls handlers in priority order
  4. Keyed Matching - For keyed events, only matching listeners are called
  5. Global Fallback - Global listeners receive all keyed events
  6. Unhandled Fallback - Unhandled listeners only called if no keyed match
  7. Result - For cancellable events, check event.isCancelled()

Built-in events by package:

PackageDescription
com.hypixel.hytale.assetstore.eventAsset loading and hot-reload
com.hypixel.hytale.server.core.event.eventsCore server (boot, shutdown)
com.hypixel.hytale.server.core.event.events.ecsBlock/item interactions
com.hypixel.hytale.server.core.event.events.entityEntity lifecycle
com.hypixel.hytale.server.core.event.events.permissionsPermission changes
com.hypixel.hytale.server.core.event.events.playerPlayer actions
com.hypixel.hytale.server.core.plugin.eventPlugin lifecycle
com.hypixel.hytale.server.core.prefab.eventPrefab paste/place
com.hypixel.hytale.server.core.universe.world.eventsWorld and chunks

See the Event Reference for a complete list of all events.