0x43 S43PacketCamera
Sets the player's camera to spectate a specific entity (spectator mode teleport).
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| entityId | VarInt | Entity ID to spectate |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Entity ID | VarInt |
MCP References
NetHandlerPlayClient.handleCamera()Handler Interface
INetHandlerPlayClientNotes
Vanilla Source
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 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.
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.
// ===== FILE: Tenacity 6.0, dev/tenacity/module/impl/misc/AntiExploit.java =====
package dev.tenacity.module.impl.misc;
import dev.tenacity.event.IEventListener;
import dev.tenacity.event.impl.packet.PacketReceiveEvent;
import dev.tenacity.module.Module;
import dev.tenacity.module.ModuleCategory;
import dev.tenacity.util.misc.ChatUtil;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C19PacketResourcePackStatus;
import net.minecraft.network.play.server.*;
import java.net.URI;
import java.net.URISyntaxException;
public class AntiExploit extends Module {
private long lastExplosion = 0, lastExperience = 0;
private int invalidExperience = 0;
final int PACKET_THRESHOLD = 100;
final long CHECK_INTERVAL = 1000;
int packetCount = 0;
public AntiExploit() {
super("AntiExploit", "Prevents server exploits", ModuleCategory.MISC);
}
private final IEventListener<PacketReceiveEvent> onReceivePacket = event -> {
Packet<?> packet = event.getPacket();
handlePacketCount();
if(packet instanceof S48PacketResourcePackSend) {
S48PacketResourcePackSend resourcePack = (S48PacketResourcePackSend) packet;
try {
URI uri = new URI(resourcePack.getURL());
String scheme = uri.getScheme();
boolean isLevelProtocol = scheme.equalsIgnoreCase("level");
boolean isHttpProtocol = scheme.equalsIgnoreCase("http");
boolean isHttpsProtocol = scheme.equalsIgnoreCase("https");
if(!isHttpProtocol && !isHttpsProtocol && !isLevelProtocol) {
ChatUtil.print("§cBlocked Exploit: Resource Pack");
event.cancel();
} else if(isLevelProtocol && (resourcePack.getURL().contains("..") || !((S48PacketResourcePackSend) packet).getURL().endsWith("/resources.zip"))) {
ChatUtil.print("§cBlocked Exploit: File Access");
event.cancel();
mc.getNetHandler().addToSendQueue(new C19PacketResourcePackStatus(((S48PacketResourcePackSend) packet).getHash(), C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
}
} catch (URISyntaxException exception) {
ChatUtil.print("§cBlocked Exploit: Resource Pack");
event.cancel();
mc.getNetHandler().addToSendQueue(new C19PacketResourcePackStatus(((S48PacketResourcePackSend) packet).getHash(), C19PacketResourcePackStatus.Action.FAILED_DOWNLOAD));
}
} else if(packet instanceof S43PacketCamera && !mc.thePlayer.isSpectator()) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
} else if(packet instanceof S2APacketParticles) {
S2APacketParticles particles = (S2APacketParticles) packet;
if(Math.abs(particles.getParticleSpeed()) >= 1) {
ChatUtil.print("§cBlocked Exploit: Particles");
event.cancel();
} else if(((S2APacketParticles) packet).getParticleCount() > 1) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
}
} else if(packet instanceof S27PacketExplosion) {
S27PacketExplosion explosion = (S27PacketExplosion) packet;
if(Math.abs(explosion.getStrength()) > 1) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
} else if(System.currentTimeMillis() - lastExplosion <= 1) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
} else if(packet instanceof S2APacketParticles) {
S2APacketParticles particles = (S2APacketParticles) packet;
if(Math.abs(particles.getParticleSpeed()) > 1) {
ChatUtil.print("§cBlocked Exploit: Particles");
event.cancel();
} else if(particles.getParticleCount() >= 1) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
}
}
lastExplosion = System.currentTimeMillis();
} else if(packet instanceof S18PacketEntityTeleport) {
S18PacketEntityTeleport teleport = (S18PacketEntityTeleport) packet;
double packetX = Math.abs(teleport.getX());
double packetY = Math.abs(teleport.getY());
double packetZ = Math.abs(teleport.getZ());
if(packetX > 30000000 || packetY > 30000000 || packetZ > 30000000) {
ChatUtil.print("§cBlocked Exploit: Teleport");
event.cancel();
}
} else if(packet instanceof S11PacketSpawnExperienceOrb) {
if(System.currentTimeMillis() - lastExperience <= 1) {
invalidExperience++;
if(invalidExperience >= 2) {
ChatUtil.print("§cBlocked Exploit: Crash");
event.cancel();
}
} else {
invalidExperience = 0;
}
lastExperience = System.currentTimeMillis();
}
};
private void triggerKick() {
ChatUtil.print("§cAbnormal packet activity detected. Kicking player...");
}
private void handlePacketCount() {
long currentTime = System.currentTimeMillis();
long lastPacketCheckTime = 0;
if (currentTime - lastPacketCheckTime > CHECK_INTERVAL) {
packetCount = 0;
lastPacketCheckTime = currentTime;
}
packetCount++;
if (packetCount > PACKET_THRESHOLD) {
triggerKick();
packetCount = 0;
}
}
}
// NOTE (AI): S43 handling is the third branch of the receive listener: the module only accepts the packet while the local player is a spectator, mirroring the server's own precondition. Cancelling a clientbound packet here is invisible to the server. The same listener also guards S48PacketResourcePackSend URLs, S2APacketParticles counts, S27PacketExplosion strength, S18PacketEntityTeleport coordinates and S11PacketSpawnExperienceOrb rate. The handlePacketCount helper is broken in this build: lastPacketCheckTime is a fresh local zero every call, so packetCount never resets and triggerKick never fires.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.
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.
// ===== FILE: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/utils/latency/CompensatedCameraEntity.java =====
package ac.grim.grimac.utils.latency;
import ac.grim.grimac.checks.Check;
import ac.grim.grimac.checks.type.PreViaPacketSendListener;
import ac.grim.grimac.player.GrimPlayer;
import ac.grim.grimac.utils.data.packetentity.PacketEntity;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerCamera;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.List;
public class CompensatedCameraEntity extends Check implements PreViaPacketSendListener {
private final ArrayDeque<PacketEntity> entities = new ArrayDeque<>(1);
public CompensatedCameraEntity(GrimPlayer player) {
super(player);
reset();
}
@Override
public void onPreViaPacketSend(PacketSendEvent event) {
if (event.getPacketType() != PacketType.Play.Server.CAMERA) return;
int camera = new WrapperPlayServerCamera(event).getCameraId();
player.sendTransaction();
player.addRealTimeTaskNow(() -> {
PacketEntity entity = player.compensatedEntities.getEntity(camera);
if (entity != null) {
entities.add(entity);
}
});
player.addRealTimeTaskNext(() -> {
while (entities.size() > 1) {
entities.poll();
}
if (entities.isEmpty()) {
entities.add(player.compensatedEntities.self);
}
});
}
public boolean isSelf() {
PacketEntity self = player.compensatedEntities.self;
for (PacketEntity entity : entities) {
if (entity != self) {
return false;
}
}
return true;
}
public List<PacketEntity> getPossibilities() {
return new ArrayList<>(entities);
}
public void reset() {
entities.clear();
entities.add(player.compensatedEntities.self);
}
}
// NOTE (AI): The S43 handling is the whole class: onPreViaPacketSend filters the CAMERA packet, resolves the camera id against compensatedEntities and keeps a one-entry queue. GrimPlayer.java line 254 declares cameraEntity and line 300 constructs it; CheckManager.java line 87 registers it with the player's checks.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.
// ===== FILE: intave-intave, src/main/java/de/jpx3/intave/module/tracker/player/AbilityTracker.java =====
package de.jpx3.intave.module.tracker.player;
import com.comphenix.protocol.events.PacketEvent;
import de.jpx3.intave.IntavePlugin;
import de.jpx3.intave.executor.Synchronizer;
import de.jpx3.intave.module.Module;
import de.jpx3.intave.module.Modules;
import de.jpx3.intave.module.linker.packet.ListenerPriority;
import de.jpx3.intave.module.linker.packet.PacketId;
import de.jpx3.intave.module.linker.packet.PacketSubscription;
import de.jpx3.intave.packet.reader.AbilityInReader;
import de.jpx3.intave.packet.reader.AbilityOutReader;
import de.jpx3.intave.packet.reader.EntityReader;
import de.jpx3.intave.packet.reader.GameStateChangeReader;
import de.jpx3.intave.share.Motion;
import de.jpx3.intave.user.MessageChannel;
import de.jpx3.intave.user.User;
import de.jpx3.intave.user.meta.AbilityMetadata;
import de.jpx3.intave.user.meta.MetadataBundle;
import de.jpx3.intave.user.meta.MovementMetadata;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import static de.jpx3.intave.module.linker.packet.PacketId.Client.*;
import static de.jpx3.intave.module.linker.packet.PacketId.Server.*;
import static de.jpx3.intave.packet.reader.GameStateChangeReader.GameState.CHANGE_GAME_MODE;
public final class AbilityTracker extends Module {
@PacketSubscription(packetsOut = CAMERA)
public void receiveCamera(User user, EntityReader reader) {
int entityId = reader.entityId();
user.tickFeedback(() -> synchronizedCameraUpdate(user, entityId));
}
private void synchronizedCameraUpdate(User user, int entityId) {
AbilityMetadata abilityData = user.meta().abilities();
abilityData.hasViewEntity = entityId != user.player().getEntityId();
}
@PacketSubscription(
priority = ListenerPriority.HIGH,
packetsIn = {ABILITIES_IN}
)
public void receiveAbilities(User user, AbilityInReader reader) {
AbilityMetadata abilityData = user.meta().abilities();
MovementMetadata movementData = user.meta().movement();
boolean flying = reader.requestedFlying();
if (abilityData.allowFlying()) {
if (flying) {
abilityData.setFlying(true);
} else {
abilityData.disabledFlying = true;
}
}
}
@PacketSubscription(
priority = ListenerPriority.HIGH,
packetsOut = {
ABILITIES_OUT
}
)
public void sentAbilities(User user, AbilityOutReader reader, PacketEvent event) {
MetadataBundle meta = user.meta();
MovementMetadata movement = meta.movement();
AbilityMetadata abilityData = meta.abilities();
float flyingSpeed = reader.flyingSpeed();
float walkingSpeed = reader.walkingSpeed();
boolean allowedFlight = reader.flyingAllowed();
boolean critical = abilityData.allowFlying() && !allowedFlight && movement.criticalTeleportRateLimiter.tryAcquire();
if (critical /*&& movement.lastTeleport < 20*/) {
// Teleport again to force transaction synchronization
Synchronizer.synchronizeDelayed(() -> {
MovementMetadata moovement = user.meta().movement();
if (moovement.criticalFlyingDisallowStacks > 0) {
Location position = moovement.verifiedLocation().clone();
Player player = user.player();
position.setWorld(player.getWorld());
player.teleport(position);
moovement.criticalFlyingBlockMovementStacks++;
if (user.receives(MessageChannel.DEBUG_TELEPORT)) {
player.sendMessage(IntavePlugin.prefix() + "Teleport to " + player.getLocation().getBlockX() + " " + player.getLocation().getBlockY() + " " + player.getLocation().getBlockZ() + " " + " as " + ChatColor.RED + " not responding to critical flight disallow");
}
}
}, 20);
}
if (critical) {
if (movement.criticalFlyingDisallowStacks++ == 0) {
movement.criticalEnterPosX = movement.verifiedLastPositionX;
movement.criticalEnterPosY = movement.verifiedLastPositionY;
movement.criticalEnterPosZ = movement.verifiedLastPositionZ;
}
}
user.packetTickFeedback(event, () -> {
abilityData.setWalkSpeed(walkingSpeed);
abilityData.setFlySpeed(flyingSpeed);
abilityData.setAllowFlying(allowedFlight);
if (critical) {
if (movement.criticalFlyingDisallowStacks > 0) {
movement.criticalFlyingDisallowStacks--;
}
movement.criticalFlyingBlockMovementStacks = 0;
}
});
}
@PacketSubscription(
priority = ListenerPriority.HIGH,
packetsIn = {FLYING, PacketId.Client.POSITION, LOOK, POSITION_LOOK}
)
public void incomingFlyingUpdate(User user, Player player) {
MovementMetadata movementData = user.meta().movement();
if (movementData.criticalFlyingDisallowStacks > 0 &&
!movementData.criticalFlyingDisallowWasTeleported
) {
double deltaX = movementData.verifiedLastPositionX - movementData.criticalEnterPosX;
double deltaY = movementData.verifiedLastPositionY - movementData.criticalEnterPosY;
double deltaZ = movementData.verifiedLastPositionZ - movementData.criticalEnterPosZ;
double distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ);
if (distance > 3 && movementData.criticalTeleportRateLimiter.tryAcquire()) {
Modules.mitigate().movement().emulationSetBack(player, Motion.newEmpty(), 3, 2, false);
if (user.receives(MessageChannel.DEBUG_TELEPORT)) {
player.sendMessage(IntavePlugin.prefix() + "Teleport to " + player.getLocation().getBlockX() + " " + player.getLocation().getBlockY() + " " + player.getLocation().getBlockZ() + " " + " for " + ChatColor.RED + " critical flying disallow protection");
}
movementData.criticalFlyingDisallowStacks = 0;
}
} else if (movementData.criticalFlyingBlockMovementStacks > 0 && movementData.criticalTeleportRateLimiter.tryAcquire()) {
Synchronizer.synchronize(() -> {
player.teleport(player.getLocation());
});
if (user.receives(MessageChannel.DEBUG_TELEPORT)) {
player.sendMessage(IntavePlugin.prefix() + "Teleport to " + player.getLocation().getBlockX() + " " + player.getLocation().getBlockY() + " " + player.getLocation().getBlockZ() + " " + " for " + ChatColor.RED + " critical flying disallow protection (movement block)");
}
}
}
@PacketSubscription(
packetsOut = PacketId.Server.POSITION
)
public void outgoingPositionUpdate(User user) {
MovementMetadata movementData = user.meta().movement();
movementData.criticalFlyingDisallowWasTeleported = movementData.criticalFlyingDisallowStacks == 1;
}
@PacketSubscription(
priority = ListenerPriority.NORMAL,
packetsOut = {
GAME_STATE_CHANGE
}
)
public void outgoingGameModeUpdate(
User user, GameStateChangeReader reader
) {
if (reader.type() != CHANGE_GAME_MODE) {
return;
}
GameMode gameMode = gameModeOf(reader.valueAsInt());
AbilityMetadata abilityData = user.meta().abilities();
abilityData.setPendingGameMode(gameMode);
user.tickFeedback(() -> abilityData.setGameMode(gameMode));
}
private GameMode gameModeOf(int id) {
for (GameMode value : GameMode.values()) {
if (value.id == id) {
return value;
}
}
throw new IllegalStateException("Unable to resolve gamemode with id " + id);
}
public enum GameMode {
NOT_SET(-1),
SURVIVAL(0),
CREATIVE(1),
ADVENTURE(2),
SPECTATOR(3);
private final int id;
GameMode(int id) {
this.id = id;
}
public static GameMode fromBukkit(org.bukkit.GameMode gameMode) {
switch (gameMode) {
case SURVIVAL:
return SURVIVAL;
case CREATIVE:
return CREATIVE;
case ADVENTURE:
return ADVENTURE;
case SPECTATOR:
return SPECTATOR;
default:
throw new IllegalArgumentException("Unable to resolve game mode " + gameMode);
}
}
public int id() {
return id;
}
}
}
// NOTE (AI): The S43 handling is receiveCamera (lines 30-39), a CAMERA packet subscription that defers the hasViewEntity update to the tick. The rest of the file is the C13 and S39 abilities sync this module also owns; AbilityMetadata.java line 311 consumes the flag.Related Packets
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
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.