ClientboundTabListPacket 0x7D

ClientboundTabListPacket: Minecraft 26.3 packet (0x7D Play clientbound). Wire name 'tab_list', fields: header, footer, handled

Minecraft 26.3PlayClientboundnet.minecraft.network.protocol.game

Protocol slots (1)

IDdecStateDirectionRegistry
0x7D125PLAYClientboundGamePacketTypes.CLIENTBOUND_TAB_LIST: "tab_list"

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
headerComponent
footerComponent

Fields are the components of the packet record.

Stream codec

static final StreamCodec<RegistryFriendlyByteBuf, ClientboundTabListPacket> STREAM_CODEC = StreamCodec.composite( ComponentSerialization.TRUSTED_STREAM_CODEC, ClientboundTabListPacket::header, Compone

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

Handling

Resolved on the ClientGamePacketListener packet-listener interface by void handleTabListCustomisation(ClientboundTabListPacket clientboundtablistpacket). The implementation in the game is ClientPacketListener.

Full Source

ClientboundTabListPacket.java28 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.game;
2
3
import net.minecraft.network.RegistryFriendlyByteBuf;
4
import net.minecraft.network.chat.Component;
5
import net.minecraft.network.chat.ComponentSerialization;
6
import net.minecraft.network.codec.StreamCodec;
7
import net.minecraft.network.protocol.Packet;
8
import net.minecraft.network.protocol.PacketType;
9
10
public record ClientboundTabListPacket(Component header, Component footer) implements Packet<ClientGamePacketListener> {
11
	public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundTabListPacket> STREAM_CODEC = StreamCodec.composite(
12
		ComponentSerialization.TRUSTED_STREAM_CODEC,
13
		ClientboundTabListPacket::header,
14
		ComponentSerialization.TRUSTED_STREAM_CODEC,
15
		ClientboundTabListPacket::footer,
16
		ClientboundTabListPacket::new
17
	);
18
19
	@Override
20
	public PacketType<ClientboundTabListPacket> type() {
21
		return GamePacketTypes.CLIENTBOUND_TAB_LIST;
22
	}
23
24
	public void handle(final ClientGamePacketListener listener) {
25
		listener.handleTabListCustomisation(this);
26
	}
27
}
28