ClientboundServerLinksPacket 0x11

ClientboundServerLinksPacket: Minecraft 26.3 packet (0x11 Configuration clientbound, 0x8C Play clientbound).

Minecraft 26.3ConfigurationClientboundnet.minecraft.network.protocol.common

Protocol slots (2)

IDdecStateDirectionRegistry
0x1117CONFIGURATIONClientboundCommonPacketTypes.CLIENTBOUND_SERVER_LINKS: "server_links"
0x8C140PLAYClientboundCommonPacketTypes.CLIENTBOUND_SERVER_LINKS: "server_links"

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
linksList<ServerLinks.UntrustedEntry>

Fields are the components of the packet record.

Stream codec

static final StreamCodec<ByteBuf, ClientboundServerLinksPacket> STREAM_CODEC = StreamCodec.composite( ServerLinks.UNTRUSTED_LINKS_STREAM_CODEC, ClientboundServerLinksPacket::links, ClientboundServerLi

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

Handling

Resolved on the ClientCommonPacketListener packet-listener interface by void handleServerLinks(ClientboundServerLinksPacket clientboundserverlinkspacket). The implementation in the game is ClientCommonPacketListenerImpl.

Full Source

ClientboundServerLinksPacket.java24 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.common;
2
3
import io.netty.buffer.ByteBuf;
4
import java.util.List;
5
import net.minecraft.network.codec.StreamCodec;
6
import net.minecraft.network.protocol.Packet;
7
import net.minecraft.network.protocol.PacketType;
8
import net.minecraft.server.ServerLinks;
9
10
public record ClientboundServerLinksPacket(List<ServerLinks.UntrustedEntry> links) implements Packet<ClientCommonPacketListener> {
11
	public static final StreamCodec<ByteBuf, ClientboundServerLinksPacket> STREAM_CODEC = StreamCodec.composite(
12
		ServerLinks.UNTRUSTED_LINKS_STREAM_CODEC, ClientboundServerLinksPacket::links, ClientboundServerLinksPacket::new
13
	);
14
15
	@Override
16
	public PacketType<ClientboundServerLinksPacket> type() {
17
		return CommonPacketTypes.CLIENTBOUND_SERVER_LINKS;
18
	}
19
20
	public void handle(final ClientCommonPacketListener listener) {
21
		listener.handleServerLinks(this);
22
	}
23
}
24