Class ClientPlayerNetworkEvent.LoggingOut

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent
net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent.LoggingOut
Enclosing class:
ClientPlayerNetworkEvent

public static class ClientPlayerNetworkEvent.LoggingOut extends ClientPlayerNetworkEvent
Fired when the client player logs out. This event may also fire when a new integrated server is being created.

This event is not

invalid @linkplain
cancellable
, and does not have a result.

This event is fired on the main Forge event bus, only on the logical client.

  • Constructor Details

  • Method Details

    • getMultiPlayerGameMode

      @Nullable public @Nullable MultiPlayerGameMode getMultiPlayerGameMode()
      Returns the multiplayer game mode controller for the player, may be null.. This may be null in certain situations such as the creating a new integrated server (singleplayer world) or connecting to a multiplayer server.
      Overrides:
      getMultiPlayerGameMode in class ClientPlayerNetworkEvent
      Returns:
      the multiplayer game mode controller for the player, may be null
    • getPlayer

      @Nullable public @Nullable LocalPlayer getPlayer()
      Returns the player instance, may be null.. This may be null in certain situations such as the creating a new integrated server (singleplayer world) or connecting to a multiplayer server.
      Overrides:
      getPlayer in class ClientPlayerNetworkEvent
      Returns:
      the player instance, may be null
    • getConnection

      @Nullable public @Nullable Connection getConnection()
      Returns the network connection for the player, may be null.. This may be null in certain situations such as the creating a new integrated server (singleplayer world) or connecting to a multiplayer server.
      Overrides:
      getConnection in class ClientPlayerNetworkEvent
      Returns:
      the network connection for the player, may be null