0x0F S0FPacketSpawnMob

Spawns a living entity (mob/animal/monster) with entity type, position, rotation, velocity, and metadata.

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

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

entitymobspawncreature
Comprehensive 8/8

Fields

FieldTypeDescription
entityIdVarIntEntity ID
typeunsigned byteMob type (50=creeper, 51=skeleton, 52=spider, 54=zombie, etc.)
x/y/zfixed-point intPosition × 32
yaw/pitch/headYawbyteRotations × 256/360
velocityX/Y/ZshortVelocity × 8000
metadataDataWatcherEntity data watcher

Wire Encoding

FieldTypeNotes
Entity IDVarInt
TypeUnsigned ByteEntityList ID
XIntx * 32
YInty * 32
ZIntz * 32
Yawbyteyaw * 256/360
Pitchbytepitch * 256/360
Head PitchbyteheadYaw * 256/360
Velocity Xshort
Velocity Yshort
Velocity Zshort
MetadataDataWatcher

MCP References

MCPNetHandlerPlayClient.handleSpawnMob()

Handler Interface

HNDINetHandlerPlayClient

Notes

Entity types: 50=creeper, 51=skeleton, 52=spider, 53=giant, 54=zombie, 55=slime, 56=ghast, 57=zombiePigman, 58=enderman, 59=caveSpider, 60=silverfish, 61=blaze, 62=magmaCube, 63=enderDragon, 64=wither, 65=bats, 66=witch, 67=endermite, 68=guardian, 69=shulker, 90=pig, 91=sheep, 92=cow, 93=chicken, 94=squid, 95=wolf, 96=mooshroom, 97=snowman, 98=ocelot, 99=ironGolem, 100=horse, 101=rabbit, 120=villager.

Vanilla Source

S0FPacketSpawnMob.java194 lines · MCP 1.8.9Original ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import java.util.List;
5
import net.minecraft.entity.DataWatcher;
6
import net.minecraft.entity.EntityList;
7
import net.minecraft.entity.EntityLivingBase;
8
import net.minecraft.network.Packet;
9
import net.minecraft.network.PacketBuffer;
10
import net.minecraft.network.play.INetHandlerPlayClient;
11
import net.minecraft.util.MathHelper;
12
13
public class S0FPacketSpawnMob implements Packet<INetHandlerPlayClient>
14
{
15
    private int entityId;
16
    private int type;
17
    private int x;
18
    private int y;
19
    private int z;
20
    private int velocityX;
21
    private int velocityY;
22
    private int velocityZ;
23
    private byte yaw;
24
    private byte pitch;
25
    private byte headPitch;
26
    private DataWatcher field_149043_l;
27
    private List<DataWatcher.WatchableObject> watcher;
28
29
    public S0FPacketSpawnMob()
30
    {
31
    }
32
33
    public S0FPacketSpawnMob(EntityLivingBase entityIn)
34
    {
35
        this.entityId = entityIn.getEntityId();
36
        this.type = (byte)EntityList.getEntityID(entityIn);
37
        this.x = MathHelper.floor_double(entityIn.posX * 32.0D);
38
        this.y = MathHelper.floor_double(entityIn.posY * 32.0D);
39
        this.z = MathHelper.floor_double(entityIn.posZ * 32.0D);
40
        this.yaw = (byte)((int)(entityIn.rotationYaw * 256.0F / 360.0F));
41
        this.pitch = (byte)((int)(entityIn.rotationPitch * 256.0F / 360.0F));
42
        this.headPitch = (byte)((int)(entityIn.rotationYawHead * 256.0F / 360.0F));
43
        double d0 = 3.9D;
44
        double d1 = entityIn.motionX;
45
        double d2 = entityIn.motionY;
46
        double d3 = entityIn.motionZ;
47
48
        if (d1 < -d0)
49
        {
50
            d1 = -d0;
51
        }
52
53
        if (d2 < -d0)
54
        {
55
            d2 = -d0;
56
        }
57
58
        if (d3 < -d0)
59
        {
60
            d3 = -d0;
61
        }
62
63
        if (d1 > d0)
64
        {
65
            d1 = d0;
66
        }
67
68
        if (d2 > d0)
69
        {
70
            d2 = d0;
71
        }
72
73
        if (d3 > d0)
74
        {
75
            d3 = d0;
76
        }
77
78
        this.velocityX = (int)(d1 * 8000.0D);
79
        this.velocityY = (int)(d2 * 8000.0D);
80
        this.velocityZ = (int)(d3 * 8000.0D);
81
        this.field_149043_l = entityIn.getDataWatcher();
82
    }
83
84
    /**
85
     * Reads the raw packet data from the data stream.
86
     */
87
    public void readPacketData(PacketBuffer buf) throws IOException
88
    {
89
        this.entityId = buf.readVarIntFromBuffer();
90
        this.type = buf.readByte() & 255;
91
        this.x = buf.readInt();
92
        this.y = buf.readInt();
93
        this.z = buf.readInt();
94
        this.yaw = buf.readByte();
95
        this.pitch = buf.readByte();
96
        this.headPitch = buf.readByte();
97
        this.velocityX = buf.readShort();
98
        this.velocityY = buf.readShort();
99
        this.velocityZ = buf.readShort();
100
        this.watcher = DataWatcher.readWatchedListFromPacketBuffer(buf);
101
    }
102
103
    /**
104
     * Writes the raw packet data to the data stream.
105
     */
106
    public void writePacketData(PacketBuffer buf) throws IOException
107
    {
108
        buf.writeVarIntToBuffer(this.entityId);
109
        buf.writeByte(this.type & 255);
110
        buf.writeInt(this.x);
111
        buf.writeInt(this.y);
112
        buf.writeInt(this.z);
113
        buf.writeByte(this.yaw);
114
        buf.writeByte(this.pitch);
115
        buf.writeByte(this.headPitch);
116
        buf.writeShort(this.velocityX);
117
        buf.writeShort(this.velocityY);
118
        buf.writeShort(this.velocityZ);
119
        this.field_149043_l.writeTo(buf);
120
    }
121
122
    /**
123
     * Passes this Packet on to the NetHandler for processing.
124
     */
125
    public void processPacket(INetHandlerPlayClient handler)
126
    {
127
        handler.handleSpawnMob(this);
128
    }
129
130
    public List<DataWatcher.WatchableObject> func_149027_c()
131
    {
132
        if (this.watcher == null)
133
        {
134
            this.watcher = this.field_149043_l.getAllWatched();
135
        }
136
137
        return this.watcher;
138
    }
139
140
    public int getEntityID()
141
    {
142
        return this.entityId;
143
    }
144
145
    public int getEntityType()
146
    {
147
        return this.type;
148
    }
149
150
    public int getX()
151
    {
152
        return this.x;
153
    }
154
155
    public int getY()
156
    {
157
        return this.y;
158
    }
159
160
    public int getZ()
161
    {
162
        return this.z;
163
    }
164
165
    public int getVelocityX()
166
    {
167
        return this.velocityX;
168
    }
169
170
    public int getVelocityY()
171
    {
172
        return this.velocityY;
173
    }
174
175
    public int getVelocityZ()
176
    {
177
        return this.velocityZ;
178
    }
179
180
    public byte getYaw()
181
    {
182
        return this.yaw;
183
    }
184
185
    public byte getPitch()
186
    {
187
        return this.pitch;
188
    }
189
190
    public byte getHeadPitch()
191
    {
192
        return this.headPitch;
193
    }
194
}

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

Deep Dive

Role in the protocol

The living-entity counterpart of S0E: mobs, animals and monsters spawn through S0F instead of S0E. EntityTrackerEntry.getPacket returns it for every EntityLivingBase; the payload carries the entity id, the EntityList type code (50=creeper up through 120=villager), fixed-point position (x32), yaw/pitch/head rotations (x256/360), velocity shorts (x8000) and a full DataWatcher block. The metadata is what renders health, potion effects and nametags without follow-up packets, which makes S0F one of the heaviest spawn packets on the wire.

Vanilla handling

handleSpawnMob creates the living entity through EntityList.createEntityByID, sets position and rotations, applies the velocity and reads the DataWatcher. Server side, EntityTrackerEntry deliberately suppresses the velocity-update packet on the spawn tick: the sendVelocityUpdates branch skips entities that just arrived via S0F because the spawn packet already carries the initial motion, avoiding a redundant S12 immediately after spawn.

Why clients touch it

No user-facing module in the 8 clients references S0F. Mob ESP, KillAura target lists and Tracers here iterate the loaded entity list each render frame rather than hooking spawn packets, so they consume the spawned EntityLivingBase objects after vanilla handling instead of the packet itself. The only non-vanilla client code is Rise's TranslationComponent (the PacketType enum's SPAWN_MOB entry decodes the fixed-point coordinates into the entity-position map used by the Translation bypass) and the NetworkAPI script registry listing the class.

Exploit surface

The DataWatcher is the attack surface: a crafted metadata block can declare absurd health, invisible flags or armor values, and mob spawn floods are the classic lag vector. The type byte is unvalidated by the client, so a proxy-crafted id despawns the entity silently. For bypass engineering the interesting property is that S0F is the only clientbound packet that fully defines an entity's state at once, which is why the Translation component hooks it: rewriting the spawn position desyncs the client's rendering from the server's simulation without emitting a single movement packet.

Server-Side Handling

EntityTrackerEntry.getPacket returns new S0FPacketSpawnMob((EntityLivingBase) trackedEntity) for any tracked living entity, and the sendVelocityUpdates branch skips S12 on the same tick the mob spawns because the spawn packet already carries initial velocity. The packet constructor snapshots position, rotations, velocity and the full DataWatcher at tracking time. The client handler reverses this: create entity, set transform, apply motion, read metadata.

Protocol Analysis

Same fixed-point layout as S0E: VarInt entity id, unsigned byte type, three x32 ints, three rotation bytes, three x8000 velocity shorts, then the DataWatcher block which is mandatory for living entities and can run to dozens of bytes. Because the type id is the EntityList id and not the entity class, the client must have a matching entity registry or the spawn is dropped.

Anti-Cheat Landscape

Anti-cheats use S0F as a state anchor: knockback checks know the mob's spawn velocity, and bot-detection heuristics on some servers correlate S0F rate with chunk activity. The Translation-style spawn repositioning is a rendering-layer desync, invisible to server-side movement checks but detectable by servers that verify client-reported entity positions. No reference client ships a module that abuses it; the corpus hit is purely the component infrastructure.

implementation Implementation Cases

The spawn packet for every living mob, carrying a full DataWatcher. No module in the 8 clients hooks it: ESP and KillAura read the world entity list instead. The one piece of real client code is Rise's TranslationComponent, whose PacketType enum decodes S0F spawn coordinates into the position map that powers its spawn-repositioning bypass.

PacketType / TranslationComponent (SPAWN_MOB) (Rise 6.1.30, Rise 6.2.4)

Decode S0F spawn coordinates and rotations into the entity-position map that the Translation bypass feeds on.

PacketType is an enum registry consumed by TranslationComponent on every PacketReceiveEvent: the SPAWN_MOB entry casts to S0FPacketSpawnMob, converts x32 ints to doubles and x256/360 bytes to floats, and stores a Position in the entityPositions map keyed by entity id. Subsequent S14/S18 packets update the same map, and S13 removes entries.

Source: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/component/impl/player/translation/PacketType.java

Vanilla hook: PacketReceiveEvent, consumed by the TranslationComponent in both Rise 6.1.30 and 6.2.4.
Repositioning on spawn is a rendering desync, not a movement cheat: the server never sees it because no serverbound packet is involved. It only matters to servers that reconcile client-rendered entity positions, and it carries no flag risk for the player's own movement.
Variations: The PacketType enum is byte-identical in intent across 6.1.30 and 6.2.4; 6.2.4 also carries ENTITY_HEAD_LOOK. This is the only non-vanilla reference to S0F in the 8-client corpus.
No module-level hooks exist for S0F in the corpus; the only hook surface is Rise's TranslationComponent component consuming PacketReceiveEvent.
All other clients touch S0F only through the bundled vanilla handler; Rise additionally exposes it in NetworkAPI's script packet list.

anticheat Anti-Cheat Checks

The living-entity spawn packet carries the full state of a mob: type, position, rotations, velocity and the DataWatcher. Anticheats consume it on the send side to learn entity ids and types before any reach or hitbox measurement: Photon caches the entity type per id, TruthfulAC snapshots the spawn box into its compensation history, and Grim replicates the entity into the simulation used by reach and knockback checks. The type byte matters because hitbox dimensions depend on it, and a spawn without a tracker entry would leave every later entity packet orphaned.

Living-entity id lookup (Photon) (Photon-GitHub-AntiCheatAddition)

Cache the entity type for every spawned living entity so later modules can resolve an entity id to its type without Bukkit lookups.

LivingEntityIdLookup registers a PacketSendEvent listener for SPAWN_LIVING_ENTITY, wraps the packet as WrapperPlayServerSpawnLivingEntity and stores (entityId, entityType) in a Guava cache capped at one million entries with a five-second default expiry. A delayed task pre-warms the cache from all loaded worlds at startup, and getEntityType serves id-to-type lookups for modules that need hitbox or behavior data.

Detects: Nothing: it is a utility cache. Modules such as the DamageIndicator and information hider consume it.

Source: Photon-GitHub-AntiCheatAddition, src/main/java/de/photon/anticheataddition/util/protocol/LivingEntityIdLookup.java

Variations: Grim replicates the full entity with metadata and rotations; Artemis resolves spawn ids through its EntityType registry; intave keeps EntityTypeDataRegistry with per-type hitbox sizes.
Spawn compensation (TruthfulAC) (TawnyE-TruthfulAC)

Snapshot every spawned entity's position and hitbox into the compensation history so reach checks can backtrack against it.

TruthfulPacketListener routes SPAWN_ENTITY (the 1.19+ living spawn) into CompensationTracker.handleSpawn, which stores a CompensatedEntity keyed by id with a ring of up to 30 tick snapshots and a base reach taken from the entity type (3.0 for players, 1.5 boats, 4.5 shulkers). handleEntitySnapshot re-stamps live Bukkit entities each tick, and getEntityData serves the backtracking reach check with up to 8 ticks of history.

Detects: Nothing directly; it is the compensation data layer behind the reach and hitbox checks.

Source: TawnyE-TruthfulAC, src/main/java/ret/tawny/truthful/compensation/CompensationTracker.java

Variations: Grim replicates spawns into compensatedEntities; Hydro inserts a TrackedEntity; Tecnio and Artemis seed their reach trackers from the same packet family.
Entity replication (Grim) (GrimAnticheat-Grim)

Replicate every spawned entity, including mobs, into the compensated entity map so reach, hitbox and velocity checks see the client's view.

PacketEntityReplication.onPacketSend wraps SPAWN_LIVING_ENTITY as WrapperPlayServerSpawnLivingEntity and calls addEntity with entity id, uuid, type, position, rotations and the full metadata. The replicated entity then receives S14 relative moves and S18 teleports exactly like the client's copy, and DESTROY_ENTITIES removes it after the transaction that delivers the packet. Spawn velocity from the packet feeds knockback compensation without a separate S12.

Detects: Nothing directly: it is the replication layer. Reach and velocity checks consume the map, and the firework-boost path even setbacks players who destroy a boosting firework entity early.

Source: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/events/packets/PacketEntityReplication.java

Variations: Shard adds living spawns to compensatedEntities; Hydro tracks them in its entityMap; Kauri routes SPAWN_LIVING_ENTITY through its PacketHandler into the world tracker.

Wiki Cross-Reference

Living-entity spawn: VarInt id, unsigned-byte EntityList type (50 creeper through 120 villager), pos x/32, angles x360/256, vel /8000.

Carries a mandatory DataWatcher block rendering health, effects and nametags; tracker skips a duplicate S12 on the spawn tick.

MCP 1.8.9 S0FPacketSpawnMob implements Packet dispatching to INetHandlerPlayClient.handleSpawnMob; wire serde is readPacketData/writePacketData via readByte, readInt, readShort, readVarIntFromBuffer.

1.8.9 callers: EntityTrackerEntry.createSpawnPacket sends new S0FPacketSpawnMob (line 515): 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 S0FPacketSpawnMob

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