ClientboundCustomReportDetailsPacket 0x10

ClientboundCustomReportDetailsPacket: Minecraft 26.3 packet (0x10 Configuration clientbound, 0x8B Play clientbound).

Minecraft 26.3ConfigurationClientboundnet.minecraft.network.protocol.common

Protocol slots (2)

IDdecStateDirectionRegistry
0x1016CONFIGURATIONClientboundCommonPacketTypes.CLIENTBOUND_CUSTOM_REPORT_DETAILS: "custom_report_details"
0x8B139PLAYClientboundCommonPacketTypes.CLIENTBOUND_CUSTOM_REPORT_DETAILS: "custom_report_details"

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
Map<String
detailsString>

Fields are the components of the packet record.

Stream codec

static final StreamCodec<ByteBuf, Map<String, String>> DETAILS_STREAM_CODEC = ByteBufCodecs.map( HashMap::new, ByteBufCodecs.stringUtf8(128), ByteBufCodecs.stringUtf8(4096), 32 );

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

Handling

Resolved on the ClientCommonPacketListener packet-listener interface by void handleCustomReportDetails(ClientboundCustomReportDetailsPacket clientboundcustomreportdetailspacket). The implementation in the game is ClientCommonPacketListenerImpl.

Full Source

ClientboundCustomReportDetailsPacket.java31 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.common;
2
3
import io.netty.buffer.ByteBuf;
4
import java.util.HashMap;
5
import java.util.Map;
6
import net.minecraft.network.codec.ByteBufCodecs;
7
import net.minecraft.network.codec.StreamCodec;
8
import net.minecraft.network.protocol.Packet;
9
import net.minecraft.network.protocol.PacketType;
10
11
public record ClientboundCustomReportDetailsPacket(Map<String, String> details) implements Packet<ClientCommonPacketListener> {
12
	private static final int MAX_DETAIL_KEY_LENGTH = 128;
13
	private static final int MAX_DETAIL_VALUE_LENGTH = 4096;
14
	private static final int MAX_DETAIL_COUNT = 32;
15
	private static final StreamCodec<ByteBuf, Map<String, String>> DETAILS_STREAM_CODEC = ByteBufCodecs.map(
16
		HashMap::new, ByteBufCodecs.stringUtf8(128), ByteBufCodecs.stringUtf8(4096), 32
17
	);
18
	public static final StreamCodec<ByteBuf, ClientboundCustomReportDetailsPacket> STREAM_CODEC = StreamCodec.composite(
19
		DETAILS_STREAM_CODEC, ClientboundCustomReportDetailsPacket::details, ClientboundCustomReportDetailsPacket::new
20
	);
21
22
	@Override
23
	public PacketType<ClientboundCustomReportDetailsPacket> type() {
24
		return CommonPacketTypes.CLIENTBOUND_CUSTOM_REPORT_DETAILS;
25
	}
26
27
	public void handle(final ClientCommonPacketListener listener) {
28
		listener.handleCustomReportDetails(this);
29
	}
30
}
31