Skip to content

PlayerSetupDisconnectEvent

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

Dispatched when a player disconnects during the setup phase, before a player entity has been created. This covers disconnects that occur after authentication but before the connection flow reaches PlayerConnectEvent. Because no player entity exists at this point, only lightweight identity fields (username, UUID, auth) are available.

This event is the setup-phase counterpart to PlayerDisconnectEvent, which handles disconnects after the player entity is fully created.

Because the key type is Void, this event is dispatched globally — all registered listeners receive it regardless of key.

FieldTypeAccessorMutableNotes
usernameStringgetUsername()NoThe disconnecting player’s username.
uuidUUIDgetUuid()NoThe disconnecting player’s UUID.
authPlayerAuthenticationgetAuth()NoAuthentication data for the disconnecting player.
disconnectReasonPacketHandler.DisconnectReasongetDisconnectReason()NoThe reason for the disconnect.
  • Dispatched by SetupPacketHandler (line 198) via eventBus.dispatch() when a player disconnects during the setup phase before entity creation.
getEventRegistry().register(PlayerSetupDisconnectEvent.class, event -> {
String name = event.getUsername();
UUID id = event.getUuid();
PacketHandler.DisconnectReason reason = event.getDisconnectReason();
// Handle early-phase disconnect (no player entity available)
});
  • PlayerSetupConnectEvent — the setup-phase connection event. This disconnect event is the inverse of PlayerSetupConnectEvent.
  • PlayerDisconnectEvent — fired when a fully connected player disconnects (after entity creation). Use this for post-setup disconnects.