Class ClientPlayerNetworkEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.client.event.ClientPlayerNetworkEvent
- Direct Known Subclasses:
ClientPlayerNetworkEvent.Clone
,ClientPlayerNetworkEvent.LoggingIn
,ClientPlayerNetworkEvent.LoggingOut
public abstract class ClientPlayerNetworkEvent
extends net.neoforged.bus.api.Event
Fired for different client connectivity events.
See the various subclasses to listen for specific events.
These events are fired on the main Forge event bus, only on the logical client.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Fired when the client player respawns, creating a new player instance to replace the old player instance.static class
Fired when the client player logs in to the server.static class
Fired when the client player logs out. -
Field Summary
Modifier and TypeFieldDescriptionprivate final Connection
private final MultiPlayerGameMode
private final LocalPlayer
-
Constructor Summary
ModifierConstructorDescriptionprotected
ClientPlayerNetworkEvent
(MultiPlayerGameMode multiPlayerGameMode, LocalPlayer player, Connection connection) -
Method Summary
Modifier and TypeMethodDescriptionReturns the network connection for the player.Returns the multiplayer game mode controller for the player.Returns the player instance.
-
Field Details
-
multiPlayerGameMode
-
player
-
connection
-
-
Constructor Details
-
ClientPlayerNetworkEvent
@Internal protected ClientPlayerNetworkEvent(MultiPlayerGameMode multiPlayerGameMode, LocalPlayer player, Connection connection)
-
-
Method Details
-
getMultiPlayerGameMode
Returns the multiplayer game mode controller for the player.- Returns:
- the multiplayer game mode controller for the player
-
getPlayer
Returns the player instance.- Returns:
- the player instance
-
getConnection
Returns the network connection for the player.- Returns:
- the network connection for the player
-