ClientboundDebugEntityValuePacket 0x1C

ClientboundDebugEntityValuePacket: Minecraft 26.3 packet (0x1C Play clientbound). Wire name 'debug/entity_value', fields: entityId, update, handled

Minecraft 26.3PlayClientboundnet.minecraft.network.protocol.game

Protocol slots (1)

IDdecStateDirectionRegistry
0x1C28PLAYClientboundGamePacketTypes.CLIENTBOUND_DEBUG_ENTITY_VALUE: "debug/entity_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
entityIdint
updateDebugSubscription.Update<?>

Fields are the components of the packet record.

Stream codec

static final StreamCodec<RegistryFriendlyByteBuf, ClientboundDebugEntityValuePacket> STREAM_CODEC = StreamCodec.composite( ByteBufCodecs.VAR_INT, ClientboundDebugEntityValuePacket::entityId, DebugSubs

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

Handling

Resolved on the ClientGamePacketListener packet-listener interface by void handleDebugEntityValue(ClientboundDebugEntityValuePacket clientbounddebugentityvaluepacket). The implementation in the game is ClientPacketListener.

Full Source

ClientboundDebugEntityValuePacket.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.ByteBufCodecs;
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 ClientboundDebugEntityValuePacket(int entityId, DebugSubscription.Update<?> update) implements Packet<ClientGamePacketListener> {
11
	public static final StreamCodec<RegistryFriendlyByteBuf, ClientboundDebugEntityValuePacket> STREAM_CODEC = StreamCodec.composite(
12
		ByteBufCodecs.VAR_INT,
13
		ClientboundDebugEntityValuePacket::entityId,
14
		DebugSubscription.Update.STREAM_CODEC,
15
		ClientboundDebugEntityValuePacket::update,
16
		ClientboundDebugEntityValuePacket::new
17
	);
18
19
	@Override
20
	public PacketType<ClientboundDebugEntityValuePacket> type() {
21
		return GamePacketTypes.CLIENTBOUND_DEBUG_ENTITY_VALUE;
22
	}
23
24
	public void handle(final ClientGamePacketListener listener) {
25
		listener.handleDebugEntityValue(this);
26
	}
27
}
28