ClientboundUpdateTagsPacket 0x0E

ClientboundUpdateTagsPacket: Minecraft 26.3 packet (0x0E Configuration clientbound, 0x89 Play clientbound).

Minecraft 26.3ConfigurationClientboundnet.minecraft.network.protocol.common

Protocol slots (2)

IDdecStateDirectionRegistry
0x0E14CONFIGURATIONClientboundCommonPacketTypes.CLIENTBOUND_UPDATE_TAGS: "update_tags"
0x89137PLAYClientboundCommonPacketTypes.CLIENTBOUND_UPDATE_TAGS: "update_tags"

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 (2)

FieldType
Registry<?>>Map<ResourceKey<? extends
tagsTagNetworkSerialization.NetworkPayload>

Fields are the components of the packet record.

Stream codec

static final StreamCodec<ByteBuf, ClientboundUpdateTagsPacket> STREAM_CODEC = StreamCodec.composite( ByteBufCodecs.map(IdentityHashMap::new, ResourceKey.REGISTRY_STREAM_CODEC, TagNetworkSerialization.

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

Handling

Resolved on the ClientCommonPacketListener packet-listener interface by void handleUpdateTags(ClientboundUpdateTagsPacket clientboundupdatetagspacket). The implementation in the game is ClientCommonPacketListenerImpl.

Full Source

ClientboundUpdateTagsPacket.java31 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.common;
2
3
import io.netty.buffer.ByteBuf;
4
import java.util.IdentityHashMap;
5
import java.util.Map;
6
import net.minecraft.core.Registry;
7
import net.minecraft.network.codec.ByteBufCodecs;
8
import net.minecraft.network.codec.StreamCodec;
9
import net.minecraft.network.protocol.Packet;
10
import net.minecraft.network.protocol.PacketType;
11
import net.minecraft.resources.ResourceKey;
12
import net.minecraft.tags.TagNetworkSerialization;
13
14
public record ClientboundUpdateTagsPacket(Map<ResourceKey<? extends Registry<?>>, TagNetworkSerialization.NetworkPayload> tags)
15
	implements Packet<ClientCommonPacketListener> {
16
	public static final StreamCodec<ByteBuf, ClientboundUpdateTagsPacket> STREAM_CODEC = StreamCodec.composite(
17
		ByteBufCodecs.map(IdentityHashMap::new, ResourceKey.REGISTRY_STREAM_CODEC, TagNetworkSerialization.NetworkPayload.STREAM_CODEC),
18
		ClientboundUpdateTagsPacket::tags,
19
		ClientboundUpdateTagsPacket::new
20
	);
21
22
	@Override
23
	public PacketType<ClientboundUpdateTagsPacket> type() {
24
		return CommonPacketTypes.CLIENTBOUND_UPDATE_TAGS;
25
	}
26
27
	public void handle(final ClientCommonPacketListener listener) {
28
		listener.handleUpdateTags(this);
29
	}
30
}
31