ClientboundOpenSignEditorPacket 0x3D

ClientboundOpenSignEditorPacket: Minecraft 26.3 packet (0x3D Play clientbound). Wire name 'open_sign_editor', fields: pos, slot, handled

Minecraft 26.3PlayClientboundnet.minecraft.network.protocol.game

Protocol slots (1)

IDdecStateDirectionRegistry
0x3D61PLAYClientboundGamePacketTypes.CLIENTBOUND_OPEN_SIGN_EDITOR: "open_sign_editor"

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
posBlockPos
slotSignTextSlot

Fields are the components of the packet record.

Stream codec

static final StreamCodec<ByteBuf, ClientboundOpenSignEditorPacket> STREAM_CODEC = StreamCodec.composite( BlockPos.STREAM_CODEC, ClientboundOpenSignEditorPacket::pos, SignTextSlot.STREAM_CODEC, Clientb

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

Handling

Resolved on the ClientGamePacketListener packet-listener interface by void handleOpenSignEditor(ClientboundOpenSignEditorPacket clientboundopensigneditorpacket). The implementation in the game is ClientPacketListener.

Full Source

ClientboundOpenSignEditorPacket.java28 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.game;
2
3
import io.netty.buffer.ByteBuf;
4
import net.minecraft.core.BlockPos;
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.world.level.block.entity.SignTextSlot;
9
10
public record ClientboundOpenSignEditorPacket(BlockPos pos, SignTextSlot slot) implements Packet<ClientGamePacketListener> {
11
	public static final StreamCodec<ByteBuf, ClientboundOpenSignEditorPacket> STREAM_CODEC = StreamCodec.composite(
12
		BlockPos.STREAM_CODEC,
13
		ClientboundOpenSignEditorPacket::pos,
14
		SignTextSlot.STREAM_CODEC,
15
		ClientboundOpenSignEditorPacket::slot,
16
		ClientboundOpenSignEditorPacket::new
17
	);
18
19
	@Override
20
	public PacketType<ClientboundOpenSignEditorPacket> type() {
21
		return GamePacketTypes.CLIENTBOUND_OPEN_SIGN_EDITOR;
22
	}
23
24
	public void handle(final ClientGamePacketListener listener) {
25
		listener.handleOpenSignEditor(this);
26
	}
27
}
28