0x0E S0EPacketSpawnObject

Spawns a non-living entity: item drop, boat, minecart, arrow, fireball, ender pearl, armor stand, etc.

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

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

entitymobspawnobject
Comprehensive 7/8

Fields

FieldTypeDescription
entityIdVarIntEntity ID
typeunsigned byteEntity type ID from EntityList (63=fireball, 64=smallFireball, 2=itemDrop, 1=boat)
x/y/zfixed-point intPosition × 32
pitch/yaw/headPitchbyteRotations × 256/360
velocityX/Y/ZshortVelocity × 8000
metadataDataWatcherEntity metadata

Wire Encoding

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

MCP References

MCPNetHandlerPlayClient.handleSpawnObject()

Handler Interface

HNDINetHandlerPlayClient

Notes

Entity types: 1=boat, 2=item, 50=TNTPrimed, 51=enderCrystal, 60=arrow, 61=snowball, 62=egg, 63=fireball, 64=smallFireball, 65=enderPearl, 66=witherSkull, 67=shulkerBullet, 68=llamaSpit, 90=fishingFloat, 91=spectralArrow, 93=dragonFireball. Used by AntiFireball (attack fireballs), ItemESP (track items), and BoatFly.

Vanilla Source

S0EPacketSpawnObject.java228 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.util.MathHelper;
9
10
public class S0EPacketSpawnObject implements Packet<INetHandlerPlayClient>
11
{
12
    private int entityId;
13
    private int x;
14
    private int y;
15
    private int z;
16
    private int speedX;
17
    private int speedY;
18
    private int speedZ;
19
    private int pitch;
20
    private int yaw;
21
    private int type;
22
    private int field_149020_k;
23
24
    public S0EPacketSpawnObject()
25
    {
26
    }
27
28
    public S0EPacketSpawnObject(Entity entityIn, int typeIn)
29
    {
30
        this(entityIn, typeIn, 0);
31
    }
32
33
    public S0EPacketSpawnObject(Entity entityIn, int typeIn, int p_i45166_3_)
34
    {
35
        this.entityId = entityIn.getEntityId();
36
        this.x = MathHelper.floor_double(entityIn.posX * 32.0D);
37
        this.y = MathHelper.floor_double(entityIn.posY * 32.0D);
38
        this.z = MathHelper.floor_double(entityIn.posZ * 32.0D);
39
        this.pitch = MathHelper.floor_float(entityIn.rotationPitch * 256.0F / 360.0F);
40
        this.yaw = MathHelper.floor_float(entityIn.rotationYaw * 256.0F / 360.0F);
41
        this.type = typeIn;
42
        this.field_149020_k = p_i45166_3_;
43
44
        if (p_i45166_3_ > 0)
45
        {
46
            double d0 = entityIn.motionX;
47
            double d1 = entityIn.motionY;
48
            double d2 = entityIn.motionZ;
49
            double d3 = 3.9D;
50
51
            if (d0 < -d3)
52
            {
53
                d0 = -d3;
54
            }
55
56
            if (d1 < -d3)
57
            {
58
                d1 = -d3;
59
            }
60
61
            if (d2 < -d3)
62
            {
63
                d2 = -d3;
64
            }
65
66
            if (d0 > d3)
67
            {
68
                d0 = d3;
69
            }
70
71
            if (d1 > d3)
72
            {
73
                d1 = d3;
74
            }
75
76
            if (d2 > d3)
77
            {
78
                d2 = d3;
79
            }
80
81
            this.speedX = (int)(d0 * 8000.0D);
82
            this.speedY = (int)(d1 * 8000.0D);
83
            this.speedZ = (int)(d2 * 8000.0D);
84
        }
85
    }
86
87
    /**
88
     * Reads the raw packet data from the data stream.
89
     */
90
    public void readPacketData(PacketBuffer buf) throws IOException
91
    {
92
        this.entityId = buf.readVarIntFromBuffer();
93
        this.type = buf.readByte();
94
        this.x = buf.readInt();
95
        this.y = buf.readInt();
96
        this.z = buf.readInt();
97
        this.pitch = buf.readByte();
98
        this.yaw = buf.readByte();
99
        this.field_149020_k = buf.readInt();
100
101
        if (this.field_149020_k > 0)
102
        {
103
            this.speedX = buf.readShort();
104
            this.speedY = buf.readShort();
105
            this.speedZ = buf.readShort();
106
        }
107
    }
108
109
    /**
110
     * Writes the raw packet data to the data stream.
111
     */
112
    public void writePacketData(PacketBuffer buf) throws IOException
113
    {
114
        buf.writeVarIntToBuffer(this.entityId);
115
        buf.writeByte(this.type);
116
        buf.writeInt(this.x);
117
        buf.writeInt(this.y);
118
        buf.writeInt(this.z);
119
        buf.writeByte(this.pitch);
120
        buf.writeByte(this.yaw);
121
        buf.writeInt(this.field_149020_k);
122
123
        if (this.field_149020_k > 0)
124
        {
125
            buf.writeShort(this.speedX);
126
            buf.writeShort(this.speedY);
127
            buf.writeShort(this.speedZ);
128
        }
129
    }
130
131
    /**
132
     * Passes this Packet on to the NetHandler for processing.
133
     */
134
    public void processPacket(INetHandlerPlayClient handler)
135
    {
136
        handler.handleSpawnObject(this);
137
    }
138
139
    public int getEntityID()
140
    {
141
        return this.entityId;
142
    }
143
144
    public int getX()
145
    {
146
        return this.x;
147
    }
148
149
    public int getY()
150
    {
151
        return this.y;
152
    }
153
154
    public int getZ()
155
    {
156
        return this.z;
157
    }
158
159
    public int getSpeedX()
160
    {
161
        return this.speedX;
162
    }
163
164
    public int getSpeedY()
165
    {
166
        return this.speedY;
167
    }
168
169
    public int getSpeedZ()
170
    {
171
        return this.speedZ;
172
    }
173
174
    public int getPitch()
175
    {
176
        return this.pitch;
177
    }
178
179
    public int getYaw()
180
    {
181
        return this.yaw;
182
    }
183
184
    public int getType()
185
    {
186
        return this.type;
187
    }
188
189
    public int func_149009_m()
190
    {
191
        return this.field_149020_k;
192
    }
193
194
    public void setX(int newX)
195
    {
196
        this.x = newX;
197
    }
198
199
    public void setY(int newY)
200
    {
201
        this.y = newY;
202
    }
203
204
    public void setZ(int newZ)
205
    {
206
        this.z = newZ;
207
    }
208
209
    public void setSpeedX(int newSpeedX)
210
    {
211
        this.speedX = newSpeedX;
212
    }
213
214
    public void setSpeedY(int newSpeedY)
215
    {
216
        this.speedY = newSpeedY;
217
    }
218
219
    public void setSpeedZ(int newSpeedZ)
220
    {
221
        this.speedZ = newSpeedZ;
222
    }
223
224
    public void func_149002_g(int p_149002_1_)
225
    {
226
        this.field_149020_k = p_149002_1_;
227
    }
228
}

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

Deep Dive

Role in the protocol

The spawn packet for every non-living entity: item drops (type 2), boats (1), minecarts (10), TNT (50), ender crystals (51), arrows and spectral arrows (60/91), snowballs (61), eggs (62), fireballs and small fireballs (63/64), ender pearls (65), wither skulls (66), fishing hooks (90), falling blocks (70), item frames (71), armor stands (78) and more. The server's EntityTrackerEntry.getPacket builds it with the EntityList type code, fixed-point position (x32), byte rotations (x256/360) and short velocity (x8000), and the third constructor argument packs a per-type data int: the shooter entity id for arrows and fireballs, the block state id for falling blocks, the minecart type for carts, the facing index for item frames.

Vanilla handling

NetHandlerPlayClient.handleSpawnObject reads the entity id, type byte, position, three rotations, the three velocity shorts and the trailing DataWatcher, then creates the entity through EntityList.createEntityByID and applies the transform. For projectile types the data int is used to look up the throwing entity so the client can attribute the projectile. Server side, the same packet class is the output of EntityTrackerEntry.getPacket, which is why the type codes and the data int semantics are defined by the server's tracking code, not by the packet class itself.

Why clients touch it

None of the 8 reference clients hook S0E in any module. The corpus shows only vanilla files plus Rise 6.1.30/6.2.4 NetworkAPI.java, which lists S0EPacketSpawnObject in the packet registry that the scripting API exposes to scripts. The absence is structural: ESP, Tracers and KillAura in these clients iterate world.getLoadedEntityList on render ticks instead of hooking spawn packets, so they never see S0E, and the throwable-specific combat modules of the wider ecosystem (AntiFireball-style projectile attackers, item ESP) are not present in this corpus.

Exploit surface

The packet is server-trusted end to end, so the attack surface is client-side robustness: extreme velocity shorts, bogus type codes and oversized DataWatcher payloads are the classic crash vectors, and armor stand floods (type 78) were the 1.8-era lag exploit. For anti-cheat work the interesting field is the data int: a projectile carrying the player's entity id as owner is the standard signal AntiFireball-style modules use, and servers that simulate projectiles server-side validate the owner id against the tracker. Anti-cheats that replay or predict projectile trajectories reconstruct them from S0E position and velocity, so the packet is a timing reference for those checks.

Server-Side Handling

EntityTrackerEntry.getPacket switches on the tracked entity class and returns S0E with a type code from EntityList, position x32, yaw/pitch byte rotations and motion x8000 shorts. The third constructor int is type-specific: shooter entity id for arrows and fireballs (0 when the shooter is gone), block state id for falling blocks, minecart type id for carts, facing horizontal index for item frames. The client handler creates the entity and applies the transform; for arrows the data int resolves the thrower so the client can render the correct owner.

Protocol Analysis

Entity id and type are VarInt/unsigned byte; position is three ints at x32, rotations are three bytes at x256/360 (yaw, pitch, head pitch), velocity is three shorts at x8000. A DataWatcher block terminates the packet only when the entity has metadata; most non-living types send an empty watcher. The same type codes are shared with the 1.8 EntityList server-side table, so a mismatch between client and server entity registries despawns the entity silently.

Anti-Cheat Landscape

Nothing client-controlled is flaggable here because the packet is purely clientbound and server-authored. Anti-cheats use it indirectly: projectile simulation checks reconstruct arrow and fireball paths from S0E and replay them to catch players who dodge impossibly, and servers rate-limit object spawns to stop item/armor stand flood lag exploits. No reference client touches it, so there is no bypass trade-off to document beyond the generic entity-spawn flood mitigations.

implementation Implementation Cases

The spawn packet for all non-living entities: items, vehicles, TNT, projectiles, armor stands. In the 8-client corpus it is untouched by modules: ESP iterates the world entity list instead of hooking spawn packets, and the only non-vanilla reference is Rise's NetworkAPI script registry. Documented for protocol completeness and for the projectile-attribution semantics modules in other ecosystems build on.

The only client-side difference in the corpus is Rise 6.1.30/6.2.4 exposing S0EPacketSpawnObject.class in NetworkAPI's packet list for the scripting system; every other client reference is the bundled vanilla NetHandlerPlayClient, EntityTrackerEntry, EnumConnectionState and INetHandlerPlayClient.

anticheat Anti-Cheat Checks

S0E spawns a generic entity (item, TNT, boat, arrow) with a type id, position and velocity, and is the most common spawn packet in the protocol. Server-side anticheats treat the spawn-object family as the feed for their entity replication: every spawn registers an entity in the compensated world so reach and killaura checks can measure vectors to real targets, and fake-entity bait mechanisms reuse the same family to lure auras. The corpus hits on S0E are therefore the spawn listeners themselves (Grim PacketEntityReplication, Hydro EntityTracker, Kauri PacketHandler, FlopAC WrappedOutSpawnEntityPacket) plus the anti-aura bait code that reuses spawn packets (Kauri FakeMob, Peyang NPC, Shard ViewTrackingObserver).

PacketEntityReplication (Grim) (GrimAnticheat-Grim)

Replicate every server-side entity spawn, including the S0E spawn-object packet, into the simulated world that reach and hitbox checks run against.

PacketSendListener handles SPAWN_ENTITY (S0E), SPAWN_LIVING_ENTITY, SPAWN_PLAYER and SPAWN_PAINTING, calling addEntity with the id, uuid, type and position; subsequent relative moves, teleports, rotations, metadata and equipment updates are applied inside latency-compensated realtime tasks, and despawns are queued per transaction. It also blocks ViaVersion's faked levitation effects and drives the spawn-teleport acceptance state used by setbacks.

Detects: Reach and killaura cheats are measured against the replicated boxes, so the check is the data foundation rather than a flag; it keeps the anticheat from being fooled by spoofed spawn state.

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

Variations: Hydro EntityTracker and Tecnio-AntiHaxerman EntityTracker maintain the same replicated list with transaction-confirmed movement; Artemis replicates entities in its v1/v2 emulators; Intave keeps a dedicated EntityTracker fed by spawn events; Kauri tracks real spawns in PacketHandler and pairs them with FakeMob bait.
EntityTracker (Hydro) (Incognitolol-Hydro)

Keep a transaction-synced map of every spawned entity so reach and aura checks can query positions and distances.

The outgoing pre-handler processes the spawn family (living entities and players) plus relative moves, teleports and destroys; entity positions are only mutated inside transaction-confirmed tasks, and post-transaction updates refresh the list. Exposes distance, closest-entity and within-distance queries used by the combat checks.

Detects: Supplies the target positions for Hydro's hitbox and reach checks; a client that fakes entity state cannot alter the server-derived list.

Source: Incognitolol-Hydro, src/main/java/integral/studios/hydro/model/tracker/impl/EntityTracker.java

Variations: Grim PacketEntityReplication and Tecnio-AntiHaxerman EntityTracker are the same idea on different packet abstractions; FlopAC's reach processor consumes WrappedOutSpawnEntityPacket for its own entity list.
FakeMob bait (Kauri) (funkemunky-KauriV3)

Spawn invisible fake entities whose ids are registered with the tracker, baiting killaura into attacking something that does not exist on the server.

FakeMob allocates an entity id in the 1.5-2 billion range to avoid colliding with real ids, then sends a spawn packet with the invisible metadata flag to the suspect; the fake is registered in the FakeTracker and can be moved, teleported and despawned. Kauri's PacketHandler separately consumes the real spawn family (SPAWN_ENTITY, SPAWN_LIVING_ENTITY, SPAWN_PLAYER, SPAWN_PAINTING) to keep its entity list current. An aura that turns toward or attacks the fake produces hits against an entity the server never spawned.

Detects: Killaura that targets any visible entity regardless of legitimacy.

Source: funkemunky-KauriV3, Anticheat/src/main/java/dev/brighten/ac/handler/entity/FakeMob.java

Variations: PeyangSuperbAntiCheat NPC.java does the same with a fake player placed 3 blocks in front of the suspect; CheaterDeleter PhaseBypassTracker watches spawn and teleport events to detect phase attempts around spawn; Shard's ViewTrackingObserver monitors which entities the client renders.
NPC bait (PeyangSuperbAntiCheat) (P2P-Develop-PeyangSuperbAntiCheat)

Spawn a fake player three blocks in front of the suspect and flag aura that hits it.

spawn() builds an EntityPlayer NPC, positions it facing the suspect at 3 blocks distance, sends player-info and named-entity-spawn packets to the suspect and to staff, then hides the NPC from the suspect via Bukkit hidePlayer so only the aura's entity list sees it. The NPC is destroyed after a configured number of seconds; the teleport handler moves it around the player to catch aura that tracks it.

Detects: Killaura and hitboxes that attack an entity the real client cannot see.

Source: P2P-Develop-PeyangSuperbAntiCheat, src/main/java/ml/peya/plugins/Detect/NPC.java

Variations: Kauri FakeMob is the same bait pattern with a generic entity; network-dev-MinecraftAntiCheat NPC.java runs the same idea on a different base; Intave mirrors the spawn feed in module/tracker/entity/EntityTracker and emits EntitySpawnEvent records.

Wiki Cross-Reference

Non-living spawn: VarInt id, type byte (1 boat, 2 item, 50 TNT, 60 arrow, 65 pearl, 78 armor stand), fixed-point pos x/32.

Yaw and pitch are byte angles value x360/256; velocity shorts value/8000 are present only when the data int is positive.

Trailing data int is type-specific: shooter entity id for projectiles, block id for falling blocks, facing for item frames.

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

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