0x1C S1CPacketEntityMetadata
Updates an entity's DataWatcher metadata (health, skin, flags, name, etc.).
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| entityId | VarInt | Entity ID |
| metadata | DataWatcher | Serialized metadata entries |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Entity ID | VarInt | |
| Metadata | DataWatcher | Serialized key-value pairs |
MCP References
NetHandlerPlayClient.handleEntityMetadata()Handler Interface
INetHandlerPlayClientNotes
Vanilla 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 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
Deobfuscated MCP 1.8.9 source of S1CPacketEntityMetadata, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S1CPacketEntityMetadata.java) at build time and verified present.
Deep Dive
Role in the protocol
S1CPacketEntityMetadata carries DataWatcher updates for one entity: a list of WatchableObject entries, or the full watcher dump on spawn. EntityTrackerEntry sends the full watcher with the metadata flag true when a player enters tracking range (corpus line 360) and incremental changed entries otherwise (line 303). The client merges them into the entity's DataWatcher. Relevant indexes: 0 is the byte flags (sneaking, sprinting, invisible, riding), 2 the name tag, 3 name visibility, 6 health for living entities. The sneak flag (bit 1, byte value 2) is the one the corpus actually reads.
Vanilla handling
NetHandlerPlayClient.handleEntityMetadata (Memeware 7.3 bundle, line 468) resolves the entity, guards against a null list and calls entity.getDataWatcher().updateWatchedObjectsFromList(list). The DataWatcher then notifies the renderer and any systems watching specific indexes. The same list rides inside S0CPacketSpawnPlayer and S0FPacketSpawnMob for the initial state.
Why clients touch it
The canonical ESP/AntiInvis reads (invisibility flag, name-tag index) do not appear in the 8 clients; their renderers read entity fields after the vanilla handler applies S1C. The real hits: Rise 5.99 EagleA reads the sneak byte from the WatchableObjects, the only genuine module consumer; Sigma 4.11 AutoPot and InventoryManager import the class but never process it, polling isPotionActive and inventoryContainer on EventUpdate instead, so both imports are dead code; Rise 6.x PingSpoofComponent classifies S1C in its regular tuple, delayed with C0F and C00 during spoof, and NetworkAPI whitelists it for scripts.
Exploit surface
Metadata is read-only intelligence: 1.8.9 has no serverbound metadata packet, so the stream is the only place the server's view of entity state leaks back to the client. That makes it the natural feed for anti-invis and name-tag modules, and its absence in these 8 clients is a design choice, not a protocol limitation. The sneak flag is the load-bearing bit for anticheats: eagle checks (Rise 5.99) read it against the S14 ground state, and any client that spoofs sneak serverbound via C0B must keep the server-visible flag consistent or the mismatch is a flag.
Server-Side Handling
Clientbound only. EntityTrackerEntry sends the full DataWatcher on tracking start and incremental entries on change; the client merges them via updateWatchedObjectsFromList. Index 0 byte flags encode sneaking (bit 1), sprinting (bit 3), invisible (bit 5) and riding (bit 6). No validation is applied to incoming values, so a malicious server can inject arbitrary metadata, which is why clients that care about server-side state reads (name tags, invisibility) consume it defensively.
Protocol Analysis
The packet carries a VarInt entityId followed by the DataWatcher serialization: repeated (index byte, type byte, value) triples terminated by 127, with an empty list meaning no changes. A full dump is flagged server-side by the boolean constructor argument (true on tracking start). Sneak is bit 1 of the flags byte, which decodes to exactly 2 when it is the only set bit, matching EagleA's equality check. Metadata changes do not touch position or rotation, so the packet interleaves freely with the S14/S18 stream.
Anti-Cheat Landscape
The sneak flag is the anticheat-relevant field: eagle and shift-tap checks correlate the flag with S14 ground transitions, and the Rise 5.99 EagleA check flags a sneak byte that appears within two ticks of walking off a ledge. Server anticheats compare the sneak flag against serverbound C0B sneak actions; a client whose metadata-visible sneak disagrees with its C0B stream leaks the discrepancy. Everything else in the packet (name tags, health) is cosmetic to anticheats.
implementation Implementation Cases
The metadata stream is the server's mirror of entity state, but only one module in the corpus genuinely reads it: Rise 5.99's EagleA, which checks the sneak flag byte. Sigma's AutoPot and InventoryManager carry dead imports, and Rise 6.x classifies the packet for ping-spoof delay and scripts.
Detect eagle (auto-sneak at block edges) by reading the sneak flag byte out of the tracked player's metadata stream.
On S14 relative moves it sets shouldEagle when the packet's onGround flag is true and the block below the reconstructed position is air, then counts ticks. On S1CPacketEntityMetadata for the tracked player it scans the WatchableObjects for a Byte whose value is exactly 2 (the sneak bit alone), and if shouldEagle is set with ticks <= 2 it increases the buffer and fails past 10; otherwise the buffer decays by 5.
// ===== FILE: Rise 5.99, dev/rise/anticheat/check/impl/other/eagle/EagleA.java =====
package dev.rise.anticheat.check.impl.other.eagle;
import dev.rise.anticheat.check.Check;
import dev.rise.anticheat.check.api.CheckInfo;
import dev.rise.anticheat.data.PlayerData;
import dev.rise.anticheat.util.PacketUtil;
import dev.rise.util.player.PlayerUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
import net.minecraft.entity.DataWatcher;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S14PacketEntity;
import net.minecraft.network.play.server.S1CPacketEntityMetadata;
@CheckInfo(name = "Eagle", type = "A", description = "Detects Eagle")
public final class EagleA extends Check {
private boolean shouldEagle;
private int ticks;
public EagleA(final PlayerData data) {
super(data);
}
@Override
public void handle(final Packet<?> packet) {
if (PacketUtil.isRelMove(packet)) {
final S14PacketEntity wrapper = ((S14PacketEntity) packet);
if (wrapper.onGround) {
final Block block = PlayerUtil.getBlock(data.getX(), data.getY() - 1, data.getZ());
if (block instanceof BlockAir) {
shouldEagle = true;
ticks++;
} else {
shouldEagle = false;
ticks = 0;
}
} else {
shouldEagle = false;
ticks = 0;
}
}
if (packet instanceof S1CPacketEntityMetadata) {
final S1CPacketEntityMetadata wrapper = (S1CPacketEntityMetadata) packet;
if (wrapper.func_149376_c() != null && wrapper.getEntityId() == data.getPlayer().getEntityId()) {
for (final DataWatcher.WatchableObject object : wrapper.func_149376_c()) {
if (object.getObject() instanceof Byte && (byte) object.getObject() == 2) {
if (shouldEagle && ticks <= 2) {
if (increaseBuffer() > 10) {
fail();
shouldEagle = false;
ticks = 0;
}
} else
decreaseBufferBy(5);
}
}
}
}
}
}
// NOTE (AI): The only genuine S1C consumer in the corpus. The check reads the DataWatcher sneak byte
// NOTE (AI): (exactly 2) from the metadata stream for the tracked player and flags when it appears
// NOTE (AI): within two S14 ticks of walking off a ledge, which is the signature of a client that
// NOTE (AI): auto-sneaks at the edge instead of staying shifted.
Corpus hit is an import only: both modules import S1CPacketEntityMetadata but no shipped handler branches on it.
AutoPot registers only EventUpdate and decides when to drink from mc.thePlayer.isPotionActive and getHealth, then pots by swapping, sending C05 look and C08 placement. InventoryManager likewise registers only EventUpdate and manages inventoryContainer slots. The metadata import is a development leftover from an earlier design that read potion or armor state from the watcher stream; the shipped logic polls local state instead, which is equivalent because the vanilla handler already applied S1C to the entity.
// ===== FILE: Sigma 4.11, info/sigmaclient/module/impl/combat/AutoPot.java =====
package info.sigmaclient.module.impl.combat;
import java.util.ArrayList;
import net.minecraft.client.gui.GuiChat;
import net.minecraft.client.gui.inventory.GuiFurnace;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.item.Item;
import net.minecraft.item.ItemAppleGold;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemAxe;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemGlassBottle;
import net.minecraft.item.ItemPickaxe;
import net.minecraft.item.ItemPotion;
import net.minecraft.item.ItemStack;
import net.minecraft.item.ItemSword;
import net.minecraft.item.ItemTool;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;
import net.minecraft.network.play.client.C09PacketHeldItemChange;
import net.minecraft.network.play.client.C0EPacketClickWindow;
import net.minecraft.network.play.server.S1CPacketEntityMetadata;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.potion.PotionHelper;
import net.minecraft.util.MathHelper;
import info.sigmaclient.event.Event;
import info.sigmaclient.event.RegisterEvent;
import info.sigmaclient.event.impl.EventPacket;
import info.sigmaclient.event.impl.EventUpdate;
import info.sigmaclient.management.MoveUtils;
import info.sigmaclient.module.Module;
import info.sigmaclient.module.data.ModuleData;
import info.sigmaclient.module.data.Setting;
import info.sigmaclient.module.impl.player.Scaffold;
import info.sigmaclient.util.RotationUtils;
import info.sigmaclient.util.misc.ChatUtil;
import info.sigmaclient.util.misc.Timer;
/*
* Made by LeakedPvP
*/
public class AutoPot extends Module {
public static final String SPEED = "SPEED";
public static final String REGEN = "REGEN";
public static final String HEALTH = "HEALTH";
public static final String PREDICT = "PREDICT";
public AutoPot(ModuleData data) {
super(data);
settings.put(SPEED, new Setting<>(SPEED, true, "Uses Speed pots."));
settings.put(REGEN, new Setting<>(REGEN, true, "Uses Regen pots."));
settings.put(HEALTH, new Setting<>(HEALTH, 6, "Maximum health before healing.", 0.5, 0.5, 10));
settings.put(PREDICT, new Setting<>(PREDICT, false, "Predicts where to pot when moving."));
}
public static boolean potting;
Timer timer = new Timer();
@Override
public void onEnable() {
super.onEnable();
}
public static boolean isPotting(){
return potting;
}
@Override
@RegisterEvent(events = {EventUpdate.class})
public void onEvent(Event event) {
if(event instanceof EventUpdate){
EventUpdate em =(EventUpdate)event;
final boolean speed = (Boolean) settings.get(SPEED).getValue();
final boolean regen = (Boolean) settings.get(REGEN).getValue();
if(!em.isPre())
return;
if(timer.check(200)){
if(potting)
potting = false;
}
int spoofSlot = getBestSpoofSlot();
int pots[] = {6,-1,-1};
if(regen)
pots[1] = 10;
if(speed)
pots[2] = 1;
for(int i = 0; i < pots.length; i ++){
if(pots[i] == -1)
continue;
if(pots[i] == 6 || pots[i] == 10){
if(timer.check(900) && !mc.thePlayer.isPotionActive(pots[i])){
if(mc.thePlayer.getHealth() < ((Number)settings.get(HEALTH).getValue()).doubleValue()*2){
getBestPot(spoofSlot, pots[i]);
}
}
}else
if(timer.check(1000) && !mc.thePlayer.isPotionActive(pots[i])){
getBestPot(spoofSlot, pots[i]);
}
}
}
}
public void swap(int slot1, int hotbarSlot){
mc.playerController.windowClick(mc.thePlayer.inventoryContainer.windowId, slot1, hotbarSlot, 2, mc.thePlayer);
}
float[] getRotations(){
double movedPosX = mc.thePlayer.posX + mc.thePlayer.motionX * 26.0D;
double movedPosY = mc.thePlayer.boundingBox.minY - 3.6D;
double movedPosZ = mc.thePlayer.posZ + mc.thePlayer.motionZ * 26.0D;
if((Boolean) settings.get(PREDICT).getValue())
return RotationUtils.getRotationFromPosition(movedPosX, movedPosZ, movedPosY);
else
return new float[]{mc.thePlayer.rotationYaw, 90};
}
int getBestSpoofSlot(){
int spoofSlot = 5;
for (int i = 36; i < 45; i++) {
if (!mc.thePlayer.inventoryContainer.getSlot(i).getHasStack()) {
spoofSlot = i - 36;
break;
}else if(mc.thePlayer.inventoryContainer.getSlot(i).getStack().getItem() instanceof ItemPotion) {
spoofSlot = i - 36;
break;
}
}
return spoofSlot;
}
void getBestPot(int hotbarSlot, int potID){
for (int i = 9; i < 45; i++) {
if (mc.thePlayer.inventoryContainer.getSlot(i).getHasStack() &&(mc.currentScreen == null || mc.currentScreen instanceof GuiInventory)) {
ItemStack is = mc.thePlayer.inventoryContainer.getSlot(i).getStack();
if(is.getItem() instanceof ItemPotion){
ItemPotion pot = (ItemPotion)is.getItem();
if(pot.getEffects(is).isEmpty())
return;
PotionEffect effect = (PotionEffect) pot.getEffects(is).get(0);
int potionID = effect.getPotionID();
if(potionID == potID)
if(ItemPotion.isSplash(is.getItemDamage()) && isBestPot(pot, is)){
if(36 + hotbarSlot != i)
swap(i, hotbarSlot);
timer.reset();
boolean canpot = true;
int oldSlot = mc.thePlayer.inventory.currentItem;
mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(hotbarSlot));
mc.thePlayer.sendQueue.addToSendQueue(new C03PacketPlayer.C05PacketPlayerLook(getRotations()[0], getRotations()[1], mc.thePlayer.onGround));
mc.thePlayer.sendQueue.addToSendQueue(new C08PacketPlayerBlockPlacement(mc.thePlayer.inventory.getCurrentItem()));
mc.thePlayer.sendQueue.addToSendQueue(new C09PacketHeldItemChange(oldSlot));
potting = true;
break;
}
}
}
}
}
boolean isBestPot(ItemPotion potion, ItemStack stack){
if(potion.getEffects(stack) == null || potion.getEffects(stack).size() != 1)
return false;
PotionEffect effect = (PotionEffect) potion.getEffects(stack).get(0);
int potionID = effect.getPotionID();
int amplifier = effect.getAmplifier();
int duration = effect.getDuration();
for (int i = 9; i < 45; i++) {
if (mc.thePlayer.inventoryContainer.getSlot(i).getHasStack()) {
ItemStack is = mc.thePlayer.inventoryContainer.getSlot(i).getStack();
if(is.getItem() instanceof ItemPotion){
ItemPotion pot = (ItemPotion)is.getItem();
if (pot.getEffects(is) != null) {
for (Object o : pot.getEffects(is)) {
PotionEffect effects = (PotionEffect) o;
int id = effects.getPotionID();
int ampl = effects.getAmplifier();
int dur = effects.getDuration();
if (id == potionID && ItemPotion.isSplash(is.getItemDamage())){
if(ampl > amplifier){
return false;
}else if (ampl == amplifier && dur > duration){
return false;
}
}
}
}
}
}
}
return true;
}
}
// NOTE (AI): The S1CPacketEntityMetadata import is dead code: the module registers only EventUpdate and
// NOTE (AI): decides when to pot from mc.thePlayer.isPotionActive and getHealth, not from the metadata
// NOTE (AI): stream. The import is a development leftover from an earlier metadata-driven design.
anticheat Anti-Cheat Checks
The metadata packet is the server's mirror of entity state, and anticheats read it for two reasons: to keep the player's own simulation state honest (sneak, gliding, pose, sleeping) and to hide or rewrite health information so clients cannot exploit it. The corpus splits into self-metadata listeners (Grim PacketSelfMetadataListener, intave MetadataTracker), a health rewrite check (Kauri HealthSpoof, disabled), Photon's damage-hiding module, and wrapper layers (FlopAC). The sneak and health indexes are the only fields any check actually touches.
Rewrite the health metadata entry (index 6, float) to 1.0 for other entities so clients cannot read real health values; the shipped check is disabled and the handler is commented out.
The commented @Bind handler intercepts WrapperPlayServerEntityMetadata, skips the viewer's own entity, copies the metadata list, and replaces any float entry at index 6 with 1.0f, then sends the rewritten packet silently. With the block disabled the check registers nothing.
// ===== FILE: funkemunky-KauriV3, Anticheat/src/main/java/dev/brighten/ac/check/impl/misc/HealthSpoof.java =====
package dev.brighten.ac.check.impl.misc;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import dev.brighten.ac.api.check.CheckType;
import dev.brighten.ac.check.Check;
import dev.brighten.ac.check.CheckData;
import dev.brighten.ac.data.APlayer;
@CheckData(name = "HealthSpoof", checkId = "healthspoof", type = CheckType.EXPLOIT)
public class HealthSpoof extends Check {
public HealthSpoof(APlayer player) {
super(player);
}
/*@Bind
WCancellable<WrapperPlayServerEntityMetadata> event = packet -> {
if(packet.getEntityId() == player.getBukkitPlayer().getEntityId()) return false;
List<EntityData<?>> newEntityMetadata = new ArrayList<>();
boolean overrwrite = false;
for (EntityData<?> data : packet.getEntityMetadata()) {
if(data.getType() == EntityDataTypes.FLOAT && data.getIndex() == 6) {
newEntityMetadata.add(new EntityData<>(6, EntityDataTypes.FLOAT, 1f));
overrwrite = true;
} else {
newEntityMetadata.add(data);
}
}
if(overrwrite) {
WrapperPlayServerEntityMetadata newPacket = new WrapperPlayServerEntityMetadata(packet.getEntityId(), newEntityMetadata);
player.sendPacketSilently(newPacket);
return true;
}
return false;
};*/
}
// NOTE (AI): This is a documented dead-code entry: the entire handler sits in a commented block, and the file ships as an empty Check subclass. The mechanism is described from the commented source, which is why the corpus matches the file.Read metadata sent to the checked player and fold flags, pose, gravity, frozen and use-item state into the prediction simulation, timestamped by transaction.
On ENTITY_METADATA for the player's own entity id, the listener strips the pose entry on 1.14+ clients, reads the flags byte for gliding, swimming and sprinting bits, the gravity boolean, powder-snow frozen ticks, bed position and the use-item/riptide byte, and applies each via latencyUtils real-time tasks anchored to the last transaction. The strip of pose metadata keeps old clients from receiving state that would desync their movement model.
// ===== FILE: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/events/packets/PacketSelfMetadataListener.java =====
package ac.grim.grimac.events.packets;
import ac.grim.grimac.GrimAPI;
import ac.grim.grimac.player.GrimPlayer;
import ac.grim.grimac.utils.data.SprintingState;
import ac.grim.grimac.utils.nmsutil.WatchableIndexUtil;
import com.github.retrooper.packetevents.event.PacketListenerAbstract;
import com.github.retrooper.packetevents.event.PacketListenerPriority;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.protocol.entity.data.EntityData;
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.util.Vector3d;
import com.github.retrooper.packetevents.util.Vector3i;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityMetadata;
import java.util.List;
import java.util.Optional;
public class PacketSelfMetadataListener extends PacketListenerAbstract {
public PacketSelfMetadataListener() {
super(PacketListenerPriority.HIGH);
}
@Override
public boolean isPreVia() {
return true;
}
@Override
public void onPacketSend(PacketSendEvent event) {
if (event.getPacketType() == PacketType.Play.Server.ENTITY_METADATA) {
GrimPlayer player = GrimAPI.INSTANCE.getPlayerDataManager().getPlayer(event.getUser());
if (player == null) return;
WrapperPlayServerEntityMetadata entityMetadata = new WrapperPlayServerEntityMetadata(event);
if (entityMetadata.getEntityId() != player.entityID) return;
List<EntityData<?>> metadata = entityMetadata.getEntityMetadata();
// If we send multiple transactions, we are very likely to split them
boolean hasSendTransaction = false;
// 1.14+ poses:
// - Client: I am sneaking
// - Client: I am no longer sneaking
// - Server: You are now sneaking
// - Client: Okay, I am now sneaking.
// - Server: You are no longer sneaking
// - Client: Okay, I am no longer sneaking
//
// 1.13- poses:
// - Client: I am sneaking
// - Client: I am no longer sneaking
// - Server: Okay, got it.
//
// Why mojang, why. Why are you so incompetent at netcode.
//
// Also, mojang. This system makes movement ping dependent!
// A player using or exiting an elytra, or using or exiting sneaking will have differnet movement
// to a player because of sending poses! ViaVersion works fine without sending these poses
// to the player on old servers... because the player just overrides this pose the very next tick
//
// It makes no sense to me why mojang is doing this, it has to be a bug.
if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_14)) {
// Remove the pose metadata from the list
metadata.removeIf(element -> element.getIndex() == 6);
entityMetadata.setEntityMetadata(metadata);
event.markForReEncode(true);
}
EntityData<?> watchable = WatchableIndexUtil.getIndex(metadata, 0);
if (watchable != null && watchable.getValue() instanceof Byte) {
byte field = (byte) watchable.getValue();
boolean isGliding = (field & 0x80) == 0x80 && player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_9);
boolean isSwimming = (field & 0x10) == 0x10;
boolean isSprinting = (field & 0x8) == 0x8;
if (!hasSendTransaction) player.sendTransaction();
hasSendTransaction = true;
player.latencyUtils.addRealTimeTask(player.lastTransactionSent.get(), () -> {
player.isSwimming = isSwimming;
player.lastSprinting = isSprinting;
if (!isSprinting) {
player.vehicleData.camelSprintingState = SprintingState.STOPPING;
}
// Protect this due to players being able to get the server to spam this packet a lot
if (player.isGliding != isGliding) {
player.pointThreeEstimator.updatePlayerGliding();
}
player.isGliding = isGliding;
});
}
if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_10)) {
EntityData<?> gravity = WatchableIndexUtil.getIndex(metadata, 5);
if (gravity != null) {
Object gravityObject = gravity.getValue();
if (gravityObject instanceof Boolean) {
if (!hasSendTransaction) player.sendTransaction();
hasSendTransaction = true;
player.latencyUtils.addRealTimeTask(player.lastTransactionSent.get(), () -> {
// Vanilla uses hasNoGravity, which is a bad name IMO
// hasGravity > hasNoGravity
player.playerEntityHasGravity = !((Boolean) gravityObject);
});
}
}
}
if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_17)) {
EntityData<?> frozen = WatchableIndexUtil.getIndex(metadata, 7);
if (frozen != null) {
if (!hasSendTransaction) player.sendTransaction();
hasSendTransaction = true;
player.latencyUtils.addRealTimeTask(player.lastTransactionSent.get(),
() -> player.powderSnowFrozenTicks = (int) frozen.getValue());
}
}
if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_14)) {
int id;
if (player.getClientVersion().isOlderThanOrEquals(ClientVersion.V_1_14_4)) {
id = 12; // Added in 1.14 with an initial ID of 12
} else if (player.getClientVersion().isOlderThanOrEquals(ClientVersion.V_1_16_4)) {
id = 13; // 1.15 changed this to 13
} else {
id = 14; // 1.17 changed this to 14
}
EntityData<?> bedObject = WatchableIndexUtil.getIndex(metadata, id);
if (bedObject != null && bedObject.getValue() instanceof Optional<?> optional) {
if (!hasSendTransaction) player.sendTransaction();
hasSendTransaction = true;
if (optional.isPresent()) {
if (optional.get() instanceof Vector3i bedPos) {
player.addRealTimeTaskNow(() -> {
player.isInBed = true;
player.bedPosition = new Vector3d(bedPos.getX() + 0.5, bedPos.getY(), bedPos.getZ() + 0.5);
});
}
} else {
// Run when we know the player is not in bed 100%
player.addRealTimeTaskNow(() -> player.isInBed = false);
}
}
}
if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_9)) {
int id;
if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_17)) {
id = 8;
} else if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_14)) {
id = 7;
} else if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_10)) {
id = 6;
} else {
id = 5;
}
EntityData<?> entityData = WatchableIndexUtil.getIndex(metadata, id);
// only present if it changed
if (entityData != null && entityData.getValue() instanceof Byte) {
if (!hasSendTransaction) player.sendTransaction();
hasSendTransaction = true;
byte data = (Byte) entityData.getValue();
if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_13)) {
boolean isRiptiding = (data & 4) == 4;
player.latencyUtils.addRealTimeTask(player.lastTransactionSent.get(),
() -> player.isRiptidePose = isRiptiding);
}
// 1.9 eating:
// - Client: I am starting to eat
// - Client: I am no longer eating
// - Server: Got that, you are eating!
// - Client: Okay, starting to eat (no response packet because server caused this)
// - Server: I got that you aren't eating, you are not eating!
// - Client: Okay, I am no longer eating (no response packet because server caused this)
//
// 1.8 eating:
// - Client: I am starting to eat
// - Client: I am no longer eating
// - Server: Okay, I will not make you eat or stop eating because it makes sense that the server doesn't control a player's eating.
//
// This was added for stuff like shields, but IMO it really should be all client sided
boolean isActive = (data & 1) > 0;
boolean isOffhand = (data & 2) > 0;
// Player might have gotten this packet
player.latencyUtils.addRealTimeTask(player.lastTransactionSent.get(),
() -> player.packetStateData.setSlowedByUsingItem(false));
int markedTransaction = player.lastTransactionSent.get();
// Player has gotten this packet
player.latencyUtils.addRealTimeTask(player.lastTransactionSent.get() + 1, () -> {
// If the player hasn't overridden this packet by using or stopping using an item
// Vanilla update order: Receive this -> process new interacts
// Grim update order: Process new interacts -> receive this
if (player.packetStateData.slowedByUsingItemTransaction < markedTransaction) {
player.packetStateData.setSlowedByUsingItem(isActive);
if (isActive) {
player.packetStateData.itemInUseHand = isOffhand ? InteractionHand.OFF_HAND : InteractionHand.MAIN_HAND;
}
}
});
// Yes, we do have to use a transaction for eating as otherwise it can desync much easier
event.getTasksAfterSend().add(player::sendTransaction);
}
}
}
}
}
// NOTE (AI): The 1.14+ pose stripping is a protocol-compat hack: the pose index collides with older health semantics, so Grim removes it rather than risk desyncing the client's movement.Extract sleeping bed position, gliding flag and pose from the self entity's metadata so the movement simulation knows the player's physical state.
The tracker subscribes to the ENTITY_METADATA packet, reads the bed position entry, the gliding bit of the flags byte and the pose entry (1.14+), and applies them through user.packetTickFeedback. A bed position re-anchors the player's position to the bed coordinates, which is the only legitimate teleport-free position reset in the protocol.
// ===== FILE: intave-intave, src/main/java/de/jpx3/intave/module/tracker/player/MetadataTracker.java =====
/*
* Copyright 2026 Intave
*
* This software is licensed under the PolyForm Perimeter License 1.0.0.
* You may use this software for any purpose, except for providing to
* others any product that competes with the software.
*
* A copy of the license is available at:
* https://polyformproject.org/licenses/perimeter/1.0.0/
*/
package de.jpx3.intave.module.tracker.player;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.wrappers.EnumWrappers.EntityPose;
import de.jpx3.intave.adapter.MinecraftVersions;
import de.jpx3.intave.annotate.Nullable;
import de.jpx3.intave.check.movement.physics.environment.Pose;
import de.jpx3.intave.module.Module;
import de.jpx3.intave.module.linker.packet.PacketSubscription;
import de.jpx3.intave.packet.reader.EntityMetadataReader;
import de.jpx3.intave.share.BlockPosition;
import de.jpx3.intave.share.Position;
import de.jpx3.intave.user.User;
import de.jpx3.intave.user.meta.MovementMetadata;
import static de.jpx3.intave.module.linker.packet.PacketId.Server.ENTITY_METADATA;
public final class MetadataTracker extends Module {
@PacketSubscription(
packetsOut = {
ENTITY_METADATA
}
)
public void trackMetadata(
User user, EntityMetadataReader reader,
PacketEvent event
) {
if (!reader.targetEntityIdIsSameAs(user)) {
return;
}
@Nullable BlockPosition sleepingBedPosition = sleepingBedPosition(reader);
@Nullable Boolean newGliding = newGlidingStatus(user, reader);
@Nullable Pose newPose = newPoseStatus(user, reader);
user.packetTickFeedback(event, () -> {
MovementMetadata movement = user.meta().movement();
movement.sleepingBedPosition = sleepingBedPosition;
if (sleepingBedPosition != null) {
Position newPosition = positionFromBedPosition(sleepingBedPosition);
movement.setPosition(newPosition);
movement.setVerifiedLastPosition(newPosition, "Bed sleep");
}
if (newGliding != null) {
movement.gliding = newGliding;
}
if (newPose != null) {
movement.setPose(newPose);
}
});
}
private @Nullable BlockPosition sleepingBedPosition(EntityMetadataReader reader) {
return reader.bedPosition().orElse(null);
}
private Position positionFromBedPosition(BlockPosition bedPosition) {
return new Position(
bedPosition.x() + 0.5,
bedPosition.y() + 0.6875,
bedPosition.z() + 0.5
);
}
private Boolean newGlidingStatus(User user, EntityMetadataReader reader) {
if (!user.meta().protocol().canUseElytra()) {
return false;
}
Object elytraObject = reader.fetchRaw(0);
if (elytraObject == null) {
return null;
}
byte data = (byte) elytraObject;
return (data & 1 << 7) != 0;
}
private @Nullable Pose newPoseStatus(User user, EntityMetadataReader reader) {
if (!MinecraftVersions.VER1_14_0.atOrAbove() || !user.meta().protocol().applyModernCollider()
) {
return null;
}
Object rawPose = reader.fetchRaw(6);
if (rawPose == null) {
return null;
}
try {
EntityPose entityPose = rawPose instanceof EntityPose
? (EntityPose) rawPose
: EntityPose.fromNms(rawPose);
switch (entityPose) {
case STANDING:
return Pose.STANDING;
case FALL_FLYING:
return Pose.FALL_FLYING;
case SLEEPING:
return Pose.SLEEPING;
case SWIMMING:
return Pose.SWIMMING;
case CROUCHING:
return Pose.CROUCHING;
default:
return null;
}
} catch (RuntimeException ignored) {
return null;
}
}
}
// NOTE (AI): The gliding bit (1 << 7) matches the vanilla flags byte used by elytra, and the bed position path is gated on the packet tick feedback so it cannot be replayed out of order.Spoof the health metadata of entities other than the viewer so clients cannot learn real health from the metadata stream.
The module subscribes to ENTITY_METADATA and UPDATE_ATTRIBUTES. On metadata it rewrites any float entry at the version-specific health index to 0.5, skipping the viewer's own entity and dead entities; on attributes it rewrites generic.maxHealth to 1.0 and clears its modifiers. Entity types are filtered by config (players versus others), with ender dragon and wither exempt.
// ===== FILE: Photon-GitHub-AntiCheatAddition, src/main/java/de/photon/anticheataddition/modules/additions/DamageIndicator.java =====
package de.photon.anticheataddition.modules.additions;
import com.github.retrooper.packetevents.event.PacketListenerPriority;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.protocol.attribute.Attributes;
import com.github.retrooper.packetevents.protocol.entity.data.EntityData;
import com.github.retrooper.packetevents.protocol.entity.data.EntityDataTypes;
import com.github.retrooper.packetevents.protocol.entity.type.EntityType;
import com.github.retrooper.packetevents.protocol.entity.type.EntityTypes;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityMetadata;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateAttributes;
import de.photon.anticheataddition.ServerVersion;
import de.photon.anticheataddition.modules.Module;
import de.photon.anticheataddition.modules.ModuleLoader;
import de.photon.anticheataddition.util.protocol.LivingEntityIdLookup;
import de.photon.anticheataddition.util.protocol.PacketAdapterBuilder;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
public final class DamageIndicator extends Module {
public static final DamageIndicator INSTANCE = new DamageIndicator();
private static final float SPOOFED_HEALTH = 0.5F;
private static final double SPOOFED_MAX_HEALTH = 1.0D;
private final boolean spoofOthers = loadBoolean(".entities.others", true);
private final boolean spoofPlayers = loadBoolean(".entities.players", true);
private final boolean spoofHealth = loadBoolean(".spoof.health", true);
private final boolean spoofMaxHealth = loadBoolean(".spoof.max_health", true);
private DamageIndicator()
{
super("DamageIndicator");
}
@Override
protected ModuleLoader createModuleLoader()
{
return ModuleLoader.of(this, PacketAdapterBuilder
.of(this, PacketType.Play.Server.ENTITY_METADATA, PacketType.Play.Server.UPDATE_ATTRIBUTES)
.priority(PacketListenerPriority.HIGH)
// Use the onSending rather than onSendingRaw to allow for bypassing.
.onSending((event, user) -> {
if (this.spoofHealth && event.getPacketType() == PacketType.Play.Server.ENTITY_METADATA) rewriteHealthMetadata(event);
else if (this.spoofMaxHealth && event.getPacketType() == PacketType.Play.Server.UPDATE_ATTRIBUTES) rewriteMaxHealthAttribute(event);
}).build());
}
private void rewriteHealthMetadata(PacketSendEvent event)
{
final WrapperPlayServerEntityMetadata wrapper = new WrapperPlayServerEntityMetadata(event);
final Player viewer = event.getPlayer();
final int entityId = wrapper.getEntityId();
// The player should always be able to see their own data.
if (viewer.getEntityId() == entityId) return;
final EntityType entityType = LivingEntityIdLookup.INSTANCE.getEntityType(entityId);
if (!shouldSpoof(entityType)) return;
final int healthIndex = ServerVersion.ACTIVE.getMetadataPositionIndex().healthIndex();
// Use raw EntityData here to ensure we can use setValue().
for (EntityData data : wrapper.getEntityMetadata()) {
if (data.getIndex() != healthIndex || data.getType() != EntityDataTypes.FLOAT) continue;
final float health = (Float) data.getValue();
if (health <= 0.0F) return;
data.setValue(SPOOFED_HEALTH);
}
}
private void rewriteMaxHealthAttribute(PacketSendEvent event)
{
final WrapperPlayServerUpdateAttributes wrapper = new WrapperPlayServerUpdateAttributes(event);
final Player viewer = event.getPlayer();
final int entityId = wrapper.getEntityId();
if (viewer.getEntityId() == entityId) return;
final EntityType entityType = LivingEntityIdLookup.INSTANCE.getEntityType(entityId);
if (!shouldSpoof(entityType)) return;
for (WrapperPlayServerUpdateAttributes.Property property : wrapper.getProperties()) {
if (property.getAttribute() == Attributes.MAX_HEALTH) {
property.setValue(SPOOFED_MAX_HEALTH);
property.setModifiers(new ArrayList<>());
return;
}
}
}
private boolean shouldSpoof(EntityType entityType)
{
if (entityType == null) return false;
// Bossbar / boss-health edge cases
if (entityType == EntityTypes.ENDER_DRAGON || entityType == EntityTypes.WITHER) return false;
return entityType == EntityTypes.PLAYER ? spoofPlayers : spoofOthers;
}
}
// NOTE (AI): The rewrite only touches the index reported by MetadataPositionIndex for the active server version, so the check stays correct across protocol versions.Tinyprotocol wrapper exposing the entity id and watchable-object list of the S1C packet to FlopAC's packet layer.
The wrapper resolves the watchableObjects and entityid fields via reflection, copies the watchable list, and can rebuild the packet from an entity id and object list via setPacket. FlopAC's processors consume entity state through wrappers like this one.
// ===== FILE: JTXOfficial-FlopAC, src/main/java/me/jtx/flopac/tinyprotocol/packet/out/WrappedOutEntityMetadata.java =====
package me.jtx.flopac.tinyprotocol.packet.out;
import lombok.Getter;
import lombok.Setter;
import me.jtx.flopac.tinyprotocol.api.NMSObject;
import me.jtx.flopac.tinyprotocol.api.Packet;
import me.jtx.flopac.tinyprotocol.api.ProtocolVersion;
import me.jtx.flopac.tinyprotocol.reflection.FieldAccessor;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.List;
@Getter
@Setter
public class WrappedOutEntityMetadata extends NMSObject {
private static final String packet = Packet.Server.ENTITY_METADATA;
private static FieldAccessor<Integer> entityidField;
private static FieldAccessor<List> watchableObjectsField;
private List<Object> watchableObjects;
private int entityId;
public WrappedOutEntityMetadata(Object object, Player player) {
super(object, player);
}
@Override
public void updateObject() {
}
public WrappedOutEntityMetadata(int entityId, List<Object> objects) {
setPacket(packet, entityId, objects);
}
@Override
public void process(Player player, ProtocolVersion version) {
watchableObjectsField = fetchField(packet, List.class, 0);
entityidField = fetchField(packet, int.class, 0);
watchableObjects = new ArrayList<>();
entityId = fetch(entityidField);
List list = fetch(watchableObjectsField);
if(list != null) {
list.forEach(object -> watchableObjects.add(object));
}
}
}
// NOTE (AI): Only the wrapper is present in the corpus for FlopAC; no FlopAC check consumes the watchable objects, so the packet surface for this anticheat is structural.Related Packets
Wiki Cross-Reference
Any metadata properties not included in the packet are left unchanged on the client rather than reset.
MCP 1.8.9 S1CPacketEntityMetadata implements Packet
1.8.9 callers: EntityTrackerEntry.sendMetadataToAllAssociatedPlayers sends new S1CPacketEntityMetadata (line 314): 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 S1CPacketEntityMetadata
Full source walkthroughs of the modules and anti-cheats that use this packet.