ClientboundDeleteChatPacket 0x1F

ClientboundDeleteChatPacket: Minecraft 26.3 packet (0x1F Play clientbound). Wire name 'delete_chat', fields: messageSignature, handled

Minecraft 26.3PlayClientboundnet.minecraft.network.protocol.game

Protocol slots (1)

IDdecStateDirectionRegistry
0x1F31PLAYClientboundGamePacketTypes.CLIENTBOUND_DELETE_CHAT: "delete_chat"

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
messageSignatureMessageSignature.Packed

Fields are the components of the packet record.

Stream codec

static final StreamCodec<ByteBuf, ClientboundDeleteChatPacket> STREAM_CODEC = StreamCodec.composite( MessageSignature.Packed.STREAM_CODEC, ClientboundDeleteChatPacket::messageSignature, ClientboundDel

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

Handling

Resolved on the ClientGamePacketListener packet-listener interface by void handleDeleteChat(ClientboundDeleteChatPacket clientbounddeletechatpacket). The implementation in the game is ClientPacketListener.

Full Source

ClientboundDeleteChatPacket.java23 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.game;
2
3
import io.netty.buffer.ByteBuf;
4
import net.minecraft.network.chat.MessageSignature;
5
import net.minecraft.network.codec.StreamCodec;
6
import net.minecraft.network.protocol.Packet;
7
import net.minecraft.network.protocol.PacketType;
8
9
public record ClientboundDeleteChatPacket(MessageSignature.Packed messageSignature) implements Packet<ClientGamePacketListener> {
10
	public static final StreamCodec<ByteBuf, ClientboundDeleteChatPacket> STREAM_CODEC = StreamCodec.composite(
11
		MessageSignature.Packed.STREAM_CODEC, ClientboundDeleteChatPacket::messageSignature, ClientboundDeleteChatPacket::new
12
	);
13
14
	@Override
15
	public PacketType<ClientboundDeleteChatPacket> type() {
16
		return GamePacketTypes.CLIENTBOUND_DELETE_CHAT;
17
	}
18
19
	public void handle(final ClientGamePacketListener listener) {
20
		listener.handleDeleteChat(this);
21
	}
22
}
23