ServerboundClientInformationPacket 0x00

ServerboundClientInformationPacket: Minecraft 26.3 packet (0x00 Configuration serverbound, 0x0E Play serverbound).

Minecraft 26.3ConfigurationServerboundnet.minecraft.network.protocol.common

Protocol slots (2)

IDdecStateDirectionRegistry
0x000CONFIGURATIONServerboundCommonPacketTypes.SERVERBOUND_CLIENT_INFORMATION: "client_information"
0x0E14PLAYServerboundCommonPacketTypes.SERVERBOUND_CLIENT_INFORMATION: "client_information"

Packet ids are positional: the id is the index of the addPacket call in the protocol builder (see ProtocolInfoBuilder.listPackets). Ids change between game versions.

Wire fields (1)

FieldType
informationClientInformation

Fields are the components of the packet record.

Stream codec

static final StreamCodec<FriendlyByteBuf, ServerboundClientInformationPacket> STREAM_CODEC = Packet.codec( ServerboundClientInformationPacket::write, ServerboundClientInformationPacket::new );

Modern packets serialize through StreamCodecs instead of read/write methods.

Handling

Resolved on the ServerCommonPacketListener packet-listener interface by void handleClientInformation(ServerboundClientInformationPacket serverboundclientinformationpacket). The implementation in the game is ServerCommonPacketListenerImpl.

Full Source

ServerboundClientInformationPacket.java31 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.common;
2
3
import net.minecraft.network.FriendlyByteBuf;
4
import net.minecraft.network.codec.StreamCodec;
5
import net.minecraft.network.protocol.Packet;
6
import net.minecraft.network.protocol.PacketType;
7
import net.minecraft.server.level.ClientInformation;
8
9
public record ServerboundClientInformationPacket(ClientInformation information) implements Packet<ServerCommonPacketListener> {
10
	public static final StreamCodec<FriendlyByteBuf, ServerboundClientInformationPacket> STREAM_CODEC = Packet.codec(
11
		ServerboundClientInformationPacket::write, ServerboundClientInformationPacket::new
12
	);
13
14
	private ServerboundClientInformationPacket(final FriendlyByteBuf input) {
15
		this(new ClientInformation(input));
16
	}
17
18
	private void write(final FriendlyByteBuf output) {
19
		this.information.write(output);
20
	}
21
22
	@Override
23
	public PacketType<ServerboundClientInformationPacket> type() {
24
		return CommonPacketTypes.SERVERBOUND_CLIENT_INFORMATION;
25
	}
26
27
	public void handle(final ServerCommonPacketListener listener) {
28
		listener.handleClientInformation(this);
29
	}
30
}
31