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
Nested ClassesModifier and TypeClassDescriptionstatic classFired when the client player respawns, creating a new player instance to replace the old player instance.static classFired when the client player logs in to the server.static classFired when the client player logs out. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Connectionprivate final MultiPlayerGameModeprivate final LocalPlayer -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedClientPlayerNetworkEvent(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
-