0x43 S43PacketCamera

Sets the player's camera to spectate a specific entity (spectator mode teleport).

Clientbound (Server → Client) · PLAY · net/minecraft/network/play/server/S43PacketCamera.java

Published 2026-06-18 · Updated 2026-10-14

playerspectatorcamera
Comprehensive 8/8

Fields

FieldTypeDescription
entityIdVarIntEntity ID to spectate

Wire Encoding

FieldTypeNotes
Entity IDVarInt

MCP References

MCPNetHandlerPlayClient.handleCamera()

Handler Interface

HNDINetHandlerPlayClient

Notes

Only works in spectator mode. Used by servers when a player enters spectator and clicks on an entity. Freecam modules may use this to switch camera target. No module in the examined client sources directly targets this packet.

Vanilla Source

S43PacketCamera.java51 lines · MCP 1.8.9Original ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import net.minecraft.entity.Entity;
5
import net.minecraft.network.Packet;
6
import net.minecraft.network.PacketBuffer;
7
import net.minecraft.network.play.INetHandlerPlayClient;
8
import net.minecraft.world.World;
9
10
public class S43PacketCamera implements Packet<INetHandlerPlayClient>
11
{
12
    public int entityId;
13
14
    public S43PacketCamera()
15
    {
16
    }
17
18
    public S43PacketCamera(Entity entityIn)
19
    {
20
        this.entityId = entityIn.getEntityId();
21
    }
22
23
    /**
24
     * Reads the raw packet data from the data stream.
25
     */
26
    public void readPacketData(PacketBuffer buf) throws IOException
27
    {
28
        this.entityId = buf.readVarIntFromBuffer();
29
    }
30
31
    /**
32
     * Writes the raw packet data to the data stream.
33
     */
34
    public void writePacketData(PacketBuffer buf) throws IOException
35
    {
36
        buf.writeVarIntToBuffer(this.entityId);
37
    }
38
39
    /**
40
     * Passes this Packet on to the NetHandler for processing.
41
     */
42
    public void processPacket(INetHandlerPlayClient handler)
43
    {
44
        handler.handleCamera(this);
45
    }
46
47
    public Entity getEntity(World worldIn)
48
    {
49
        return worldIn.getEntityByID(this.entityId);
50
    }
51
}

Deobfuscated MCP 1.8.9 source of S43PacketCamera, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S43PacketCamera.java) at build time and verified present.

Deep Dive

Role in the protocol

Spectator camera switching. EntityPlayerMP sends it whenever its spectatingEntity changes (line 1084 in the MCP builds, 1057 in Rise), which happens when a spectator clicks an entity, cycles targets, or returns to their own body. The single VarInt entity ID is resolved client-side against the entity list, and the handler then reparents the render view to that entity. It is the only packet that moves the camera independently of the player's own position.

Vanilla handling

The client handler func_175094_a calls packet.func_179780_a(world) to resolve the entity ID, and only if the entity is non-null calls gameController.func_175607_a (setRenderViewEntity). The null guard means a bogus ID silently leaves the camera unchanged. The server side only ever sends the packet in spectator mode, after validating the target through EntityPlayerMP's spectator logic.

Why clients touch it

Exactly one module in the 8 clients: Tenacity 6.0's AntiExploit (dev/tenacity/module/impl/misc/AntiExploit.java) cancels S43 when the local player is not a spectator. The rationale is the classic 1.8 camera exploit: a malicious server can force the render view onto an arbitrary or fast-moving entity even while the player is in survival, producing unusable camera motion or a client crash. The check mirrors the server's own precondition, so legitimate spectator flow is never blocked.

Exploit surface

The packet is one VarInt with zero client-side validation of game state. The abuse is a server-side precondition failure: vanilla only sends it to spectators, so any S43 arriving at a non-spectator client is by definition hostile. Beyond Tenacity's check, none of the 8 clients rate-limits or sanity-checks it. Freecam-style modules move the render view locally and never touch this packet, which is why no Freecam or spectate module appears in the corpus.

Server-Side Handling

EntityPlayerMP tracks a spectatingEntity field and sends new S43PacketCamera(spectatingEntity) on every change. The server-side precondition is spectator game mode; the client cannot verify that, so it must trust or filter. The packet is also sent to restore the camera to the player when spectating ends.

Protocol Analysis

Single VarInt entity ID. The client resolves it with WorldClient.getEntityByID; a missing entity yields null and the camera is left untouched thanks to the handler's null check. 1.8.9 uses readVarIntFromBuffer. Play state only; no ordering constraints beyond the entity's spawn packet having arrived, otherwise the resolve fails silently.

Anti-Cheat Landscape

Not an anti-cheat surface. The packet is clientbound and carries no data the server re-validates. Server-side plugins that support spectator mode do not measure camera behaviour. The relevant threat model is malicious-server-to-client, which is exactly what Tenacity's AntiExploit addresses; cancelling it cannot produce a flag because nothing serverbound is modified.

implementation Implementation Cases

Spectator-mode camera reparenting: one VarInt entity ID, resolved and applied by the client handler with a null guard. Only Tenacity 6.0's AntiExploit touches it in the 8 clients, cancelling the packet for non-spectators to block the camera crash exploit.

AntiExploit (Tenacity 6.0)

Block high-risk clientbound packets, including S43PacketCamera when the local player is not a spectator, to prevent the camera crash exploit.

A PacketReceiveEvent listener walks instanceof checks over a set of high-risk clientbound packets. For S43 it tests mc.thePlayer.isSpectator(); when false it prints a chat notice and calls event.cancel(), so the vanilla handler never runs. The same listener validates S48PacketResourcePackSend URLs, rate-limits S2APacketParticles, S27PacketExplosion and S11PacketSpawnExperienceOrb, and bounds-checks S18PacketEntityTeleport coordinates.

Source: Tenacity 6.0, dev/tenacity/module/impl/misc/AntiExploit.java

Vanilla hook: PacketReceiveEvent (dev.tenacity.event.impl.packet.PacketReceiveEvent).
None. Cancelling a clientbound packet is invisible to the server; the server never learns whether the camera switch was applied, and no serverbound data is altered, so no anti-cheat can flag it.
Variations: The other 7 clients have no S43 handling at all; Tenacity is the only one with a camera-related guard. The same AntiExploit module appears in other client bases (Flux, Lycoris, Raze), but those are outside the 8-client corpus.
PacketReceiveEvent with instanceof dispatch is the pattern; Tenacity registers an IEventListener on the event bus in the module constructor.

anticheat Anti-Cheat Checks

The camera packet is clientbound and server-authoritative, so anticheats see it only on send. Exactly two consumers act on it: Grim's CompensatedCameraEntity records which entity the server ordered the client to spectate, and intave's AbilityTracker marks the player as having a view entity so its movement checks treat spectator camera motion as legitimate. The rest of the corpus is keyword noise: Photon's CanSee family and TruthfulAC's AimB mention cameras in the ESP raycast and aim domains without touching the packet, and Artemis and Negativity only register the packet type.

CompensatedCameraEntity (Grim) (GrimAnticheat-Grim)

Track the spectated entity id from the camera packet so entity checks keep measuring against the right body.

A PreVia packet send listener on the CAMERA packet. It reads the camera entity id from the S43 packet, sends a transaction, and on the next real-time task resolves the id against the compensated entity map, keeping a single-entry queue of possible camera targets. isSelf() reports whether the view is back on the player's own body and getPossibilities() exposes the candidates to other checks.

Detects: Nothing directly. It is state sync: the spectated entity becomes the reference body for entity-dependent checks while the player's view is attached elsewhere.

Source: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/utils/latency/CompensatedCameraEntity.java

Variations: intave AbilityTracker.receiveCamera is the only other consumer, and it stores a view-entity boolean instead of the entity itself.
AbilityTracker.receiveCamera (intave) (intave-intave)

Record when the server moves the player's view onto another entity, so movement checks exempt spectator camera motion.

A CAMERA packet subscription on the abilities tracker module. receiveCamera reads the entity id from the packet and schedules a tick-synchronized update that sets hasViewEntity to true when the id differs from the player's own entity id. AbilityMetadata.isSpectatorLike() (line 311) returns true for a player whose game mode is spectator or whose hasViewEntity is set, which movement checks use to skip flags that would otherwise fire for spectator motion.

Detects: Nothing directly. It prevents false positives: the view-entity flag keeps spectator camera movement out of the normal movement checks.

Source: intave-intave, src/main/java/de/jpx3/intave/module/tracker/player/AbilityTracker.java

Variations: Grim CompensatedCameraEntity keeps the spectated entity itself and reports whether the view is on the player, instead of a boolean flag.

Wiki Cross-Reference

Spectating certain mobs loads dedicated post shaders: creepers, spiders and cave spiders, and endermen each apply their own shader, which unloads when the camera returns to anything else.

Control returns to the player by sending the packet with the player's own entity ID, and the packet is ignored when the target entity is not loaded by the client.

MCP 1.8.9 S43PacketCamera implements Packet dispatching to INetHandlerPlayClient.handleCamera; wire serde is readPacketData/writePacketData via readVarIntFromBuffer.

1.8.9 callers: EntityPlayerMP.setSpectatingEntity sends new S43PacketCamera (line 1263): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java

Cross-checked against minecraft.wiki (CC BY-SA 3.0) for 1.8.9 accuracy.

Vanilla Internals

Full 1.8.9 logic-class sources that send or handle this packet, stored verbatim.

Module Analyses Using S43PacketCamera

Full source walkthroughs of the modules and anti-cheats that use this packet.