ServerboundSpectatorActionPacket .java

net.minecraft.network.protocol.game.ServerboundSpectatorActionPacket (record): members: spectateEntityId, handle, STREAM_CODEC, type. imports: ByteBuf.

net.minecraft.network.protocol.gamerecord24 linescommon909 B

Implements

API Surface (2)

PacketType<ServerboundSpectatorActionPacket> type()
void handle(final ServerGamePacketListener listener)

Fields & Constants (1)

STREAM_CODEC

Same Package (197)

Code Graph: Dependencies (5)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ServerboundSpectatorActionPacket.java24 lines · Minecraft 26.3 · verbatim
1
package net.minecraft.network.protocol.game;
2
3
import io.netty.buffer.ByteBuf;
4
import java.util.OptionalInt;
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
10
public record ServerboundSpectatorActionPacket(OptionalInt spectateEntityId) implements Packet<ServerGamePacketListener> {
11
	public static final StreamCodec<ByteBuf, ServerboundSpectatorActionPacket> STREAM_CODEC = StreamCodec.composite(
12
		ByteBufCodecs.OPTIONAL_VAR_INT, ServerboundSpectatorActionPacket::spectateEntityId, ServerboundSpectatorActionPacket::new
13
	);
14
15
	@Override
16
	public PacketType<ServerboundSpectatorActionPacket> type() {
17
		return GamePacketTypes.SERVERBOUND_SPECTATOR_ACTION;
18
	}
19
20
	public void handle(final ServerGamePacketListener listener) {
21
		listener.handleSpectatorAction(this);
22
	}
23
}
24

Decompiled Minecraft 26.3 source of ServerboundSpectatorActionPacket (net/minecraft/network/protocol/game/ServerboundSpectatorActionPacket.java) with Mojang official mappings, stored verbatim on the site.