ClientboundDebugBlockValuePacket 0x1A

ClientboundDebugBlockValuePacket: Minecraft 26.3 packet (0x1A Play clientbound). Wire name 'debug/block_value', fields: blockPos, update, handled

Minecraft 26.3PlayClientboundnet.minecraft.network.protocol.game

Protocol slots (1)

IDdecStateDirectionRegistry
0x1A26PLAYClientboundGamePacketTypes.CLIENTBOUND_DEBUG_BLOCK_VALUE: "debug/block_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
blockPosBlockPos
updateDebugSubscription.Update<?>

Fields are the components of the packet record.

Stream codec

static final StreamCodec<RegistryFriendlyByteBuf, ClientboundDebugBlockValuePacket> STREAM_CODEC = StreamCodec.composite( BlockPos.STREAM_CODEC, ClientboundDebugBlockValuePacket::blockPos, DebugSubscr

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

Handling

Resolved on the ClientGamePacketListener packet-listener interface by void handleDebugBlockValue(ClientboundDebugBlockValuePacket clientbounddebugblockvaluepacket). The implementation in the game is ClientPacketListener.

Full Source

ClientboundDebugBlockValuePacket.java28 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.game;
2
3
import net.minecraft.core.BlockPos;
4
import net.minecraft.network.RegistryFriendlyByteBuf;
5
import net.minecraft.network.codec.StreamCodec;
6
import net.minecraft.network.protocol.Packet;
7
import net.minecraft.network.protocol.PacketType;
8
import net.minecraft.util.debug.DebugSubscription;
9
10
public record ClientboundDebugBlockValuePacket(BlockPos blockPos, DebugSubscription.Update<?> update) implements Packet<ClientGamePacketListener> {
11
	public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundDebugBlockValuePacket> STREAM_CODEC = StreamCodec.composite(
12
		BlockPos.STREAM_CODEC,
13
		ClientboundDebugBlockValuePacket::blockPos,
14
		DebugSubscription.Update.STREAM_CODEC,
15
		ClientboundDebugBlockValuePacket::update,
16
		ClientboundDebugBlockValuePacket::new
17
	);
18
19
	@Override
20
	public PacketType<ClientboundDebugBlockValuePacket> type() {
21
		return GamePacketTypes.CLIENTBOUND_DEBUG_BLOCK_VALUE;
22
	}
23
24
	public void handle(final ClientGamePacketListener listener) {
25
		listener.handleDebugBlockValue(this);
26
	}
27
}
28