ClientboundSelectKnownPacks 0x0F

ClientboundSelectKnownPacks: Minecraft 26.3 packet (0x0F Configuration clientbound). Wire name 'select_known_packs', fields: knownPacks, handled

Minecraft 26.3ConfigurationClientboundnet.minecraft.network.protocol.configuration

Protocol slots (1)

IDdecStateDirectionRegistry
0x0F15CONFIGURATIONClientboundConfigurationPacketTypes.CLIENTBOUND_SELECT_KNOWN_PACKS: "select_known_packs"

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
knownPacksList<KnownPack>

Fields are the components of the packet record.

Stream codec

static final StreamCodec<ByteBuf, ClientboundSelectKnownPacks> STREAM_CODEC = StreamCodec.composite( KnownPack.STREAM_CODEC.apply(ByteBufCodecs.list()), ClientboundSelectKnownPacks::knownPacks, Client

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

Handling

Resolved on the ClientConfigurationPacketListener packet-listener interface by void handleSelectKnownPacks(ClientboundSelectKnownPacks clientboundselectknownpacks). The implementation in the game is ClientConfigurationPacketListenerImpl.

Full Source

ClientboundSelectKnownPacks.java25 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.configuration;
2
3
import io.netty.buffer.ByteBuf;
4
import java.util.List;
5
import net.minecraft.network.codec.ByteBufCodecs;
6
import net.minecraft.network.codec.StreamCodec;
7
import net.minecraft.network.protocol.Packet;
8
import net.minecraft.network.protocol.PacketType;
9
import net.minecraft.server.packs.repository.KnownPack;
10
11
public record ClientboundSelectKnownPacks(List<KnownPack> knownPacks) implements Packet<ClientConfigurationPacketListener> {
12
	public static final StreamCodec<ByteBuf, ClientboundSelectKnownPacks> STREAM_CODEC = StreamCodec.composite(
13
		KnownPack.STREAM_CODEC.apply(ByteBufCodecs.list()), ClientboundSelectKnownPacks::knownPacks, ClientboundSelectKnownPacks::new
14
	);
15
16
	@Override
17
	public PacketType<ClientboundSelectKnownPacks> type() {
18
		return ConfigurationPacketTypes.CLIENTBOUND_SELECT_KNOWN_PACKS;
19
	}
20
21
	public void handle(final ClientConfigurationPacketListener listener) {
22
		listener.handleSelectKnownPacks(this);
23
	}
24
}
25