0x0C S0CPacketSpawnPlayer
Spawns another player entity in the world with UUID, position (fixed-point int × 32), rotation (byte × 256/360), held item, and metadata.
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| entityId | VarInt | Entity ID for this player |
| playerId | UUID | Player UUID |
| x/y/z | fixed-point int | Position × 32 |
| yaw/pitch | byte | Rotation × 256/360 |
| currentItem | short | Item ID in hand |
| metadata | DataWatcher | Player metadata (skin, cape, etc.) |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Entity ID | VarInt | |
| Player UUID | UUID | Most Sig + Least Sig bits |
| X | Int | x * 32 |
| Y | Int | y * 32 |
| Z | Int | z * 32 |
| Yaw | byte | yaw * 256 / 360 |
| Pitch | byte | pitch * 256 / 360 |
| Current Item | short | Block/item ID (0 = empty) |
| Metadata | DataWatcher | Entity data watcher |
MCP References
NetHandlerPlayClient.handleSpawnPlayer()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 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
Deobfuscated MCP 1.8.9 source of S0CPacketSpawnPlayer, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S0CPacketSpawnPlayer.java) at build time and verified present.
Deep Dive
Role in the protocol
S0C spawns a player entity: VarInt entity id, UUID, fixed-point x/y/z as ints scaled by 32, byte yaw and pitch scaled by 256/360, a short current-item id, then the DataWatcher metadata. EntityTrackerEntry constructs it when a player enters render distance. The client builds an EntityOtherPlayerMP from it. MessageSerializer carries a no-op special case for S0C in the bundled 1.8 sources, a decompile artifact of the 1.7.x-era encoding special case.
Vanilla handling
NetHandlerPlayClient.handleSpawnPlayer decodes the fixed-point coordinates, reads the metadata and registers the entity in the world. From then on the entity is driven by S14 relative moves and S18 teleports. ESP and nametag modules do not hook S0C in these clients: they iterate the world entity list, which is why S0C only shows up in anti-bot and meme modules.
Why clients touch it
S0C is the only packet that announces a new player with a position, which makes it the anti-bot veto point. Spicy's Antibot cancels the packet outright when the spawn looks like a bot (within 17 blocks, more than 1 block above the player, not at the player's coordinates) on non-Hypixel servers; the Hypixel branch is commented out because Hypixel bots carry plausible spawn data, so bots are removed from the entity list per-tick instead. Sigma 4.11 AntiBot inspects spawn packets the same way. The Spicy meme modules (DougDimmadome, FloofyFoxes, Furries) import S0C for skin and model replacement but ship empty handlers. November Recode 2.0's AntiBotModule adds a WATCHDOG mode that treats every player spawn following a detected bot despawn as a bot, printing a suspicious-spawn notice.
Exploit surface
Cancelling S0C is client-only: the server keeps simulating the bot, but the local world never receives the entity, so aim and ESP never lock onto it. The risk is entity-id desync if later packets reference the cancelled id, which vanilla guards by simply not spawning the entity. Anti-cheats do not measure S0C; anti-bot heuristics are purely client-side (spawn position relative to the player, invisibility plus name quirks, tab-list absence), and servers that want bots to survive these filters just spawn them with realistic positions, which is exactly what Hypixel does.
Server-Side Handling
EntityTrackerEntry.getPacket constructs S0C from the tracked EntityPlayer with x, y and z scaled by 32, yaw and pitch scaled by 256/360, the held item id as a short, and the DataWatcher data. The server does no per-recipient filtering beyond the tracker's render-distance logic.
Protocol Analysis
Fields: VarInt entity id, UUID (most and least significant longs), three ints scaled by 32, two bytes scaled by 256/360, a short item id (0 when empty), then DataWatcher metadata. The scaling is why the client divides by 32 and multiplies by 360/256. S0C is the only spawn packet with a UUID, which is what makes it the natural hook for anti-bot and name-based filtering.
Anti-Cheat Landscape
No anti-cheat reads S0C. The client-side heuristics in Spicy (17-block range, height above the player, non-coincident coordinates) and the Hypixel per-tick removal (invisibility, name formatting, tab-list absence, Watchdog naming) are the whole anti-bot landscape in this corpus, and servers defeat them by making spawn data indistinguishable from real players.
implementation Implementation Cases
The player-spawn announcement: fixed-point position, byte rotations, item id and metadata. In this corpus it is the anti-bot veto point: Spicy cancels suspicious spawns outright, Sigma inspects them, November Recode 2.0 flags post-despawn spawns in WATCHDOG mode, while the meme modules only import it. ESP and nametag modules never touch S0C because they iterate the entity list instead.
Veto bots at the spawn point: cancel S0C for suspicious spawns so the entity never enters the local world and cannot be targeted.
Spicy hooks EventPacket pre: on non-Hypixel servers, a spawn within 17 blocks, more than 1 block above the player and not at the player's exact coordinates is cancelled with a chat notice; on Hypixel the packet path is commented out and hypixelAntibot() removes bots from the entity list per-tick using invisibility, name formatting, tab-list absence and Watchdog naming heuristics. Sigma inspects incoming S0C the same way on its own packet bus.
// ===== FILE: Spicy, info/spicyclient/modules/combat/Antibot.java =====
package info.spicyclient.modules.combat;
import java.util.ArrayList;
import java.util.ConcurrentModificationException;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.lwjgl.input.Keyboard;
import info.spicyclient.chatCommands.Command;
import info.spicyclient.events.Event;
import info.spicyclient.events.listeners.EventPacket;
import info.spicyclient.events.listeners.EventUpdate;
import info.spicyclient.modules.Module;
import info.spicyclient.settings.ModeSetting;
import info.spicyclient.util.PlayerUtils;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.play.server.S0CPacketSpawnPlayer;
import net.minecraft.util.MathHelper;
public class Antibot extends Module {
public static EntityLivingBase target = null;
private ModeSetting AntibotMode = new ModeSetting("Antibot Mode", "Advanced", "Advanced");
public Antibot() {
super("Antibot", Keyboard.KEY_NONE, Category.COMBAT);
resetSettings();
}
@Override
public void resetSettings() {
this.settings.clear();
this.addSettings(AntibotMode);
}
public void onEnable() {
removeThese.clear();
dontRemove.clear();
}
public void onDisable() {
removeThese.clear();
dontRemove.clear();
}
public void onEvent(Event e) {
if (e instanceof EventUpdate) {
if (e.isPre()) {
if (!mc.isSingleplayer() && mc.getCurrentServerData().serverIP.toLowerCase().contains("hypixel")) {
this.additionalInformation = "Hypixel";
}else {
this.additionalInformation = "Advanced";
}
}
}
if (e instanceof EventPacket && AntibotMode.is("Advanced")) {
if (e.isIncoming() && e.isPre()) {
EventPacket packet = (EventPacket) e;
if (packet.packet instanceof S0CPacketSpawnPlayer && !(mc.getCurrentServerData().serverIP.toLowerCase().contains("hypixel"))) {
S0CPacketSpawnPlayer p = (S0CPacketSpawnPlayer) packet.packet;
double entX = p.getX() / 32D;
double entY = p.getY() / 32D;
double entZ = p.getZ() / 32D;
double diffX = mc.thePlayer.posX - entX;
double diffY = mc.thePlayer.posY - entY;
double diffZ = mc.thePlayer.posZ - entZ;
float distance = MathHelper.sqrt_double(diffX * diffX + diffY * diffY + diffZ * diffZ);
if (distance <= 17 && entY > mc.thePlayer.posY + 1 && (entX != mc.thePlayer.posX && entY != mc.thePlayer.posY && entZ != mc.thePlayer.posZ)) {
//Entity entity = mc.theWorld.getEntityByID(p.getEntityID());
//Command.sendPrivateChatMessage("The " + entity.getDisplayName().getFormattedText() + " bot was removed from your game");
packet.setCanceled(true);
Command.sendPrivateChatMessage("A bot was removed from your game");
}
}
else if (packet.packet instanceof S0CPacketSpawnPlayer && !mc.isSingleplayer() && mc.getCurrentServerData().serverIP.toLowerCase().contains("hypixel")) {
//hypixelAntibot();
/*
S0CPacketSpawnPlayer p = (S0CPacketSpawnPlayer) packet.packet;
Entity entity = mc.theWorld.getEntityByID(p.getEntityID());
if (entity == null) {
return;
}
if (entity.getDisplayName().getFormattedText().startsWith("\u00a7") && !entity.isInvisible() && !entity.getDisplayName().getFormattedText().toLowerCase().contains("npc")) {
}else {
Command.sendPrivateChatMessage("The " + entity.getDisplayName().getFormattedText() + " bot was removed from your game");
packet.setCanceled(true);
}
*/
}
}
}
if (e instanceof EventUpdate) {
if (e.isPre() && AntibotMode.is("Advanced") && !mc.isSingleplayer() && !(mc.getCurrentServerData().serverIP.toLowerCase().contains("hypixel"))) {
for (Object entity : mc.theWorld.loadedEntityList) {
if (((Entity)entity).isInvisible() && entity != mc.thePlayer) {
//Command.sendPrivateChatMessage("a bot was removed from your game");
Command.sendPrivateChatMessage("A bot was removed from your game");
mc.theWorld.removeEntity(((Entity)entity));
}
}
}
else if (!mc.isSingleplayer() && mc.getCurrentServerData().serverIP.toLowerCase().contains("hypixel")) {
if (e.isPre()) {
hypixelAntibot();
}
else if (e.isPost()) {
for (EntityPlayer ent : removeThese) {
try {
mc.theWorld.removeEntity(ent);
} catch (ConcurrentModificationException e2) {
Command.sendPrivateChatMessage("Could not remove bot due to ConcurrentModificationException, please report this to a dev");
} catch (Exception e2) {
Command.sendPrivateChatMessage("Could not remove bot due to an unknown error, please report this to a dev");
}
}
}
/*
S0CPacketSpawnPlayer p = (S0CPacketSpawnPlayer) packet.packet;
Entity entity = mc.theWorld.getEntityByID(p.getEntityID());
if (entity == null) {
return;
}
if (entity.getDisplayName().getFormattedText().startsWith("\u00a7") && !entity.isInvisible() && !entity.getDisplayName().getFormattedText().toLowerCase().contains("npc")) {
}else {
Command.sendPrivateChatMessage("The " + entity.getDisplayName().getFormattedText() + " bot was removed from your game");
packets.add(p);
packet.setCanceled(true);
}
*/
}
}
}
// Prevents non bots from being removed
private static transient List<EntityPlayer> dontRemove = new ArrayList<>();
private static transient CopyOnWriteArrayList<EntityPlayer> removeThese = new CopyOnWriteArrayList<EntityPlayer>();
private void hypixelAntibot() {
for (Object o : mc.theWorld.getLoadedEntityList()) {
if (o instanceof EntityPlayer) {
EntityPlayer ent = (EntityPlayer) o;
if (ent != mc.thePlayer && !dontRemove.contains(ent)) {
String customName = ent.getCustomNameTag();
String formattedName = ent.getDisplayName().getFormattedText();
String name = ent.getName();
if(ent.isInvisible() && !formattedName.startsWith("§c") && formattedName.endsWith("§r") && customName.equals(name)){
double diffX = Math.abs(ent.posX - mc.thePlayer.posX);
double diffY = Math.abs(ent.posY - mc.thePlayer.posY);
double diffZ = Math.abs(ent.posZ - mc.thePlayer.posZ);
double diffH = Math.sqrt(diffX * diffX + diffZ * diffZ);
if(diffY < 13 && diffY > 10 && diffH < 3){
List<EntityPlayer> list = PlayerUtils.getTabPlayerList();
if(!list.contains(ent)){
//Command.sendPrivateChatMessage("The bot " + name + " bot was removed from your game");
removeThese.add(ent);
}
}
}
if(ent.isInvisible()){
if(!customName.equalsIgnoreCase("") && customName.toLowerCase().contains("§c§c") && name.contains("§c")){
//Command.sendPrivateChatMessage("The bot " + name + " bot was removed from your game");
removeThese.add(ent);
}
}
if (formattedName.startsWith("\u00a7") && !ent.isInvisible() && !formattedName.toLowerCase().contains("npc")) {
}else {
//Command.sendPrivateChatMessage("The " + ent.getDisplayName().getFormattedText() + " bot was removed from your game");
removeThese.add(ent);
}
// Watchdog bots
if(!customName.equalsIgnoreCase("") && customName.toLowerCase().contains("§c") && customName.toLowerCase().contains("§r")){
Command.sendPrivateChatMessage("A watchdog bot named " + name + "was removed from your game");
removeThese.add(ent);
}
// npcs
if(formattedName.contains("§8[NPC]")){
dontRemove.add(ent);
}
if(!formattedName.contains("§c") && !customName.equalsIgnoreCase("")){
dontRemove.add(ent);
}
// bedwars shop
if(!formattedName.startsWith("§") && formattedName.endsWith("§r")){
dontRemove.add(ent);
}
}
}
}
}
}
// NOTE (AI): The only module in the corpus that cancels S0CPacketSpawnPlayer outright. On non-Hypixel servers a spawn within 17 blocks, more than 1 block above the player and not at the player's exact coordinates is assumed to be a bot, and the packet is cancelled before the entity ever enters the world. The Hypixel branch is commented out: Hypixel bots carry plausible spawn data, so on that server the module instead removes bots per-tick from the entity list (hypixelAntibot checks invisibility, name formatting, tab-list absence and known Watchdog naming conventions). Cancelling the spawn packet is client-only: the server keeps simulating the bot, but the local world never receives the entity.Meme-module family that imports S0C as the hook point for replacing spawned player models and skins; the shipped builds contain no handling.
All three modules import S0CPacketSpawnPlayer and define empty onEvent bodies. The import marks the intended integration point (hook player spawns, replace the entity render) but no spawn handling exists in the shipped files.
// ===== FILE: Spicy, info/spicyclient/modules/memes/DougDimmadome.java =====
package info.spicyclient.modules.memes;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import org.lwjgl.input.Keyboard;
import info.spicyclient.events.Event;
import info.spicyclient.events.listeners.EventChatmessage;
import info.spicyclient.events.listeners.EventMotion;
import info.spicyclient.events.listeners.EventPacket;
import info.spicyclient.events.listeners.EventUpdate;
import info.spicyclient.modules.Module;
import info.spicyclient.settings.BooleanSetting;
import info.spicyclient.settings.ModeSetting;
import info.spicyclient.settings.SettingChangeEvent;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.passive.EntityAnimal;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.play.client.C02PacketUseEntity;
import net.minecraft.network.play.client.C0APacketAnimation;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.network.play.server.S0CPacketSpawnPlayer;
import net.minecraft.network.play.client.C02PacketUseEntity.Action;
public class DougDimmadome extends Module {
public DougDimmadome() {
super("Doug Dimmadome", Keyboard.KEY_NONE, Category.MEMES);
}
public void onEnable() {
}
public void onDisable() {
}
public void onEvent(Event e) {
}
}
// NOTE (AI): The corpus hit is import-only: the shipped module body is empty scaffolding with empty onEvent. The S0C import marks the intended hook point (spawned player entities, for the skin and model replacement joke), but no handling exists in this build. FloofyFoxes and Furries are the same meme-module family with identical import-only S0C references, and Account.java imports S0C in the same client for the same reason.Flag player spawns that arrive after a detected bot despawned, so combat modules never target the replacement.
In WATCHDOG mode the module first scans the world entity list for invisible players missing from the tab list and picks one above the player as aboveEntityId. Once the S13 listener confirms that id was destroyed, the S0C branch of the same packet listener adds every new spawn to the bots set and prints a suspicious-spawn notice; other modules consult bot() before targeting.
// ===== FILE: November Recode 2.0, feature/module/impl/combat/AntiBotModule.java =====
/* November.lol © 2023 */
package lol.november.feature.module.impl.combat;
import io.netty.util.internal.ConcurrentSet;
import java.util.Set;
import lol.november.feature.module.Category;
import lol.november.feature.module.Module;
import lol.november.feature.module.Register;
import lol.november.feature.setting.Setting;
import lol.november.listener.bus.Listener;
import lol.november.listener.bus.Subscribe;
import lol.november.listener.event.net.EventPacket;
import lol.november.listener.event.player.EventUpdate;
import lol.november.utility.chat.Printer;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.play.server.S0CPacketSpawnPlayer;
import net.minecraft.network.play.server.S13PacketDestroyEntities;
/**
* @author Gavin
* @since 2.0.0
*/
@Register(
name = "AntiBot",
description = "Prevents you from attacking bots",
category = Category.COMBAT
)
public class AntiBotModule extends Module {
private final Setting<Mode> mode = new Setting<>("Mode", Mode.WATCHDOG);
private final Setting<Integer> tabTicks = new Setting<>(
() -> mode.getValue() == Mode.TAB_TICKS,
"Tab Ticks",
50,
1,
0,
500
);
private final Setting<Boolean> noTab = new Setting<>(
() -> mode.getValue() == Mode.NPC,
"No Tab List",
true
);
private final Set<Integer> bots = new ConcurrentSet<>();
private int aboveEntityId = -1;
private boolean aboveDespawn;
@Override
public void disable() {
super.disable();
bots.clear();
aboveEntityId = -1;
aboveDespawn = false;
}
@Subscribe
private final Listener<EventUpdate> update = event -> {
if (mc.thePlayer.ticksExisted < 5) {
bots.clear();
if (mode.getValue() == Mode.WATCHDOG) {
aboveEntityId = -1;
aboveDespawn = false;
}
return;
}
switch (mode.getValue()) {
case WATCHDOG -> {
// todo i have no clue
for (EntityPlayer player : mc.theWorld.playerEntities) {
if (player == null || player.equals(mc.thePlayer)) continue;
if (!tabList(player) && player.isInvisible()) {
bots.add(player.getEntityId());
}
}
if (aboveEntityId != -1) return;
for (int bot : bots) {
Entity entity = mc.theWorld.getEntityByID(bot);
if (!(entity instanceof EntityPlayer)) {
bots.remove(bot);
continue;
}
if (Math.abs(entity.posY - mc.thePlayer.posY) <= 10.0) {
aboveEntityId = entity.getEntityId();
Printer.print(
"Detected bot above you: " +
aboveEntityId +
" (" +
entity.getName() +
")"
);
break;
}
}
}
case TAB_TICKS -> {
for (EntityPlayer player : mc.theWorld.playerEntities) {
if (player == null || player.equals(mc.thePlayer)) continue;
if (
player.ticksExisted > tabTicks.getValue() && !tabList(player)
) bots.add(player.getEntityId());
}
}
case NPC -> {
for (EntityPlayer player : mc.theWorld.playerEntities) {
if (player == null || player.equals(mc.thePlayer)) continue;
String name = player.getGameProfile().getName();
if (
name.startsWith("CIT-") ||
name.contains("[NPC]") ||
name.contains("\u00A7") ||
(!tabList(player) && noTab.getValue())
) bots.add(player.getEntityId());
}
}
}
};
@Subscribe
private final Listener<EventPacket.In> packetIn = event -> {
if (mode.getValue() == Mode.WATCHDOG) {
if (event.get() instanceof S13PacketDestroyEntities packet) {
for (int entityId : packet.getEntityIDs()) {
if (entityId == aboveEntityId) {
Printer.print(entityId + " was removed from the world. Staff?");
aboveEntityId = -1;
}
}
} else if (event.get() instanceof S0CPacketSpawnPlayer packet) {
if (!aboveDespawn) return;
bots.add(packet.getEntityID());
Printer.print("Suspicious entity spawn: " + packet.getEntityID());
}
}
};
private boolean tabList(EntityPlayer player) {
for (NetworkPlayerInfo info : mc.thePlayer.sendQueue.getPlayerInfoMap()) {
if (
info
.getGameProfile()
.getName()
.equals(player.getGameProfile().getName())
) return true;
}
return false;
}
public boolean bot(int entityId) {
return bots.contains(entityId);
}
private enum Mode {
TAB_TICKS,
NPC,
WATCHDOG,
}
}
// NOTE (AI): AntiBotModule's S0C handling runs only in WATCHDOG mode. The module first scans the world entity list for invisible players missing from the tab list and picks one above the player as aboveEntityId, printing a detection message. Once aboveDespawn is set, the packet listener treats every subsequent S0CPacketSpawnPlayer as a bot, adds its entity id to the bots set and prints a suspicious-spawn notice. The bots set is the veto list: other combat modules consult bot() before targeting. The spawn veto has no position filter, so a single despawn-then-respawn of a real player flags them; the heuristic is tuned to watchdog-style bots that spawn above the player.anticheat Anti-Cheat Checks
The named-entity spawn packet is how server-side anticheats learn that another player exists and where. Reach, hitbox and killaura checks need this position anchor before the entity-update stream takes over, so every modern anticheat keeps an entity tracker keyed by spawn: Hydro and Tecnio insert a tracked entity into a map, Shard adds it to the compensated entity list and observes it for view sessions, and Grim replicates it into the simulation. The packet is never flagged; it is the insertion point that makes entity-distance checks possible. S0F (spawn mob) shares the same tracker files because living entities feed the same maps.
Insert the spawned player into the tracked-entity map so reach and hitbox checks can measure against it.
EntityTracker.registerOutgoingPreHandler routes SPAWN_PLAYER to handleSpawnPlayer, which wraps the packet as WrapperPlayServerSpawnPlayer, reads the fixed-point position and stores a TrackedEntity keyed by entity id. S14 relative moves and S18 teleports then update the entry inside transaction confirmations, and DESTROY_ENTITIES removes it. Entity movement is interpolated only on flying packets, keeping the tracker transaction-accurate.
// ===== FILE: Incognitolol-Hydro, src/main/java/integral/studios/hydro/model/tracker/impl/EntityTracker.java =====
package integral.studios.hydro.model.tracker.impl;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.util.Vector3d;
import com.github.retrooper.packetevents.wrapper.play.server.*;
import integral.studios.hydro.model.PlayerData;
import integral.studios.hydro.model.tracker.Tracker;
import integral.studios.hydro.util.player.tracker.entity.TrackedEntity;
import integral.studios.hydro.util.packet.PacketUtil;
import lombok.Getter;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
@Getter
public class EntityTracker extends Tracker {
// Thread-safe entity storage
private final Map<Integer, TrackedEntity> entityMap = new ConcurrentHashMap<>();
public EntityTracker(PlayerData playerData) {
super(playerData);
}
@Override
public void registerOutgoingPreHandler(PacketSendEvent event) {
if (event.getPacketType() == PacketType.Play.Server.SPAWN_LIVING_ENTITY) {
handleSpawnLivingEntity(event);
} else if (event.getPacketType() == PacketType.Play.Server.SPAWN_PLAYER) {
handleSpawnPlayer(event);
} else if (event.getPacketType() == PacketType.Play.Server.ENTITY_RELATIVE_MOVE) {
handleEntityRelativeMove(event);
} else if (event.getPacketType() == PacketType.Play.Server.ENTITY_RELATIVE_MOVE_AND_ROTATION) {
handleEntityRelativeMoveAndRotation(event);
} else if (event.getPacketType() == PacketType.Play.Server.ENTITY_TELEPORT) {
handleEntityTeleport(event);
} else if (event.getPacketType() == PacketType.Play.Server.DESTROY_ENTITIES) {
handleDestroyEntities(event);
}
}
@Override
public void registerIncomingPostHandler(PacketReceiveEvent event) {
if (PacketUtil.isFlying(event.getPacketType())) {
handleFlyingPacket();
}
}
private void handleSpawnLivingEntity(PacketSendEvent event) {
WrapperPlayServerSpawnLivingEntity wrapper = new WrapperPlayServerSpawnLivingEntity(event);
Vector3d position = wrapper.getPosition();
int entityId = wrapper.getEntityId();
TrackedEntity entity = new TrackedEntity(entityId, position.x, position.y, position.z);
entityMap.put(entityId, entity);
}
private void handleSpawnPlayer(PacketSendEvent event) {
WrapperPlayServerSpawnPlayer wrapper = new WrapperPlayServerSpawnPlayer(event);
Vector3d position = wrapper.getPosition();
int entityId = wrapper.getEntityId();
TrackedEntity entity = new TrackedEntity(entityId, position.x, position.y, position.z);
entityMap.put(entityId, entity);
}
private void handleEntityRelativeMove(PacketSendEvent event) {
WrapperPlayServerEntityRelativeMove wrapper = new WrapperPlayServerEntityRelativeMove(event);
TrackedEntity entity = entityMap.get(wrapper.getEntityId());
if (entity == null) {
return;
}
playerData.getTransactionTracker().confirmPre(() -> {
entity.handleMovement(wrapper.getDeltaX(), wrapper.getDeltaY(), wrapper.getDeltaZ());
});
playerData.getTransactionTracker().confirmPost(this::updateAllEntitiesPostTransaction);
}
private void handleEntityRelativeMoveAndRotation(PacketSendEvent event) {
WrapperPlayServerEntityRelativeMoveAndRotation wrapper = new WrapperPlayServerEntityRelativeMoveAndRotation(event);
TrackedEntity entity = entityMap.get(wrapper.getEntityId());
if (entity == null) {
return;
}
playerData.getTransactionTracker().confirmPre(() -> {
entity.handleMovement(wrapper.getDeltaX(), wrapper.getDeltaY(), wrapper.getDeltaZ());
});
playerData.getTransactionTracker().confirmPost(this::updateAllEntitiesPostTransaction);
}
private void handleEntityTeleport(PacketSendEvent event) {
WrapperPlayServerEntityTeleport wrapper = new WrapperPlayServerEntityTeleport(event);
TrackedEntity entity = entityMap.get(wrapper.getEntityId());
if (entity == null) {
return;
}
Vector3d position = wrapper.getPosition();
playerData.getTransactionTracker().confirmPre(() -> {
entity.handleTeleport(position.x, position.y, position.z);
});
playerData.getTransactionTracker().confirmPost(this::updateAllEntitiesPostTransaction);
}
private void handleDestroyEntities(PacketSendEvent event) {
WrapperPlayServerDestroyEntities wrapper = new WrapperPlayServerDestroyEntities(event);
for (int entityId : wrapper.getEntityIds()) {
entityMap.remove(entityId);
}
}
private void handleFlyingPacket() {
entityMap.values().forEach(TrackedEntity::handlePostFlying);
}
private void updateAllEntitiesPostTransaction() {
entityMap.values().forEach(TrackedEntity::handlePostTransaction);
}
public TrackedEntity get(int entityId) {
return entityMap.get(entityId);
}
public boolean isTracking(int entityId) {
return entityMap.containsKey(entityId);
}
public int getTrackedEntityCount() {
return entityMap.size();
}
public TrackedEntity removeEntity(int entityId) {
return entityMap.remove(entityId);
}
public void clearEntities() {
entityMap.clear();
}
public double getDistanceToEntity(int entityId) {
TrackedEntity entity = entityMap.get(entityId);
if (entity == null) {
return -1;
}
double dx = entity.getX() - playerData.getPositionTracker().getX();
double dy = entity.getY() - playerData.getPositionTracker().getY();
double dz = entity.getZ() - playerData.getPositionTracker().getZ();
return Math.sqrt(dx * dx + dy * dy + dz * dz);
}
public TrackedEntity getClosestEntity() {
TrackedEntity closest = null;
double minDistance = Double.MAX_VALUE;
for (Map.Entry<Integer, TrackedEntity> entry : entityMap.entrySet()) {
TrackedEntity entity = entry.getValue();
double distance = getDistanceToEntity(entry.getKey());
if (distance >= 0 && distance < minDistance) {
minDistance = distance;
closest = entity;
}
}
return closest;
}
public Map<Integer, TrackedEntity> getEntitiesWithinDistance(double maxDistance) {
Map<Integer, TrackedEntity> nearbyEntities = new ConcurrentHashMap<>();
for (Map.Entry<Integer, TrackedEntity> entry : entityMap.entrySet()) {
double distance = getDistanceToEntity(entry.getKey());
if (distance >= 0 && distance <= maxDistance) {
nearbyEntities.put(entry.getKey(), entry.getValue());
}
}
return nearbyEntities;
}
public int getEntityId(TrackedEntity entity) {
if (entity == null) return -1;
for (Map.Entry<Integer, TrackedEntity> entry : entityMap.entrySet()) {
if (entry.getValue() == entity) {
return entry.getKey();
}
}
return -1;
}
}
// NOTE (AI): handleSpawnPlayer is lines 60-67; the same file routes SPAWN_LIVING_ENTITY (29-30, 51-58) and DESTROY_ENTITIES (39-40, 116-122), which is why the S0C, S0F and S13 corpora all hit this tracker.
Notify the view-session coordinator when a tracked player spawns so spectator-style tracking sessions stay in sync.
ViewTrackingObserver listens at MONITOR priority and, on SPAWN_PLAYER, resolves the spawned player's UUID, then schedules a synchronous task that checks isTrackableViewTarget and calls coordinator.trackTarget. It ignores the viewer's own spawn (targetId == viewer.uniqueId) and is a no-op when no session is active. DESTROY_ENTITIES is the matching removal path.
// ===== FILE: KaelusAI-Shard, src/main/kotlin/ac/shard/monitor/view/ViewTrackingObserver.kt =====
/*
* This file is part of Shard - https://github.com/KaelusAI/Shard
* Copyright (C) 2026 KaelusAI
*
* Shard is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Shard is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package ac.shard.monitor.view
import ac.shard.scheduler.SchedulerService
import com.github.retrooper.packetevents.event.PacketListenerAbstract
import com.github.retrooper.packetevents.event.PacketListenerPriority
import com.github.retrooper.packetevents.event.PacketSendEvent
import com.github.retrooper.packetevents.protocol.packettype.PacketType
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerDestroyEntities
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerSpawnPlayer
import java.util.UUID
import org.bukkit.Bukkit
import org.bukkit.entity.Player
internal class ViewTrackingObserver(
private val scheduler: SchedulerService,
private val coordinator: ViewSessionCoordinator,
private val viewerResolver: (UUID) -> Player?,
) : PacketListenerAbstract(PacketListenerPriority.MONITOR) {
override fun onPacketSend(event: PacketSendEvent) {
val viewer = event.getPlayer<Any>() as? Player ?: return
if (coordinator.session(viewer.uniqueId) == null) {
return
}
when (event.packetType) {
PacketType.Play.Server.SPAWN_PLAYER -> observeSpawnPlayer(event, viewer)
PacketType.Play.Server.DESTROY_ENTITIES -> observeDestroyEntities(event, viewer)
}
}
private fun observeSpawnPlayer(event: PacketSendEvent, viewer: Player) {
val targetId = WrapperPlayServerSpawnPlayer(event).uuid
if (targetId == viewer.uniqueId) {
return
}
event.tasksAfterSend.add(
Runnable {
scheduler.runSync(
viewer,
Runnable {
val activeViewer = viewerResolver(viewer.uniqueId) ?: return@Runnable
val target = Bukkit.getPlayer(targetId) ?: return@Runnable
if (isTrackableViewTarget(activeViewer, target)) {
coordinator.trackTarget(activeViewer.uniqueId, target)
}
},
)
}
)
}
private fun observeDestroyEntities(event: PacketSendEvent, viewer: Player) {
val entityIds = WrapperPlayServerDestroyEntities(event).entityIds.copyOf()
if (entityIds.isEmpty()) {
return
}
event.tasksAfterSend.add(
Runnable {
scheduler.runSync(
viewer,
Runnable {
val activeViewer = viewerResolver(viewer.uniqueId) ?: return@Runnable
coordinator.removeTrackedEntities(activeViewer.uniqueId, entityIds)
},
)
}
)
}
}
// NOTE (AI): observeSpawnPlayer is lines 48-68 and observeDestroyEntities 70-87; both defer to the main thread via tasksAfterSend because they touch Bukkit player state.
Seed the entity tracker map with the spawned player's position inside a confirmed transaction.
EntityTracker.handle dispatches GPacketPlayServerSpawnNamedEntity to a connection-confirmed action: it builds a TrackerEntity from the wrapper's entity id and fixed-point coordinates, sets the position and puts it in trackerMap. S14 entity updates and S18 teleports mutate the entry under confirmation, and the map is interpolated on every flying packet in handlePost.
// ===== FILE: Tecnio-AntiHaxerman, src/main/java/me/tecnio/ahm/data/tracker/impl/EntityTracker.java =====
package me.tecnio.ahm.data.tracker.impl;
import ac.artemis.packet.spigot.wrappers.GPacket;
import ac.artemis.packet.wrapper.client.PacketPlayClientFlying;
import cc.ghast.packet.wrapper.packet.play.server.GPacketPlayServerEntity;
import cc.ghast.packet.wrapper.packet.play.server.GPacketPlayServerEntityDestroy;
import cc.ghast.packet.wrapper.packet.play.server.GPacketPlayServerEntityTeleport;
import cc.ghast.packet.wrapper.packet.play.server.GPacketPlayServerSpawnNamedEntity;
import lombok.Getter;
import me.tecnio.ahm.data.PlayerData;
import me.tecnio.ahm.data.tracker.Tracker;
import me.tecnio.ahm.util.player.TrackerEntity;
import java.util.HashMap;
import java.util.Map;
@Getter
public final class EntityTracker extends Tracker {
private final Map<Integer, TrackerEntity> trackerMap = new HashMap<>();
public EntityTracker(final PlayerData data) {
super(data);
}
@Override
public void handle(final GPacket packet) {
if (packet instanceof GPacketPlayServerEntity) {
final GPacketPlayServerEntity wrapper = ((GPacketPlayServerEntity) packet);
final int id = wrapper.getEntityId();
if (this.trackerMap.containsKey(id)) {
final TrackerEntity trackerEntity = this.trackerMap.get(id);
if (trackerEntity == null) return;
data.getConnectionTracker().confirm(() -> {
final double x = wrapper.getX();
final double y = wrapper.getY();
final double z = wrapper.getZ();
trackerEntity.serverPosX += x;
trackerEntity.serverPosY += y;
trackerEntity.serverPosZ += z;
trackerEntity.setPosition2(
trackerEntity.serverPosX / 32.0D,
trackerEntity.serverPosY / 32.0D,
trackerEntity.serverPosZ / 32.0D
);
});
}
} else if (packet instanceof GPacketPlayServerEntityTeleport) {
final GPacketPlayServerEntityTeleport wrapper = ((GPacketPlayServerEntityTeleport) packet);
final int id = wrapper.getEntityId();
if (this.trackerMap.containsKey(id)) {
final TrackerEntity trackerEntity = this.trackerMap.get(id);
if (trackerEntity == null) return;
data.getConnectionTracker().confirm(() -> {
trackerEntity.serverPosX = wrapper.getX();
trackerEntity.serverPosY = wrapper.getY();
trackerEntity.serverPosZ = wrapper.getZ();
final double d0 = (double) trackerEntity.serverPosX / 32.0D;
final double d1 = (double) trackerEntity.serverPosY / 32.0D;
final double d2 = (double) trackerEntity.serverPosZ / 32.0D;
final double deltaX = Math.abs(trackerEntity.getPosX() - d0);
final double deltaY = Math.abs(trackerEntity.getPosY() - d1);
final double deltaZ = Math.abs(trackerEntity.getPosZ() - d2);
if (deltaX < 0.03125D
&& deltaY < 0.015625D
&& deltaZ < 0.03125D) {
trackerEntity.setPosition2(trackerEntity.getPosX(), trackerEntity.getPosY(), trackerEntity.getPosZ());
} else {
trackerEntity.setPosition2(d0, d1, d2);
}
});
}
} else if (packet instanceof GPacketPlayServerSpawnNamedEntity) {
final GPacketPlayServerSpawnNamedEntity wrapper = ((GPacketPlayServerSpawnNamedEntity) packet);
data.getConnectionTracker().confirm(() -> {
final TrackerEntity trackerEntity = new TrackerEntity(wrapper.getEntityId(),
// Thank you artemis packet api for being shit and dividing my shit.
(int) Math.round(wrapper.getX() * 32.0D),
(int) Math.round(wrapper.getY() * 32.0D),
(int) Math.round(wrapper.getZ() * 32.0D)
);
trackerEntity.setPosition(wrapper.getX(), wrapper.getY(), wrapper.getZ());
this.trackerMap.put(wrapper.getEntityId(), trackerEntity);
});
} else if (packet instanceof GPacketPlayServerEntityDestroy) {
final GPacketPlayServerEntityDestroy wrapper = ((GPacketPlayServerEntityDestroy) packet);
for (final int entity : wrapper.getEntities()) {
this.trackerMap.remove(entity);
}
}
}
@Override
public void handlePost(final GPacket packet) {
if (packet instanceof PacketPlayClientFlying) {
this.trackerMap.values().forEach(TrackerEntity::update);
}
}
}
// NOTE (AI): The named-spawn branch is lines 82-95; note the fixed-point correction: the packet API divides coordinates, so the tracker re-multiplies by 32 before storing server-space positions.
Related Packets
Wiki Cross-Reference
If an entity with the same ID already exists on the client it is automatically deleted and replaced by the new entity.
MCP 1.8.9 S0CPacketSpawnPlayer implements Packet
1.8.9 callers: EntityTrackerEntry.createSpawnPacket sends new S0CPacketSpawnPlayer (line 501): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/entity/EntityTrackerEntry.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 S0CPacketSpawnPlayer
Full source walkthroughs of the modules and anti-cheats that use this packet.