0x49 S49PacketUpdateEntityNBT
Updates the NBT data of an entity (used for command block minecarts, spawned entities with custom NBT).
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| entityId | VarInt | Entity ID |
| tagCompound | NBTTagCompound | Updated NBT data |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Entity ID | VarInt | |
| NBT Data | NBT Tag |
MCP References
NetHandlerPlayClient.handleUpdateEntityNBT()Handler Interface
INetHandlerPlayClientVanilla 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 | |
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.
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.
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.
// ===== FILE: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/checks/impl/exploit/ExploitB.java =====
package ac.grim.grimac.checks.impl.exploit;
import ac.grim.grimac.api.storage.verbose.Verbose;
import ac.grim.grimac.checks.Check;
import ac.grim.grimac.checks.CheckData;
import ac.grim.grimac.checks.impl.verbose.VerboseCodecs;
import ac.grim.grimac.checks.type.PacketReceiveListener;
import ac.grim.grimac.player.GrimPlayer;
import ac.grim.grimac.utils.payload.PayloadBookEdit;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.component.ComponentTypes;
import com.github.retrooper.packetevents.protocol.item.ItemStack;
import com.github.retrooper.packetevents.protocol.item.type.ItemType;
import com.github.retrooper.packetevents.protocol.item.type.ItemTypes;
import com.github.retrooper.packetevents.protocol.nbt.NBT;
import com.github.retrooper.packetevents.protocol.nbt.NBTCompound;
import com.github.retrooper.packetevents.protocol.nbt.NBTList;
import com.github.retrooper.packetevents.protocol.nbt.NBTString;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.protocol.player.InteractionHand;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientEditBook;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientPlayerBlockPlacement;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientPluginMessage;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientUseItem;
import com.google.gson.JsonSyntaxException;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonToken;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.IOException;
import java.io.StringReader;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@CheckData(name = "ExploitB", stableKey = "grim.exploit.invalid_book_edit", description = "Invalid book edit")
public class ExploitB extends Check implements PacketReceiveListener {
private static final int BOOK_EXPECTED_SLOT = 0;
private static final int BOOK_EXPECTED_TYPE = 1;
private static final int BOOK_EXPECTED_AMOUNT = 2;
private static final int BOOK_EXPECTED_META = 3;
private static final int BOOK_NO_NBT = 4;
private static final int BOOK_NO_PAGES = 5;
private static final int BOOK_NO_TITLE = 6;
private static final int BOOK_EXPECTED_AUTHOR = 7;
private static final int BOOK_INVALID_PAGE = 8;
private static final int BOOK_MODIFIED_NBT = 9;
private static final int BOOK_TITLE_TOO_LONG = 10;
private static final int BOOK_INVALID_TITLE = 11;
private static final int BOOK_NOT_EDITING = 12;
private static final int BOOK_TOO_MANY_PAGES = 13;
private static final int BOOK_PAGE_TOO_LONG = 14;
private static final int BOOK_EMPTY_LAST_PAGE = 15;
// One shape per BOOK_* kind; shape index == constant value.
private static final Verbose V = Verbose
.of("expectedSlot={sint}, slot={sint}") // BOOK_EXPECTED_SLOT
.or("expectedType={item}, type={item}") // BOOK_EXPECTED_TYPE
.or("expectedAmount={sint}, amount={sint}") // BOOK_EXPECTED_AMOUNT
.or("expectedMeta={sint}, meta={sint}") // BOOK_EXPECTED_META
.or("no nbt") // BOOK_NO_NBT
.or("no pages") // BOOK_NO_PAGES
.or("no title") // BOOK_NO_TITLE
.or("expectedAuthor={str}, author={str}") // BOOK_EXPECTED_AUTHOR
.or("invalid page") // BOOK_INVALID_PAGE
.or("modified nbt") // BOOK_MODIFIED_NBT
.or("title too long") // BOOK_TITLE_TOO_LONG
.or("invalid title '{str}'") // BOOK_INVALID_TITLE
.or("not editing book") // BOOK_NOT_EDITING
.or("too many pages") // BOOK_TOO_MANY_PAGES
.or("page too long") // BOOK_PAGE_TOO_LONG
.or("empty last page"); // BOOK_EMPTY_LAST_PAGE
private static final int UNUSED_TYPE = -1;
private static final boolean IS_1_8 = PacketEvents.getAPI().getServerManager().getVersion().isOlderThanOrEquals(ServerVersion.V_1_8_8);
private ItemStack oldBook;
private InteractionHand hand;
public ExploitB(GrimPlayer player) {
super(player);
}
@Override
public void onPacketReceive(PacketReceiveEvent event) {
if (IS_1_8 ? event.getPacketType() == PacketType.Play.Client.PLAYER_BLOCK_PLACEMENT
&& new WrapperPlayClientPlayerBlockPlacement(event).getFaceId() == 255
: event.getPacketType() == PacketType.Play.Client.USE_ITEM) {
hand = IS_1_8 ? InteractionHand.MAIN_HAND : new WrapperPlayClientUseItem(event).getHand();
oldBook = player.inventory.getItemInHand(hand).copy();
}
if (event.getPacketType() == PacketType.Play.Client.EDIT_BOOK) {
checkEditBook(new WrapperPlayClientEditBook(event), event);
oldBook = null;
}
// 1.13-
if (event.getPacketType() == PacketType.Play.Client.PLUGIN_MESSAGE && PacketEvents.getAPI().getServerManager().getVersion().isOlderThan(ServerVersion.V_1_13)) {
WrapperPlayClientPluginMessage wrapper = new WrapperPlayClientPluginMessage(event);
boolean signing;
switch (wrapper.getChannelName()) {
case "MC|BSign" -> signing = true;
case "MC|BEdit" -> signing = false;
default -> {
return;
}
}
ItemStack newBook = new PayloadBookEdit(wrapper.getData()).itemStack();
checkItemStack(newBook, signing, event);
oldBook = null;
}
}
private void checkEditBook(WrapperPlayClientEditBook wrapper, PacketReceiveEvent event) {
if (checkEditingBook(event)) return;
int expectedSlot = hand == InteractionHand.OFF_HAND ? 40 : player.packetStateData.lastSlotSelected;
int slot = wrapper.getSlot();
if (slot != expectedSlot) {
flagExpectedSlot(event, expectedSlot, slot);
return;
}
if (wrapper.getSigning() == null) { // 1.17+
if (wrapper.getTitle() != null && checkTitle(wrapper.getTitle(), event)) return;
List<String> pages = wrapper.getPages();
if (pages.size() > 1 && checkEmptyLastPage(pages.get(pages.size() - 1), event)) return;
if (checkTooManyPages(pages.size(), event)) return;
for (String page : pages) {
if (checkPage(page, event)) return;
}
} else { // 1.13 - 1.16.5
checkItemStack(wrapper.getItemStack(), wrapper.getSigning(), event);
}
}
private void checkItemStack(ItemStack newBook, boolean signing, PacketReceiveEvent event) {
if (checkEditingBook(event)) return;
ItemType expectedType = signing && IS_1_8 ? ItemTypes.WRITTEN_BOOK : ItemTypes.WRITABLE_BOOK;
if (!newBook.is(expectedType)) {
flagExpectedType(event, expectedType, newBook.getType());
return;
}
if (newBook.getAmount() != oldBook.getAmount()) {
flagExpectedAmount(event, oldBook.getAmount(), newBook.getAmount());
return;
}
if (newBook.getLegacyData() != oldBook.getLegacyData()) {
flagExpectedMeta(event, oldBook.getLegacyData(), newBook.getLegacyData());
return;
}
NBTCompound newBookNBT = newBook.getNBT();
if (newBookNBT == null) {
flagLiteral(event, BOOK_NO_NBT);
return;
}
NBTList<@NotNull NBTString> newPagesNBT = newBookNBT.getStringListTagOrNull("pages");
if (newPagesNBT == null) {
flagLiteral(event, BOOK_NO_PAGES);
return;
}
if (checkTooManyPages(newPagesNBT.size(), event)) return;
if (signing) {
String title = newBookNBT.getStringTagValueOrNull("title");
if (title == null) {
flagLiteral(event, BOOK_NO_TITLE);
return;
}
if (checkTitle(title, event)) return;
String author = newBookNBT.getStringTagValueOrNull("author");
if (!player.getName().equals(author)) {
flagExpectedAuthor(event, player.getName(), author == null ? "null" : author);
return;
}
}
String last = null;
for (NBTString string : newPagesNBT.getTags()) {
if (IS_1_8 && signing) {
try {
JsonReader reader = new JsonReader(new StringReader(string.getValue()));
if (reader.peek() != JsonToken.BEGIN_OBJECT) throw new JsonSyntaxException("");
reader.beginObject();
if (reader.peek() != JsonToken.NAME || !reader.nextName().equals("text")
|| reader.peek() != JsonToken.STRING) throw new JsonSyntaxException("");
last = reader.nextString();
if (reader.peek() != JsonToken.END_OBJECT) throw new JsonSyntaxException("");
} catch (JsonSyntaxException e) {
flagLiteral(event, BOOK_INVALID_PAGE);
return;
} catch (IOException e) {
throw new RuntimeException(e);
}
} else {
last = string.getValue();
}
if (checkPage(last, event)) return;
}
if (last != null && checkEmptyLastPage(last, event)) {
return;
}
Set<Map.Entry<String, NBT>> newNBT = newBookNBT.getTags().entrySet();
HashMap<String, NBT> oldNBT = oldBook.getNBT() == null ? new HashMap<>() : new HashMap<>(oldBook.getNBT().getTags());
oldNBT.remove("pages");
oldNBT.remove("title");
oldNBT.remove("author");
for (var entry : newNBT) {
if (!entry.getKey().equals("pages") && !entry.getKey().equals("title") && !entry.getKey().equals("author")) {
NBT nbt = oldNBT.remove(entry.getKey());
if (nbt == null || !nbt.equals(entry.getValue())) {
flagLiteral(event, BOOK_MODIFIED_NBT);
return;
}
}
}
if (!oldNBT.isEmpty()) {
flagLiteral(event, BOOK_MODIFIED_NBT);
}
}
private boolean checkTitle(@NotNull String title, PacketReceiveEvent event) {
if (title.length() > (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_16) ? 15 : 16)) {
flagLiteral(event, BOOK_TITLE_TOO_LONG);
return true;
} else if (title.isEmpty() || !title.trim().equals(title) || containsInvalidCharacters(title, false)) {
flagInvalidTitle(event, title);
return true;
}
return false;
}
private boolean checkEditingBook(PacketReceiveEvent event) {
if (oldBook == null || !oldBook.is(ItemTypes.WRITABLE_BOOK)) {
flagLiteral(event, BOOK_NOT_EDITING);
return true;
}
return false;
}
private boolean checkTooManyPages(int pages, PacketReceiveEvent event) {
NBTList<@NotNull NBTString> oldPagesNBT;
int oldPages = oldBook.getVersion().isNewerThanOrEquals(ClientVersion.V_1_20_5)
? oldBook.getComponent(ComponentTypes.WRITABLE_BOOK_CONTENT).map(content -> content.getPages().size()).orElse(0)
: oldBook.getNBT() != null && (oldPagesNBT = oldBook.getNBT().getStringListTagOrNull("pages")) != null
? oldPagesNBT.size() : 0;
if (pages > oldPages && pages > (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_14) ? 100 : 50)) {
flagLiteral(event, BOOK_TOO_MANY_PAGES);
return true;
}
return false;
}
private boolean checkPage(String page, PacketReceiveEvent event) {
if (page.length() > (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_14) ? 1023 : 256)) {
flagLiteral(event, BOOK_PAGE_TOO_LONG);
return true;
}
// commented out because existing characters are not considered
// if (containsInvalidCharacters(page, true)) {
// if (flag("invalid page characters") && shouldModifyPackets()) {
// event.setCancelled(true);
// player.onPacketCancel();
// }
// return true;
// }
return false;
}
private boolean checkEmptyLastPage(String page, PacketReceiveEvent event) {
if (page.isEmpty()) {
flagLiteral(event, BOOK_EMPTY_LAST_PAGE);
return true;
}
return false;
}
private void flagExpectedSlot(PacketReceiveEvent event, int expectedSlot, int slot) {
flagBookEdit(event, V.write(verbose(), BOOK_EXPECTED_SLOT).sint(expectedSlot).sint(slot));
}
private void flagExpectedType(PacketReceiveEvent event, @NotNull ItemType expectedType, @Nullable ItemType type) {
flagBookEdit(event, V.write(verbose(), BOOK_EXPECTED_TYPE).sint(typeId(expectedType)).sint(typeId(type)));
}
private void flagExpectedAmount(PacketReceiveEvent event, int expectedAmount, int amount) {
flagBookEdit(event, V.write(verbose(), BOOK_EXPECTED_AMOUNT).sint(expectedAmount).sint(amount));
}
private void flagExpectedMeta(PacketReceiveEvent event, int expectedMeta, int meta) {
flagBookEdit(event, V.write(verbose(), BOOK_EXPECTED_META).sint(expectedMeta).sint(meta));
}
private void flagExpectedAuthor(PacketReceiveEvent event, @NotNull String expectedAuthor, @NotNull String author) {
flagBookEdit(event, V.write(verbose(), BOOK_EXPECTED_AUTHOR).str(expectedAuthor).str(author));
}
private void flagInvalidTitle(PacketReceiveEvent event, @NotNull String title) {
flagBookEdit(event, V.write(verbose(), BOOK_INVALID_TITLE).str(title));
}
private void flagLiteral(PacketReceiveEvent event, int kind) {
flagBookEdit(event, V.write(verbose(), kind));
}
private void flagBookEdit(PacketReceiveEvent event, Verbose.Writer writer) {
if (flag(writer) && shouldModifyPackets()) {
event.setCancelled(true);
player.onPacketCancel();
}
}
private int typeId(@Nullable ItemType type) {
return type == null ? UNUSED_TYPE : VerboseCodecs.item(type, player.getClientVersion());
}
private static boolean containsInvalidCharacters(@NotNull String string, boolean allowLineBreak) {
for (int i = 0; i < string.length(); ++i) {
char character = string.charAt(i);
if (character == 167 || character < 32 && (!allowLineBreak || character != 10) || character == 127) {
return true;
}
}
return false;
}
}
// NOTE (AI): ExploitB inspects client-sent book NBT, not the server-to-client S49 payload. It anchors the NBT check domain in the corpus because it is the only anticheat logic here that parses compound tags and flags malformed ones.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.
// ===== FILE: intave-intave, src/main/java/de/jpx3/intave/module/filter/EntityIdFilter.java =====
package de.jpx3.intave.module.filter;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.reflect.StructureModifier;
import de.jpx3.intave.IntavePlugin;
import de.jpx3.intave.cleanup.ShutdownTasks;
import de.jpx3.intave.module.linker.packet.ListenerPriority;
import de.jpx3.intave.module.linker.packet.PacketSubscription;
import de.jpx3.intave.packet.reader.EntityIterable;
import de.jpx3.intave.packet.reader.PacketReaders;
import de.jpx3.intave.packet.reader.SubstitutionIterator;
import de.jpx3.intave.user.User;
import de.jpx3.intave.user.UserRepository;
import de.jpx3.intave.user.meta.ConnectionMetadata;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.metadata.FixedMetadataValue;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import static de.jpx3.intave.module.linker.packet.PacketId.Client.*;
import static de.jpx3.intave.module.linker.packet.PacketId.Server.*;
public final class EntityIdFilter extends Filter {
private static final String RELOAD_METADATA_KEY = "intave::DT6NyhqI5bPJTeQRO6KWl1hNcEy2YZAp";
public EntityIdFilter() {
super("entityid");
setup();
}
public void setup() {
ShutdownTasks.addBeforeAll(this::shutdown);
for (Player player : Bukkit.getOnlinePlayers()) {
Plugin owningPlugin = null;
for (MetadataValue metadata : player.getMetadata(RELOAD_METADATA_KEY)) {
Map<Integer, Integer> translations = (Map<Integer, Integer>) metadata.value();
if (translations != null && metadata.getOwningPlugin().getName().equalsIgnoreCase("Intave")) {
UserRepository.userOf(player).meta().connection().insertIdTranslations(translations);
owningPlugin = metadata.getOwningPlugin();
break;
}
}
if (owningPlugin != null) {
player.removeMetadata(RELOAD_METADATA_KEY, owningPlugin);
}
}
}
public void shutdown() {
for (Player player : Bukkit.getOnlinePlayers()) {
JavaPlugin intave = IntavePlugin.singletonInstance();
Map<Integer, Integer> translation = new HashMap<>(UserRepository.userOf(player).meta().connection().globalEntityIdsToLocalIds());
player.removeMetadata(RELOAD_METADATA_KEY, intave);
player.setMetadata(RELOAD_METADATA_KEY, new FixedMetadataValue(intave, translation));
}
}
@PacketSubscription(
packetsIn = {
ATTACK_ENTITY,
USE_ENTITY,
ENTITY_NBT_QUERY
},
priority = ListenerPriority.LOWEST
)
public void onPacket(
PacketEvent event
) {
User user = UserRepository.userOf(event.getPlayer());
PacketContainer packet = event.getPacket();
StructureModifier<Integer> ints = packet.getIntegers();
int localId = ints.read(0);
int globalId = user.meta().connection().globalEntityIdFromLocal(localId);
ints.write(0, globalId);
}
@PacketSubscription(
packetsOut = {
ATTACH_ENTITY,
BED,
BLOCK_BREAK_ANIMATION,
CAMERA,
COLLECT,
COMBAT_EVENT,
ENTITY,
ENTITY_DESTROY,
ENTITY_EFFECT,
ENTITY_EQUIPMENT,
ENTITY_HEAD_ROTATION,
ENTITY_LOOK,
ENTITY_METADATA,
ENTITY_MOVE_LOOK,
ENTITY_SOUND,
ENTITY_STATUS,
ENTITY_TELEPORT,
ENTITY_VELOCITY,
LOOK_AT,
LOGIN,
MOUNT,
NAMED_ENTITY_SPAWN,
OPEN_WINDOW,
OPEN_WINDOW_HORSE,
REL_ENTITY_MOVE,
REL_ENTITY_MOVE_LOOK,
REMOVE_ENTITY_EFFECT,
SPAWN_ENTITY,
SPAWN_ENTITY_EXPERIENCE_ORB,
SPAWN_ENTITY_LIVING,
SPAWN_ENTITY_PAINTING,
SPAWN_ENTITY_WEATHER,
UPDATE_ATTRIBUTES,
UPDATE_ENTITY_NBT,
USE_BED
},
priority = ListenerPriority.HIGHEST
)
public void onPacketOut(
PacketEvent event
) {
PacketContainer packet = event.getPacket();
User user = UserRepository.userOf(event.getPlayer());
ConnectionMetadata connection = user.meta().connection();
EntityIterable entities = PacketReaders.readerOf(packet);
boolean isDestroy = packet.getType() == PacketType.Play.Server.ENTITY_DESTROY;
for (SubstitutionIterator<Integer> iterator = entities.iterator(); iterator.hasNext(); ) {
Integer globalId = iterator.next();
Integer localId = connection.localEntityIdFromGlobal(globalId);
if (localId == -1) {
localId = connection.newLocalIdFor(globalId);
}
iterator.set(localId);
}
if (isDestroy) {
Set<Integer> toRemove = new HashSet<>();
entities.forEach(toRemove::add);
toRemove.forEach(connection::markIdAsDeprecated);
user.tickFeedback(() ->
user.tickFeedback(() ->
toRemove.forEach(connection::removeId)
));
}
entities.release();
}
@Override
protected boolean enabled() {
return false;
}
}
// NOTE (AI): EntityIdFilter rewrites the entity id inside the outbound UPDATE_ENTITY_NBT packet but never inspects the compound tag. The filter is disabled by default in this build.Related Packets
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
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.