0x13 S13PacketDestroyEntities

Removes one or more entities from the client's render list.

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

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

entitydespawn
Comprehensive 8/8

Fields

FieldTypeDescription
entityIDsVarInt[]Array of entity IDs to destroy

Wire Encoding

FieldTypeNotes
CountVarIntNumber of entities
Entity IDsVarInt arrayOne VarInt per entity

MCP References

MCPNetHandlerPlayClient.handleDestroyEntities()

Handler Interface

HNDINetHandlerPlayClient

Notes

This is how entities are removed when they die, despawn, or players disconnect.

Vanilla Source

S13PacketDestroyEntities.java59 lines · MCP 1.8.9Original ↗
1
package net.minecraft.network.play.server;
2
3
import java.io.IOException;
4
import net.minecraft.network.Packet;
5
import net.minecraft.network.PacketBuffer;
6
import net.minecraft.network.play.INetHandlerPlayClient;
7
8
public class S13PacketDestroyEntities implements Packet<INetHandlerPlayClient>
9
{
10
    private int[] entityIDs;
11
12
    public S13PacketDestroyEntities()
13
    {
14
    }
15
16
    public S13PacketDestroyEntities(int... entityIDsIn)
17
    {
18
        this.entityIDs = entityIDsIn;
19
    }
20
21
    /**
22
     * Reads the raw packet data from the data stream.
23
     */
24
    public void readPacketData(PacketBuffer buf) throws IOException
25
    {
26
        this.entityIDs = new int[buf.readVarIntFromBuffer()];
27
28
        for (int i = 0; i < this.entityIDs.length; ++i)
29
        {
30
            this.entityIDs[i] = buf.readVarIntFromBuffer();
31
        }
32
    }
33
34
    /**
35
     * Writes the raw packet data to the data stream.
36
     */
37
    public void writePacketData(PacketBuffer buf) throws IOException
38
    {
39
        buf.writeVarIntToBuffer(this.entityIDs.length);
40
41
        for (int i = 0; i < this.entityIDs.length; ++i)
42
        {
43
            buf.writeVarIntToBuffer(this.entityIDs[i]);
44
        }
45
    }
46
47
    /**
48
     * Passes this Packet on to the NetHandler for processing.
49
     */
50
    public void processPacket(INetHandlerPlayClient handler)
51
    {
52
        handler.handleDestroyEntities(this);
53
    }
54
55
    public int[] getEntityIDs()
56
    {
57
        return this.entityIDs;
58
    }
59
}

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

Deep Dive

Role in the protocol

The batch removal packet: a VarInt count followed by that many VarInt entity ids. The server flushes it from EntityPlayerMP.destroyEntitiesInWorld each tick with the accumulated destroy list, and sends the single-id form when a specific entity is removed (player disconnect, entity despawn). The client removes each id from the world's loaded entity list and clears the render manager's entry in handleDestroyEntities, which is how dead mobs, picked-up items and left players vanish.

Vanilla handling

EntityPlayerMP accumulates entity ids to destroy and sends one S13 per tick in destroyEntitiesInWorld; the single-id constructor is used by removeEntity and on player disconnects. NetHandlerPlayClient.handleDestroyEntities iterates the ids, removes each from world.loadedEntityList, clears the entity's render state and drops it from the client's entity lookup. Because removal is id-based and immediate, any client cache keyed by entity id must prune itself on S13 or it will hold stale entries.

Why clients touch it

Cleanup is the theme. Sigma 4.11 Ranking removes hit and prosecutor records for destroyed ids so a kill stat cannot fire after the target despawns. Rise's TranslationComponent maps S13 through the DESTROY_ENTITY entry of its PacketType enum, deleting the entity's position from the bypass map. Rise's PingSpoofComponent buffers S13 inside the players tuple so destruction stays ordered relative to held entity updates. KillAura and ESP target lists in these clients hold entity objects from the world list, so the vanilla removal handles them with no packet hook. November Recode 2.0's AntiBotModule watches S13 in WATCHDOG mode: when the destroyed ids include the bot it detected above the player, it prints a staff-removal notice and re-arms the spawn veto.

Exploit surface

S13 is a pure removal vector: the server despawns arbitrary ids, and the client has no say in it. The abuse angle is timing: entities destroyed on the server remain attackable client-side only if the client delays the packet, which is exactly what buffering S13 in PingSpoofComponent does, keeping ghost entities alive for the spoof window. Anti-cheats watch for players attacking ids that were destroyed server-side (attack-after-desync), the signature of ghost-entity kill aura; a client that buffers S13 must also stop targeting those ids when the flush lands.

Server-Side Handling

EntityPlayerMP.destroyEntitiesInWorld collects pending entity ids and sends a single S13 per tick; the single-id form is sent by removeEntity and on player disconnects. The client handler iterates the ids, removes each entity from world.loadedEntityList, clears its render state and drops it from the entity lookup. No validation is applied to the id list, so ids that do not exist are ignored.

Protocol Analysis

VarInt count, then count VarInt entity ids. The count field makes the packet self-describing; 1.8 clients accept any count including 0. Entity ids are server-assigned and unique per world session, which is why id-keyed caches (Sigma's hit maps, Rise's translation map) can prune by id without ambiguity. The packet is emitted every tick the destroy list is non-empty, so it arrives in bursts.

Anti-Cheat Landscape

The packet itself is never flagged; its timing is. Attack-after-desync detection compares the ids a client attacks with the ids the server destroyed, so any buffering or replay of S13 that outlives the destroy is the detectable pattern. Ping-spoof buffering of S13 is safe only while the flush stays inside the anticheat's entity-desync tolerance, which is why Rise pairs the component with per-anticheat velocity and teleport handling.

implementation Implementation Cases

The batch entity-removal packet. In the reference corpus its handlers are all cache pruning: Sigma's Ranking drops hit/prosecutor records, Rise's TranslationComponent removes map entries through DESTROY_ENTITY, and Rise's PingSpoofComponent buffers it with the entity stream so destruction stays ordered while ping spoofing. KillAura and ESP need no hook because their target lists are world-entity objects.

Ranking (Sigma 4.11)

Track kills and deaths against named players and report stats, pruning records when targets despawn.

Hidden module that records attacked players in hitEntities and suspects in prosecutorEntities via EventAttack, correlates S0B animation with S06 health drops and S02 chat messages to attribute kills, and on S13 iterates the destroyed ids through onEntityRemoved so a removed player's record cannot later fire a kill stat. S18 teleport and S08 respawn share the cleanup paths.

Source: Sigma 4.11, info/sigmaclient/module/impl/other/Ranking.java

Vanilla hook: EventAttack, EventPacket, EventUpdate (RegisterEvent list).
Stat tracking is invisible to anti-cheats. The S13 handling matters for correctness, not stealth: without it, a killed player's record would fire a duplicate kill when the death message arrives after the destroy packet.
Variations: Only Sigma 4.11 ships a module of this shape in the corpus; the sendStat() body is stubbed, so the tracking exists but the telemetry sink is disabled in this build.
PingSpoofComponent (players buffer) (Rise 6.1.30, Rise 6.2.4)

Hold S13 in the entity-stream buffer while ping spoofing so destruction stays ordered relative to buffered entity updates.

S13 is listed in the players tuple of the component's packet classification. While a spoof is active, matching packets are cancelled from the event stream and parked in a timestamped queue; onPostMotion flushes entries whose delay elapsed. Holding S13 alongside S14/S16/S15/S17/S18/S19/S20 keeps replay order coherent so a flushed destroy cannot land before the entity updates that precede it.

Source: Rise 6.1.30, com/alan/clients/component/impl/player/PingSpoofComponent.java

Vanilla hook: PacketSendEvent, PacketReceiveEvent, PostMotionEvent, WorldChangeEvent.
Buffered destruction keeps ghost entities alive client-side for the spoof window; modules that target entities must respect the flush or they attack ids the server already destroyed, which is the attack-after-desync flag.
Variations: Identical component in 6.1.30 and 6.2.4, driven by PingSpoof and Timer through the static spoof() entry points.
PacketType / TranslationComponent (DESTROY_ENTITY) (Rise 6.1.30, Rise 6.2.4)

Remove destroyed entity ids from the entity-position map the Translation bypass maintains.

The DESTROY_ENTITY entry of the PacketType enum casts to S13PacketDestroyEntities, iterates getEntityIDs() and removes each from the entityPositions map. The map is the single source of truth for the Translation component's entity tracking, so a missed removal would let the bypass interpolate a despawned entity.

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 TranslationComponent in both Rise versions.
Pure cache hygiene: without the removal the translation map leaks positions for despawned entities, which only corrupts the bypass's own rendering. No anti-cheat interaction beyond the general desync surface of the Translation feature.
Variations: Same enum in 6.1.30 and 6.2.4; the 6.2.4 build also carries ENTITY_HEAD_LOOK. This is the only non-vanilla entity-cache reference to S13 besides PingSpoofComponent in the corpus.
AntiBotModule (WATCHDOG despawn watch) (November Recode 2.0)

Confirm that a detected bot was destroyed server-side, so the module can re-arm the S0C spawn veto and warn that staff removed the entity.

In WATCHDOG mode the packet listener iterates the destroyed entity ids of every S13. If one equals aboveEntityId (the bot the module detected above the player), it prints a removed-from-world notice and resets the tracker to -1, which re-arms the S0C branch of the same listener to flag the next spawn as a bot.

Source: November Recode 2.0, feature/module/impl/combat/AntiBotModule.java

Vanilla hook: EventPacket.In (S13 branch, WATCHDOG mode only).
Pure read: the module never touches the packet. The desync risk of buffered S13 (Rise's PingSpoofComponent) does not apply here because November never delays the destroy.
Variations: Sigma's Ranking and Rise's TranslationComponent prune id-keyed caches on S13; November uses it as a state machine trigger instead of a cache cleanup.
PacketReceiveEvent on every corpus hit; the module-level hook appears in Sigma's Ranking (EventPacket) and November Recode 2.0's AntiBotModule (EventPacket.In), while Rise processes S13 through components (PingSpoofComponent, TranslationComponent).
Sigma cancels nothing and only reads ids. Rise does not read the ids at all in PingSpoofComponent (the packet is buffered by class) and reads them only in TranslationComponent. Memeware, Nekoware, Spicy and Tenacity touch S13 solely through bundled vanilla code. November Recode 2.0 reads the destroyed ids inside AntiBotModule and uses them as a state trigger for its WATCHDOG bot logic.

anticheat Anti-Cheat Checks

The destroy packet removes entity ids from the client's world, and server-side anticheats mirror that removal in their entity trackers. Because reach and hitbox checks must never measure against an entity the client no longer sees, destroy handling is data hygiene: Kauri removes fake-mob state on the confirming keepalive, intave decodes the destroy payload across three protocol layouts, and Hydro deletes the tracked entity on the send side. The packet is never flagged; keeping the tracker in sync with it is what keeps entity checks honest.

Destroy handling (Kauri) (funkemunky-KauriV3)

Remove fake-mob state for destroyed entities on the keepalive that confirms the destroy packet reached the client.

PacketHandler routes DESTROY_ENTITIES (both modern and legacy wrappers) to EntityTrackHandler.onEntityDestroy, which schedules a keepalive action: for each destroyed id it calls removeFakeMob, despawning any fake mobs the anticheat placed next to the tracked entity and clearing the client-has-entity flag. Fake mobs are the anti-hitbox probes Kauri spawns around combat entities, so their lifecycle must mirror real despawns exactly or reach checks would measure against ghosts.

Detects: Nothing directly; the removal prevents ghost-entity false flags in the hitbox-based reach checks that use fake mobs.

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

Variations: Grim schedules entity removal on the destroy transaction and also clears serverPositionsMap and dashable and firework state; Tecnio and Hydro just remove the ids from their tracker maps; Artemis ReachPreProcessor drops the entity from reach tracking on the same packet.
Destroy reader (intave) (intave-intave)

Decode the destroy payload across all protocol layouts and feed each entity id to the entity tracker.

EntityDestroyReader implements EntityIterable over the destroy packet. It branches on protocol era: an int list on 1.17.1+, a single int on 1.17.0, and an int array on 1.16 and below, exposing both forEach and a substitution iterator so the tracker can read or rewrite ids. PacketReaders registers it under ENTITY_DESTROY, and EntityTracker.receiveEntityDestroy processes each id, dismounting riders and marking destroyed entities so AttackRaytrace can ignore them.

Detects: Nothing directly; the reader is the decode layer. The tracker's destroyed-entity marker (Entity.Destroyed) is what lets hitbox checks ignore dead entities.

Source: intave-intave, src/main/java/de/jpx3/intave/packet/reader/EntityDestroyReader.java

Variations: Grim and Hydro wrap WrapperPlayServerDestroyEntities directly; FlopAC's WrappedOutEntityDestroy is the same idea on its tinyprotocol reflection layer.
Destroy tracking (Hydro) (Incognitolol-Hydro)

Remove destroyed entities from the tracked-entity map so reach and entity queries never see despawned ids.

EntityTracker.registerOutgoingPreHandler routes DESTROY_ENTITIES to handleDestroyEntities, which wraps WrapperPlayServerDestroyEntities and removes each id from the concurrent entityMap. Because insertion happens on spawn and removal on destroy, the map always mirrors the client's visible entity set; getDistanceToEntity and getClosestEntity simply cannot return a destroyed entity.

Detects: Nothing directly; it is the cleanup half of the tracker. Without it, reach checks would measure against entities the client no longer renders, producing false flags.

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

Variations: Tecnio removes ids from trackerMap on GPacketPlayServerEntityDestroy; Shard ejects riders before removing ids; Kauri defers cleanup to the confirming keepalive; TruthfulAC marks the entity destroyed with a grace window instead of deleting it outright.

Wiki Cross-Reference

VarInt count followed by that many VarInt entity ids; server flushes the destroy list once per tick.

Id-keyed caches must prune on it; delaying it keeps ghost entities attackable, the attack-after-destroy flag pattern.

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

1.8.9 callers: EntityPlayerMP.onUpdate sends new S13PacketDestroyEntities (line 303): 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 S13PacketDestroyEntities

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