Package net.fabricmc.fabric.api.networking.v1
package net.fabricmc.fabric.api.networking.v1
The Networking API, 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
ServerLoginConnectionEvents
, and related methods are found atServerLoginNetworking
. - CONFIGURATION
- This is the stage after LOGIN. The player is authenticated, but still hasn't joined the
world at this point. Servers can use this phase to send configurations or verify client's 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
S2CConfigurationChannelEvents
ServerConfigurationConnectionEvents
, and related methods are found atServerConfigurationNetworking
. - 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
S2CPlayChannelEvents
andServerPlayConnectionEvents
, and related methods are found atServerPlayNetworking
.
In addition, this API includes helpers for registering custom packet payloads and player lookups.
-
ClassDescriptionEvents related to a tracking entities within a player's view distance.Fabric-provided extensions for
ServerConfigurationNetworkHandler
.Represents something that supports sending packets to login channels.Helper methods for working with and creatingPacketByteBuf
s.Represents something that supports sending packets to channels.PayloadTypeRegistry<B extends PacketByteBuf>A registry for payload types.Helper methods to lookup players in a server.Offers access to events related to the indication of a connected client's ability to receive packets in certain channels.Offers access to events related to the indication of a connected client's ability to receive packets in certain channels.Offers access to events related to the connection to a client on a logical server while a client is configuring.Offers access to configuration stage server-side networking functionalities.A packet handler utilizingCustomPayload
.Offers access to events related to the connection to a client on a logical server while a client is logging in.Offers access to login stage server-side networking functionalities.Allows blocking client log-in until all futures passed intoServerLoginNetworking.LoginSynchronizer.waitFor(Future)
are completed.Offers access to events related to the connection to a client on a logical server while a client is in game.Offers access to play stage server-side networking functionalities.A thread-safe packet handler utilizingCustomPayload
.