Skip to content

AddPlayerToWorldEvent

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

Dispatched when a player enters a world. This event fires both during the initial connection flow (after PlayerConnectEvent) and whenever a player is transferred between worlds.

The broadcastJoinMessage field controls whether a join message is broadcast to other players in the world. It defaults to true and can be set to false to suppress the message.

Because the key type is String, this event supports keyed dispatch. Listeners can register for a specific key or use registerGlobal() to receive all dispatches.

FieldTypeAccessorMutableNotes
holderHolder<EntityStore>getHolder()NoThe entity holder for the player entering the world.
worldWorldgetWorld()NoThe world the player is entering.
broadcastJoinMessagebooleanshouldBroadcastJoinMessage()YesWhether to broadcast a join message. Default: true.
  • Dispatched by World.addPlayer() (line 810) via eventBus.dispatchFor() using keyed dispatch when a player enters a world.
// Listen globally for all world joins
getEventRegistry().registerGlobal(AddPlayerToWorldEvent.class, event -> {
World world = event.getWorld();
boolean announce = event.shouldBroadcastJoinMessage();
// Handle player entering a world
});
  • DrainPlayerFromWorldEvent — the counterpart event fired when a player leaves a world. This event and DrainPlayerFromWorldEvent are inverses.
  • PlayerConnectEvent — fired before this event during the initial connection flow. Previous step in the connection flow.
  • PlayerReadyEvent — fired after this event when the player signals readiness. Next step in the connection flow.
PlayerSetupConnectEvent --> PlayerConnectEvent --> AddPlayerToWorldEvent --> PlayerReadyEvent