ClientboundPostEffectsPacket 0x0A

ClientboundPostEffectsPacket: Minecraft 26.3 packet (0x0A Configuration clientbound, 0x53 Play clientbound).

Minecraft 26.3ConfigurationClientboundnet.minecraft.network.protocol.common

Protocol slots (2)

IDdecStateDirectionRegistry
0x0A10CONFIGURATIONClientboundCommonPacketTypes.CLIENTBOUND_POST_EFFECTS: "post_effects"
0x5383PLAYClientboundCommonPacketTypes.CLIENTBOUND_POST_EFFECTS: "post_effects"

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
postEffectsList<Identifier>

Fields are the components of the packet record.

Stream codec

static final StreamCodec<ByteBuf, ClientboundPostEffectsPacket> STREAM_CODEC = StreamCodec.composite( Identifier.STREAM_CODEC.apply(ByteBufCodecs.list()), ClientboundPostEffectsPacket::postEffects, Cl

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

Handling

Resolved on the ClientCommonPacketListener packet-listener interface by void handlePostEffects(ClientboundPostEffectsPacket clientboundposteffectspacket). The implementation in the game is ClientCommonPacketListenerImpl.

Full Source

ClientboundPostEffectsPacket.java25 lines · Minecraft 26.3 · verbatimSource page ↗
1
package net.minecraft.network.protocol.common;
2
3
import io.netty.buffer.ByteBuf;
4
import java.util.List;
5
import net.minecraft.network.codec.ByteBufCodecs;
6
import net.minecraft.network.codec.StreamCodec;
7
import net.minecraft.network.protocol.Packet;
8
import net.minecraft.network.protocol.PacketType;
9
import net.minecraft.resources.Identifier;
10
11
public record ClientboundPostEffectsPacket(List<Identifier> postEffects) implements Packet<ClientCommonPacketListener> {
12
	public static final StreamCodec<ByteBuf, ClientboundPostEffectsPacket> STREAM_CODEC = StreamCodec.composite(
13
		Identifier.STREAM_CODEC.apply(ByteBufCodecs.list()), ClientboundPostEffectsPacket::postEffects, ClientboundPostEffectsPacket::new
14
	);
15
16
	@Override
17
	public PacketType<ClientboundPostEffectsPacket> type() {
18
		return CommonPacketTypes.CLIENTBOUND_POST_EFFECTS;
19
	}
20
21
	public void handle(final ClientCommonPacketListener listener) {
22
		listener.handlePostEffects(this);
23
	}
24
}
25