ClientboundDebugEventPacket 0x1D

ClientboundDebugEventPacket: Minecraft 26.3 packet (0x1D Play clientbound). Wire name 'debug/event', fields: event, handled

Minecraft 26.3PlayClientboundnet.minecraft.network.protocol.game

Protocol slots (1)

IDdecStateDirectionRegistry
0x1D29PLAYClientboundGamePacketTypes.CLIENTBOUND_DEBUG_EVENT: "debug/event"

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
eventDebugSubscription.Event<?>

Fields are the components of the packet record.

Stream codec

static final StreamCodec<RegistryFriendlyByteBuf, ClientboundDebugEventPacket> STREAM_CODEC = StreamCodec.composite( DebugSubscription.Event.STREAM_CODEC, ClientboundDebugEventPacket::event, Clientbou

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

Handling

Resolved on the ClientGamePacketListener packet-listener interface by void handleDebugEvent(ClientboundDebugEventPacket clientbounddebugeventpacket). The implementation in the game is ClientPacketListener.

Full Source

ClientboundDebugEventPacket.java23 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.codec.StreamCodec;
5
import net.minecraft.network.protocol.Packet;
6
import net.minecraft.network.protocol.PacketType;
7
import net.minecraft.util.debug.DebugSubscription;
8
9
public record ClientboundDebugEventPacket(DebugSubscription.Event<?> event) implements Packet<ClientGamePacketListener> {
10
	public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundDebugEventPacket> STREAM_CODEC = StreamCodec.composite(
11
		DebugSubscription.Event.STREAM_CODEC, ClientboundDebugEventPacket::event, ClientboundDebugEventPacket::new
12
	);
13
14
	@Override
15
	public PacketType<ClientboundDebugEventPacket> type() {
16
		return GamePacketTypes.CLIENTBOUND_DEBUG_EVENT;
17
	}
18
19
	public void handle(final ClientGamePacketListener listener) {
20
		listener.handleDebugEvent(this);
21
	}
22
}
23