ServerboundPaddleBoatPacket 0x23

ServerboundPaddleBoatPacket: Minecraft 26.3 packet (0x23 Play serverbound). Wire name 'paddle_boat', fields: left, right, handled

Minecraft 26.3PlayServerboundnet.minecraft.network.protocol.game

Protocol slots (1)

IDdecStateDirectionRegistry
0x2335PLAYServerboundGamePacketTypes.SERVERBOUND_PADDLE_BOAT: "paddle_boat"

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
leftboolean
rightboolean

Stream codec

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

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

Handling

Resolved on the ServerGamePacketListener packet-listener interface by void handlePaddleBoat(ServerboundPaddleBoatPacket serverboundpaddleboatpacket). The implementation in the game is ServerGamePacketListenerImpl.

Full Source

ServerboundPaddleBoatPacket.java47 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.game;
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
8
public class ServerboundPaddleBoatPacket implements Packet<ServerGamePacketListener> {
9
	public static final StreamCodec<FriendlyByteBuf, ServerboundPaddleBoatPacket> STREAM_CODEC = Packet.codec(
10
		ServerboundPaddleBoatPacket::write, ServerboundPaddleBoatPacket::new
11
	);
12
	private final boolean left;
13
	private final boolean right;
14
15
	public ServerboundPaddleBoatPacket(final boolean left, final boolean right) {
16
		this.left = left;
17
		this.right = right;
18
	}
19
20
	private ServerboundPaddleBoatPacket(final FriendlyByteBuf input) {
21
		this.left = input.readBoolean();
22
		this.right = input.readBoolean();
23
	}
24
25
	private void write(final FriendlyByteBuf output) {
26
		output.writeBoolean(this.left);
27
		output.writeBoolean(this.right);
28
	}
29
30
	public void handle(final ServerGamePacketListener listener) {
31
		listener.handlePaddleBoat(this);
32
	}
33
34
	@Override
35
	public PacketType<ServerboundPaddleBoatPacket> type() {
36
		return GamePacketTypes.SERVERBOUND_PADDLE_BOAT;
37
	}
38
39
	public boolean getLeft() {
40
		return this.left;
41
	}
42
43
	public boolean getRight() {
44
		return this.right;
45
	}
46
}
47