Package net.fabricmc.fabric.api.client.networking.v1


package net.fabricmc.fabric.api.client.networking.v1
The Networking API (client side), version 1.

There are three stages of Minecraft networking, all of which are supported in this API:

LOGIN
This is the initial stage, before the player logs into the world. If using a proxy server, the packets in this stage may be intercepted and discarded by the proxy. Most of the pre-1.20.2 uses of this event should be replaced with the CONFIGURATION stage. Related events are found at ClientLoginConnectionEvents, and related methods are found at ClientLoginNetworking.
CONFIGURATION
This is the stage after LOGIN. The player is authenticated, but still hasn't joined the world at this point. Clients can use this phase to send configurations or verify their mod versions. Note that some server mods allow players in the PLAY stage to re-enter this stage, for example when a player chooses a minigame server in a lobby. Related events are found at C2SConfigurationChannelEvents and ClientConfigurationConnectionEvents, and related methods are found at ClientConfigurationNetworking.
PLAY
This is the stage after CONFIGURATION, where gameplay-related packets are sent and received. The player has joined the world and is playing the game. Related events are found at C2SPlayChannelEvents and ClientPlayConnectionEvents, and related methods are found at ClientPlayNetworking.