ClientboundUpdateEnabledFeaturesPacket 0x0D

ClientboundUpdateEnabledFeaturesPacket: Minecraft 26.3 packet (0x0D Configuration clientbound).

Minecraft 26.3ConfigurationClientboundnet.minecraft.network.protocol.configuration

Protocol slots (1)

IDdecStateDirectionRegistry
0x0D13CONFIGURATIONClientboundConfigurationPacketTypes.CLIENTBOUND_UPDATE_ENABLED_FEATURES: "update_enabled_features"

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
featuresSet<Identifier>

Fields are the components of the packet record.

Stream codec

static final StreamCodec<ByteBuf, ClientboundUpdateEnabledFeaturesPacket> STREAM_CODEC = StreamCodec.composite( Identifier.STREAM_CODEC.apply(ByteBufCodecs.collection(HashSet::new)), ClientboundUpdate

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

Handling

Resolved on the ClientConfigurationPacketListener packet-listener interface by void handleEnabledFeatures(ClientboundUpdateEnabledFeaturesPacket clientboundupdateenabledfeaturespacket). The implementation in the game is ClientConfigurationPacketListenerImpl.

Full Source

ClientboundUpdateEnabledFeaturesPacket.java28 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.configuration;
2
3
import io.netty.buffer.ByteBuf;
4
import java.util.HashSet;
5
import java.util.Set;
6
import net.minecraft.network.codec.ByteBufCodecs;
7
import net.minecraft.network.codec.StreamCodec;
8
import net.minecraft.network.protocol.Packet;
9
import net.minecraft.network.protocol.PacketType;
10
import net.minecraft.resources.Identifier;
11
12
public record ClientboundUpdateEnabledFeaturesPacket(Set<Identifier> features) implements Packet<ClientConfigurationPacketListener> {
13
	public static final StreamCodec<ByteBuf, ClientboundUpdateEnabledFeaturesPacket> STREAM_CODEC = StreamCodec.composite(
14
		Identifier.STREAM_CODEC.apply(ByteBufCodecs.collection(HashSet::new)),
15
		ClientboundUpdateEnabledFeaturesPacket::features,
16
		ClientboundUpdateEnabledFeaturesPacket::new
17
	);
18
19
	@Override
20
	public PacketType<ClientboundUpdateEnabledFeaturesPacket> type() {
21
		return ConfigurationPacketTypes.CLIENTBOUND_UPDATE_ENABLED_FEATURES;
22
	}
23
24
	public void handle(final ClientConfigurationPacketListener listener) {
25
		listener.handleEnabledFeatures(this);
26
	}
27
}
28