0x49 S49PacketUpdateEntityNBT

Updates the NBT data of an entity (used for command block minecarts, spawned entities with custom NBT).

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

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

entitynbt
Complete 6/8

Fields

FieldTypeDescription
entityIdVarIntEntity ID
tagCompoundNBTTagCompoundUpdated NBT data

Wire Encoding

FieldTypeNotes
Entity IDVarInt
NBT DataNBT Tag

MCP References

MCPNetHandlerPlayClient.handleUpdateEntityNBT()

Handler Interface

HNDINetHandlerPlayClient

Vanilla Source

S49PacketUpdateEntityNBT.java61 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.nbt.NBTTagCompound;
6
import net.minecraft.network.Packet;
7
import net.minecraft.network.PacketBuffer;
8
import net.minecraft.network.play.INetHandlerPlayClient;
9
import net.minecraft.world.World;
10
11
public class S49PacketUpdateEntityNBT implements Packet<INetHandlerPlayClient>
12
{
13
    private int entityId;
14
    private NBTTagCompound tagCompound;
15
16
    public S49PacketUpdateEntityNBT()
17
    {
18
    }
19
20
    public S49PacketUpdateEntityNBT(int entityIdIn, NBTTagCompound tagCompoundIn)
21
    {
22
        this.entityId = entityIdIn;
23
        this.tagCompound = tagCompoundIn;
24
    }
25
26
    /**
27
     * Reads the raw packet data from the data stream.
28
     */
29
    public void readPacketData(PacketBuffer buf) throws IOException
30
    {
31
        this.entityId = buf.readVarIntFromBuffer();
32
        this.tagCompound = buf.readNBTTagCompoundFromBuffer();
33
    }
34
35
    /**
36
     * Writes the raw packet data to the data stream.
37
     */
38
    public void writePacketData(PacketBuffer buf) throws IOException
39
    {
40
        buf.writeVarIntToBuffer(this.entityId);
41
        buf.writeNBTTagCompoundToBuffer(this.tagCompound);
42
    }
43
44
    /**
45
     * Passes this Packet on to the NetHandler for processing.
46
     */
47
    public void processPacket(INetHandlerPlayClient handler)
48
    {
49
        handler.handleEntityNBT(this);
50
    }
51
52
    public NBTTagCompound getTagCompound()
53
    {
54
        return this.tagCompound;
55
    }
56
57
    public Entity getEntity(World worldIn)
58
    {
59
        return worldIn.getEntityByID(this.entityId);
60
    }
61
}

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

Deep Dive

Role in the protocol

The server pushes a full NBTTagCompound onto a specific entity: an entity id as VarInt followed by a compound NBT tag. EntityTrackerEntry sends it when a tracked entity holds NBT the client must know (command block minecarts, boats with custom names, armor stands) and a new player starts tracking it. Clientbound-only, PLAY state.

Vanilla handling

NetHandlerPlayClient.handleUpdateEntityNBT looks up the entity by id and calls readFromNBT with the compound; unknown ids are ignored. Server side, the send is triggered inside EntityTrackerEntry's update loop when the tracked entity's NBT differs for the tracking player, typically on track start. The client never requests this packet.

Why clients touch it

No module in the 8 clients intercepts S49; modules is empty here because the corpus contains no module file for it. The only non-vanilla reference is the Rise 6.1.30 and 6.2.4 NetworkAPI script registry. The command-block NBT exploit lore lives server-side: a client cannot read a command block's NBT through this packet, because the server only pushes NBT it already chose to send. It is a one-way data push with no client-visible lever.

Exploit surface

The compound is decoded client-side by the NBT reader; a hostile compound with pathological nesting or huge size is the only theoretical surface, and no client in the corpus defends against it. There is no spoofing, replay or timing angle for modules: the entity id must match a known entity and the payload is applied verbatim.

Server-Side Handling

EntityTrackerEntry sends S49 when the tracked entity's NBT differs for the tracking player, normally at track start (the entry's sendMetadata loop). The client applies the compound via readFromNBT on the resolved entity. No reply, no ownership validation, no client-triggered path.

Protocol Analysis

A VarInt entity id followed by a full NBT compound written through writeTag. Sizes are unbounded by the protocol beyond the packet limit; command block minecart compounds carry the command string, which is the data of interest in the exploit lore. The packet id 0x49 is clientbound-only.

Anti-Cheat Landscape

Anti-cheats ignore this packet entirely, and clients cannot abuse it because the server controls both the trigger and the payload. The only measurable property is packet size, which is server-controlled.

implementation Implementation Cases

A server-pushed entity NBT update with no module coverage: modules is empty because the corpus has no module file for S49. The only non-vanilla hit is the Rise 6.x NetworkAPI script registry; the command-block NBT exploit is server-side, and the packet itself offers clients nothing to hook.

Rise 6.1.30 and 6.2.4 expose S49 to scripts through NetworkAPI's packet registry; no event bus in any of the 8 clients has a module handler for it.
Only Rise 6.x differs from vanilla: its NetworkAPI packet list includes S49PacketUpdateEntityNBT.class. All other clients carry the unmodified NetHandlerPlayClient handler.

anticheat Anti-Cheat Checks

Server-side anticheats treat this clientbound packet as plumbing: the server pushes a full NBT compound onto a tracked entity, and no movement or combat check keys off it. The corpus shows three anticheats that register or rewrite it (Intave rewrites the entity id inside it, Artemis maps it into its packet library, Negativity lists it in its packet registry) plus Grim's NBT validation logic, which targets client-sent item NBT in the opposite direction. The packet itself carries no client-controlled data, so there is nothing to flag.

NBT book exploit validation (ExploitB) (GrimAnticheat-Grim)

Validates the NBT attached to client-sent book items and flags compounds the client could not have produced legitimately. The only NBT-content check in the corpus.

Listens for item-slot and book-editing packets, diffs the new book compound against the old one the anticheat tracks, and flags with literal codes: BOOK_NO_NBT when a signed book carries no compound, BOOK_MODIFIED_NBT when unrelated tags change, plus too-many-pages and page-length counters. It faces the client-to-server direction; the S49 server push is never validated because the server authored it.

Detects: NBT-fabrication exploits on written books, including the classic command-block NBT injection via book tags that older clients allowed.

Source: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/checks/impl/exploit/ExploitB.java

Variations: Intave registers UPDATE_ENTITY_NBT in PacketId and feeds it to EntityReader, and Artemis maps PacketPlayOutUpdateEntityNBT to PacketPlayServerUpdateMetadata in HardcodeMap; neither validates NBT content. Only Grim parses compounds, and it does so on the inbound item path.
Entity id translation filter (EntityIdFilter) (intave-intave)

Rewrites entity ids in serverbound and clientbound entity packets so Intave tracks entities under its own local id scheme. UPDATE_ENTITY_NBT sits in the outbound rewrite list.

A ProtocolLib filter with two subscriptions: inbound USE_ENTITY, ATTACK_ENTITY and ENTITY_NBT_QUERY packets get their local id translated to the global id, and the outbound list (which includes UPDATE_ENTITY_NBT) maps every entity id back to the local id through ConnectionMetadata, minting new local ids on first sight. It reads the first integer field of each packet, never the NBT payload.

Detects: Not a cheat check. It is an id-translation layer that keeps killaura, reach and position checks consistent with the anticheat's own entity table.

Source: intave-intave, src/main/java/de/jpx3/intave/module/filter/EntityIdFilter.java

Variations: Artemis and Negativity only register the packet name in their packet libraries; neither filters or reads it. Grim's PacketWorldReaderEighteen reads NBT on chunk and tile-entity data, which is a different wire path from the entity NBT push.

Wiki Cross-Reference

VarInt entity id followed by a full NBTTagCompound. Client looks up the entity and applies it with readFromNBT; unknown ids are ignored.

Server pushes it from EntityTrackerEntry when tracking starts (e.g. command block minecarts). Clientbound only, never requested by the client.

MCP 1.8.9 S49PacketUpdateEntityNBT implements Packet dispatching to INetHandlerPlayClient.handleEntityNBT; wire serde is readPacketData/writePacketData via readNBTTagCompoundFromBuffer, readVarIntFromBuffer.

1.8.9 callers: EntityTrackerEntry.updatePlayerEntity sends new S49PacketUpdateEntityNBT (line 390): 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.