ServerboundPlayerLoadedPacket 0x2C

ServerboundPlayerLoadedPacket: Minecraft 26.3 packet (0x2C Play serverbound). Wire name 'player_loaded', handled

Minecraft 26.3PlayServerboundnet.minecraft.network.protocol.game

Protocol slots (1)

IDdecStateDirectionRegistry
0x2C44PLAYServerboundGamePacketTypes.SERVERBOUND_PLAYER_LOADED: "player_loaded"

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 (0)

FieldType
No wire fields (marker packet).

Fields are the components of the packet record.

Stream codec

static final StreamCodec<ByteBuf, ServerboundPlayerLoadedPacket> STREAM_CODEC = StreamCodec.unit(new ServerboundPlayerLoadedPacket());

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

Handling

Resolved on the ServerGamePacketListener packet-listener interface by void handleAcceptPlayerLoad(ServerboundPlayerLoadedPacket serverboundplayerloadedpacket). The implementation in the game is ServerGamePacketListenerImpl.

Full Source

ServerboundPlayerLoadedPacket.java20 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.game;
2
3
import io.netty.buffer.ByteBuf;
4
import net.minecraft.network.codec.StreamCodec;
5
import net.minecraft.network.protocol.Packet;
6
import net.minecraft.network.protocol.PacketType;
7
8
public record ServerboundPlayerLoadedPacket() implements Packet<ServerGamePacketListener> {
9
	public static final StreamCodec<ByteBuf, ServerboundPlayerLoadedPacket> STREAM_CODEC = StreamCodec.unit(new ServerboundPlayerLoadedPacket());
10
11
	@Override
12
	public PacketType<ServerboundPlayerLoadedPacket> type() {
13
		return GamePacketTypes.SERVERBOUND_PLAYER_LOADED;
14
	}
15
16
	public void handle(final ServerGamePacketListener listener) {
17
		listener.handleAcceptPlayerLoad(this);
18
	}
19
}
20