ClientboundDebugChunkValuePacket 0x1B

ClientboundDebugChunkValuePacket: Minecraft 26.3 packet (0x1B Play clientbound). Wire name 'debug/chunk_value', fields: chunkPos, update, handled

Minecraft 26.3PlayClientboundnet.minecraft.network.protocol.game

Protocol slots (1)

IDdecStateDirectionRegistry
0x1B27PLAYClientboundGamePacketTypes.CLIENTBOUND_DEBUG_CHUNK_VALUE: "debug/chunk_value"

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
chunkPosChunkPos
updateDebugSubscription.Update<?>

Fields are the components of the packet record.

Stream codec

static final StreamCodec<RegistryFriendlyByteBuf, ClientboundDebugChunkValuePacket> STREAM_CODEC = StreamCodec.composite( ChunkPos.STREAM_CODEC, ClientboundDebugChunkValuePacket::chunkPos, DebugSubscr

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

Handling

Resolved on the ClientGamePacketListener packet-listener interface by void handleDebugChunkValue(ClientboundDebugChunkValuePacket clientbounddebugchunkvaluepacket). The implementation in the game is ClientPacketListener.

Full Source

ClientboundDebugChunkValuePacket.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.codec.StreamCodec;
5
import net.minecraft.network.protocol.Packet;
6
import net.minecraft.network.protocol.PacketType;
7
import net.minecraft.util.debug.DebugSubscription;
8
import net.minecraft.world.level.ChunkPos;
9
10
public record ClientboundDebugChunkValuePacket(ChunkPos chunkPos, DebugSubscription.Update<?> update) implements Packet<ClientGamePacketListener> {
11
	public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundDebugChunkValuePacket> STREAM_CODEC = StreamCodec.composite(
12
		ChunkPos.STREAM_CODEC,
13
		ClientboundDebugChunkValuePacket::chunkPos,
14
		DebugSubscription.Update.STREAM_CODEC,
15
		ClientboundDebugChunkValuePacket::update,
16
		ClientboundDebugChunkValuePacket::new
17
	);
18
19
	@Override
20
	public PacketType<ClientboundDebugChunkValuePacket> type() {
21
		return GamePacketTypes.CLIENTBOUND_DEBUG_CHUNK_VALUE;
22
	}
23
24
	public void handle(final ClientGamePacketListener listener) {
25
		listener.handleDebugChunkValue(this);
26
	}
27
}
28