ClientboundCookieRequestPacket 0x00

ClientboundCookieRequestPacket: Minecraft 26.3 packet (0x00 Configuration clientbound, 0x15 Play clientbound, 0x05 Login clientbound).

Minecraft 26.3ConfigurationClientboundnet.minecraft.network.protocol.cookie

Protocol slots (3)

IDdecStateDirectionRegistry
0x000CONFIGURATIONClientboundCookiePacketTypes.CLIENTBOUND_COOKIE_REQUEST: "cookie_request"
0x1521PLAYClientboundCookiePacketTypes.CLIENTBOUND_COOKIE_REQUEST: "cookie_request"
0x055LOGINClientboundCookiePacketTypes.CLIENTBOUND_COOKIE_REQUEST: "cookie_request"

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
keyIdentifier

Fields are the components of the packet record.

Stream codec

static final StreamCodec<FriendlyByteBuf, ClientboundCookieRequestPacket> STREAM_CODEC = Packet.codec( ClientboundCookieRequestPacket::write, ClientboundCookieRequestPacket::new );

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

Handling

Resolved on the ClientCookiePacketListener packet-listener interface by void handleRequestCookie(ClientboundCookieRequestPacket clientboundcookierequestpacket). The implementation in the game is ClientCommonPacketListenerImpl.

Full Source

ClientboundCookieRequestPacket.java31 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.cookie;
2
3
import net.minecraft.network.FriendlyByteBuf;
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.resources.Identifier;
8
9
public record ClientboundCookieRequestPacket(Identifier key) implements Packet<ClientCookiePacketListener> {
10
	public static final StreamCodec<FriendlyByteBuf, ClientboundCookieRequestPacket> STREAM_CODEC = Packet.codec(
11
		ClientboundCookieRequestPacket::write, ClientboundCookieRequestPacket::new
12
	);
13
14
	private ClientboundCookieRequestPacket(final FriendlyByteBuf input) {
15
		this(input.readIdentifier());
16
	}
17
18
	private void write(final FriendlyByteBuf output) {
19
		output.writeIdentifier(this.key);
20
	}
21
22
	@Override
23
	public PacketType<ClientboundCookieRequestPacket> type() {
24
		return CookiePacketTypes.CLIENTBOUND_COOKIE_REQUEST;
25
	}
26
27
	public void handle(final ClientCookiePacketListener listener) {
28
		listener.handleRequestCookie(this);
29
	}
30
}
31