0x06 S06PacketUpdateHealth
Updates the player's health, food level, and saturation. Sent ~20 times per second during combat.
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| health | float | Current health (0.0-20.0). ≤ 0.0 = death screen. |
| foodLevel | VarInt | Current food level (0-20) |
| saturationLevel | float | Food saturation (0.0-5.0) |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Health | float | 0.0-20.0 |
| Food | VarInt | 0-20 |
| Saturation | float | 0.0-5.0 |
MCP References
NetHandlerPlayClient.handleUpdateHealth()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 | |
Deobfuscated MCP 1.8.9 source of S06PacketUpdateHealth, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S06PacketUpdateHealth.java) at build time and verified present.
Deep Dive
Role in the protocol
The player's authoritative health, food and saturation sync. EntityPlayerMP sends it on join and on every health, food or saturation change (line ~382), which in combat means roughly once per damage tick. The wire carries a float health (0-20, 0.0 means dead), a VarInt food level and a float saturation. The client treats it as truth: it drives the hearts, the hunger bar and the death screen, and there is no serverbound health packet, so the client cannot push health back.
Vanilla handling
handleUpdateHealth writes the three values into EntityPlayerSP (setPlayerSPHealth, foodStats) and, when health is at or below 0, arms the death-screen state. Respawn itself is a separate round trip: the button click sends C16PacketClientStatus with PERFORM_RESPAWN and the server answers with S07PacketRespawn. Because S06 is receive-only, every client-side health read is a mirror of the last packet.
Why clients touch it
The corpus shows two live integrations and one dead one. Sigma 4.11 Ranking treats S06 as a damage-confirmation clock: a health drop triggers a scan of loaded players for a swing animation within the last 70 ms and 9 blocks, which is how its hidden telemetry attributes deaths. Rise 6.1.30/6.2.4 StaffDetector carries an S06 branch that is fully commented out, and Sigma 4.11 HitIndicator imports the packet but leaves its packet branch empty. The classic Regen/AutoPot/AutoSoup family that keys off S06 thresholds in other client generations does not appear here; in these 8 clients those modules poll local health on UpdateEvent instead.
Exploit surface
The classic abuse is receive-side cancellation: a module that swallows S06 never learns it died, so the death screen never shows while the server keeps sending damage updates and eventually kicks the dead player. No module in the corpus does this. Anti-cheats flag nothing on S06 because the client cannot influence it; the only measurable cost is bandwidth during high-tick combat.
Server-Side Handling
EntityPlayerMP pushes S06PacketUpdateHealth(health, foodLevel, saturation) whenever the player's stats change (line ~382 in the MCP builds), which covers join, damage, regeneration, hunger and saturation drift. The server never validates the packet stream because it is the sole author; the values are copied verbatim from the player's own stats. The death path is two-sided: the client arms the death screen from S06 health <= 0, and the respawn is driven by the client's C16 PERFORM_RESPAWN.
Protocol Analysis
Fields in order: float health, VarInt food, float saturation. There is no serverbound health packet, so any module that wants to fake health must do it by suppressing the clientbound packet (cosmetic only) or by manipulating the server's damage logic through other packets. S06 arrives on the main thread and its writes are unconditional, so a cancelling module must intercept before the vanilla handler.
Anti-Cheat Landscape
Anti-cheats treat S06 as render-state sync and measure nothing on it; the client cannot spoof health serverbound, so there is no flag surface. The practical detection risk belongs to modules that act on S06 (Sigma Ranking's HTTP telemetry, Rise's commented staff heuristic), which are privacy/ToS concerns rather than movement or combat flags.
implementation Implementation Cases
The client's only authoritative health source, sent on join and on every damage, food or saturation change. The corpus uses it as a damage-confirmation clock (Sigma Ranking telemetry) and as abandoned scaffolding (Rise StaffDetector, Sigma HitIndicator); the Regen/AutoPot threshold pattern is absent from these 8 clients, which poll local health on ticks instead.
Hidden combat telemetry that uses S06 health drops to attribute deaths and prosecutions to specific players.
On EventPacket, when S06 reports health at or below the client's current health, Ranking scans the loaded entity list for players that are not the local player, have a swing animation (S0BPacketAnimation) timestamp within the last 70 ms and sit within 9 blocks; each match becomes a prosecutor entity. health <= 0 calls onDeath, which resolves outstanding kill/death records and ships them through sendStat. The S06 packet is the timing anchor: the 70 ms window is measured from animation timestamp to damage confirmation.
// ===== FILE: Sigma 4.11, info/sigmaclient/module/impl/other/Ranking.java =====
package info.sigmaclient.module.impl.other;
import info.sigmaclient.Client;
import info.sigmaclient.event.Event;
import info.sigmaclient.event.RegisterEvent;
import info.sigmaclient.event.impl.EventAttack;
import info.sigmaclient.event.impl.EventPacket;
import info.sigmaclient.event.impl.EventUpdate;
import info.sigmaclient.management.users.TTSystem;
import info.sigmaclient.module.Module;
import info.sigmaclient.module.data.ModuleData;
import info.sigmaclient.util.Timer;
import info.sigmaclient.util.misc.ChatUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.*;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
public class Ranking extends Module {
private HashMap<Integer, HitEntity> hitEntities = new HashMap<>();
private HashMap<Integer, HitEntity> prosecutorEntities = new HashMap<>();
private HashMap<Integer, Long> lastAnimationTimestamp = new HashMap<>();
private info.sigmaclient.util.Timer delay = new Timer();
public Ranking(ModuleData data) {
super(data);
setHidden(true);
if (!isEnabled()) {
toggle();
}
}
@Override
@RegisterEvent(events = {EventAttack.class, EventPacket.class, EventUpdate.class})
public void onEvent(Event e) {
if (e instanceof EventAttack) {
EventAttack ea = (EventAttack) e;
if (ea.getEntity() instanceof EntityPlayer) {
EntityPlayer ep = (EntityPlayer) ea.getEntity();
if (!ep.getName().isEmpty()) {
if (!hitEntities.containsKey(ep.getEntityId())) {
hitEntities.put(ep.getEntityId(), new HitEntity(ep));
} else {
hitEntities.get(ep.getEntityId()).refresh();
}
}
}
} else if (e instanceof EventPacket) {
EventPacket ep = (EventPacket) e;
Packet packet = ep.getPacket();
if (packet instanceof S0BPacketAnimation) {
S0BPacketAnimation packetAnimation = (S0BPacketAnimation) packet;
lastAnimationTimestamp.put(packetAnimation.func_148978_c(), System.currentTimeMillis());
}
if (packet instanceof S06PacketUpdateHealth) {
S06PacketUpdateHealth packetUpdateHealth = (S06PacketUpdateHealth) packet;
if (packetUpdateHealth.getHealth() <= Minecraft.getMinecraft().thePlayer.getHealth()) {
try{
for (Object o : mc.theWorld.getLoadedEntityList()) {
if (o instanceof EntityPlayer) {
EntityPlayer entityPlayer = (EntityPlayer) o;
if (!(entityPlayer instanceof EntityPlayerSP) && lastAnimationTimestamp.containsKey(entityPlayer.getEntityId())) {
if (lastAnimationTimestamp.get(entityPlayer.getEntityId()) > System.currentTimeMillis() - 70 && entityPlayer.getPositionVector().squareDistanceTo(Minecraft.getMinecraft().thePlayer.getPositionVector()) < 9 * 9) {
if (!prosecutorEntities.containsKey(entityPlayer.getEntityId())) {
prosecutorEntities.put(entityPlayer.getEntityId(), new HitEntity(entityPlayer, true));
} else {
prosecutorEntities.get(entityPlayer.getEntityId()).refresh();
}
}
}
}
}
}catch(ConcurrentModificationException ee){};
}
if (packetUpdateHealth.getHealth() <= 0) {
onDeath();
}
}
if (packet instanceof S02PacketChat) {
S02PacketChat packetChat = (S02PacketChat) packet;
String message = packetChat.func_148915_c().getUnformattedText();
Iterator it = hitEntities.entrySet().iterator();
while (it.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000 && message.contains(hitEntity.getName())) {
if (hitEntity.onChatMessage()) {
it.remove();
}
}
}
Iterator it2 = prosecutorEntities.entrySet().iterator();
while (it2.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it2.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000 && message.contains(hitEntity.getName()) && message.contains(Minecraft.getMinecraft().thePlayer.getName())) {
if (hitEntity.onChatMessage()) {
it2.remove();
}
}
}
} else if (packet instanceof S18PacketEntityTeleport) {
S18PacketEntityTeleport packetTeleport = (S18PacketEntityTeleport) packet;
int entityId = packetTeleport.func_149451_c();
onEntityRemoved(entityId);
} else if (packet instanceof S08PacketPlayerPosLook) {
onDeath();
} else if (packet instanceof S13PacketDestroyEntities) {
S13PacketDestroyEntities packetDestroyEntities = (S13PacketDestroyEntities) packet;
for (int entityId : packetDestroyEntities.func_149098_c()) {
onEntityRemoved(entityId);
}
} else if (packet instanceof S40PacketDisconnect) {
S40PacketDisconnect packetDisconnect = (S40PacketDisconnect) packet;
if (packetDisconnect.func_149165_c().getUnformattedText().toLowerCase().contains("ban") && Minecraft.getMinecraft().thePlayer != null && Minecraft.getMinecraft().thePlayer.ticksExisted > 15 * 20) {
sendStat("ban", "");
}
}
} else if (e instanceof EventUpdate) {
if (delay.delay(1000 * 60 * 10)) {
delay.reset();
sendStat("tick", "");
}
}
}
private void onDeath() {
Iterator it2 = prosecutorEntities.entrySet().iterator();
while (it2.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it2.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000) {
if (hitEntity.onRemoved()) {
it2.remove();
}
}
}
}
private void onEntityRemoved(int entityId) {
Iterator it = hitEntities.entrySet().iterator();
while (it.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000 && entityId == hitEntity.getEntityId()) {
if (hitEntity.onRemoved()) {
it.remove();
}
}
}
}
public void sendStat(String type, String data) {
}
private class HitEntity {
private long time = System.currentTimeMillis();
private UUID uuid;
private String name;
private int entityId;
private boolean removed = false;
private boolean chatMessage = false;
private boolean prosecutor = false;
public HitEntity(EntityPlayer ep) {
uuid = ep.getUniqueID();
name = ep.getName();
entityId = ep.getEntityId();
}
public HitEntity(EntityPlayer ep, boolean prosecutor) {
uuid = ep.getUniqueID();
name = ep.getName();
entityId = ep.getEntityId();
this.prosecutor = prosecutor;
}
public boolean onRemoved() {
removed = true;
if (chatMessage) {
if (prosecutor) {
prosecuted();
} else {
killed();
}
return true;
}
return false;
}
public boolean onChatMessage() {
chatMessage = true;
if (removed) {
if (prosecutor) {
prosecuted();
} else {
killed();
}
return true;
}
return false;
}
private void killed() {
//ChatUtil.printChat("Kill (" + name + ") " + uuid.toString());
sendStat("kill", "&uuid=" + uuid.toString().replaceAll("-", ""));
}
public void refresh() {
time = System.currentTimeMillis();
}
public String getName() {
return name;
}
public long getTime() {
return time;
}
public int getEntityId() {
return entityId;
}
public void prosecuted() {
//ChatUtil.printChat("Prosecuted (" + name + ") " + uuid.toString());
sendStat("death", "&uuid=" + uuid.toString().replaceAll("-", ""));
}
}
}
// NOTE (AI): Ranking is a hidden module (setHidden(true), toggled on construction) that
// reports kill/death/ban statistics to a remote endpoint; sendStat is stubbed in this
// build. The S06 check compares the packet health against the local player's current health
// to detect a drop, then correlates S0BPacketAnimation timestamps within 70 ms and a
// 9-block radius to identify the attacker. S06 is the only authoritative damage signal the
// client receives, which is why the correlation window is anchored to it. Note the packet
// is consumed via the wildcard import net.minecraft.network.play.server.*.
Detect staff players from team and tab-list names and auto-run /hub; the S06 reference is commented-out scaffolding, not live logic.
The packet listener matches names from S3EPacketTeams and S38PacketPlayerListItem against a hardcoded staff table (one comma-separated string of roughly 150 names) and triggers after 6 matches, sending /hub via C01 when autoLeave is on. The S06PacketUpdateHealth block exists only inside a comment, an abandoned idea that never shipped in either build.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/module/impl/exploit/StaffDetector.java =====
package com.alan.clients.module.impl.exploit;
import com.alan.clients.event.Listener;
import com.alan.clients.event.annotations.EventLink;
import com.alan.clients.event.impl.motion.PreMotionEvent;
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
import com.alan.clients.module.Module;
import com.alan.clients.module.api.Category;
import com.alan.clients.module.api.ModuleInfo;
import com.alan.clients.value.impl.BooleanValue;
import net.minecraft.network.Packet;
@ModuleInfo(aliases = {"module.combat.staffdetector.name"}, description = "module.exploit.staffdetector.description", category = Category.EXPLOIT)
public class StaffDetector extends Module {
BooleanValue autoLeave = new BooleanValue("Auto Leave", this, true);
private String[] staff;
private int count;
public StaffDetector() {
String input = "idhoom,7so,1sweet,jinaaan,ev2n,eissaa,mohmad_q8,1daykel,ximtaig_,nshme,comsterr,e9_,1meko,1lab,mk_f16,loovq,_sadeq,nv0ola,1f5amh___3oo,frecss217,xmz7,a2bod,eyeso_diamond,bunkrat,1rana,1ahmd,1heyimhasson_,casteret,1elyy,1zeyad,lt1x,firas,postme,3mmr,xl2d,yzed,y2men,iv2a,_nonameishere_,0hfault,deficency,anauri,xluffy1,kinderbueno__,_revoox_,xidayzer,i7ilin,1adam__,27bk,ventz_,awfultimes,ahm2d,gsomar,mvp11,xxkhaledxxcraft,aymann_,1iraqi,rambokinq,undertest,zswift,strongest0ne,neverletyouknow,zixgamer,sanfoor_j,ixghoul_,imbexsl_,glowdown_,hunter47,fexoranep,1reyleigh,420waffle,ywgiz,sweetyalice,xfahadq,mr3nb_,akash1004,zaytonaaa,rma7o,mr_1990,iali_305,wacros,lwwh,pynifical,rivsci,itsjuan_,meedo_qb,_r3,1speedo_,_justidk,505t,xzvv,mauveracer,_1hypersx_,rayqquaza,swivee,absqtulate,opgaming2009,vhagardracarys,luffy404,faisaal420,hdzt,sunsnipebeastwtf,_odex,1ashu,n13m_,callinu,sh59,drnyx,iisrab5bgii,haoeris,lxrayanxl,toxiclayer,greatm7md,brksfrb2,madix707,hnxrr,1sweetty,ohhhhqls,solidfying,_i_b,escoco,dreadpirater0b,aboshxm,0ryze,spuvr,va_1,kingpvp90,rieus,prebowed,mitsichu,gogglas,battlebay,32lbo,7far_8bor,evenfai,hlazny,valrm";
staff = input.split(",");
}
@EventLink
public final Listener<PreMotionEvent> onPreMotion = event -> {
count = Math.max(0, count - 1);
};
@EventLink
public final Listener<PacketReceiveEvent> onPacketReceive = event -> {
Packet<?> packet = event.getPacket();
// if (packet instanceof S3EPacketTeams) {
// final S3EPacketTeams teams = (S3EPacketTeams) packet;
//
// for (final String name : teams.func_149310_g()) {
// if (Arrays.asList(staff).contains(name.toLowerCase())) {
// count++;
//
// if (count == 6) {
// ChatUtil.display("Staff Detected " + name);
//
// if (autoLeave.getValue()) PacketUtil.send(new C01PacketChatMessage("/hub"));
// }
// }
// }
// }
// if (packet instanceof S38PacketPlayerListItem) {
// S38PacketPlayerListItem item = ((S38PacketPlayerListItem) packet);
//
// for (S38PacketPlayerListItem.AddPlayerData player : item.func_179767_a()) {
// if (player == null || player.getProfile() == null || player.getProfile().getName() == null) {
// continue;
// } else if (!player.getProfile().getName().equals("SHOP") && !player.getProfile().getName().equals("UPGRADES")) {
// ChatUtil.display("Username: " + player.getProfile().getName());
// }
//
// if (Arrays.asList(staff).contains(player.getProfile().getName().toLowerCase())) {
// ChatUtil.display("Staff Detected " + player.getProfile().getName());
//
// if (autoLeave.getValue()) PacketUtil.send(new C01PacketChatMessage("/hub"));
// }
// }
// }
// if (packet instanceof S) {
// S06PacketUpdateHealth health = ((S06PacketUpdateHealth) packet);
//
// }
};
}
// NOTE (AI): The S06PacketUpdateHealth branch is entirely commented out in both Rise
// 6.1.30 and 6.2.4; the fragment '// if (packet instanceof S) {' even retains a placeholder
// class name. Live logic matches S3EPacketTeams and S38PacketPlayerListItem against a
// hardcoded staff name list, with a count of 6 triggering the auto-leave /hub via C01.
// The commented block is included because it is the only S06 reference in the Rise
// codebase and documents an abandoned health-based staff heuristic.
anticheat Anti-Cheat Checks
The update-health packet is server-authored, so anticheats cannot see a client-spoofed health value; what they can see is the server's own health bookkeeping around it. Modern anticheats parse WrapperPlayServerUpdateHealth on the send side to track death and food state (Grim, BetterAnticheat), while regen and god-mode checks watch EntityRegainHealthEvent and damage events to catch fast-heal and damage suppression (Negativity, Arc, NoCheatPlus, Daedalus, ThotPatrol, MIU). The packet itself is never flagged; it is the reference clock for health-related checks.
Track the client-visible death state from the update-health payload and the client's own respawn acknowledgement.
PlayerStatusTracker.handlePacketPlaySend wraps UPDATE_HEALTH as WrapperPlayServerUpdateHealth and, inside a confirmation transaction, pushes isDead = (health == 0) into a ten-slot BooleanManyState that flushes only after the client confirms the packet. The receive side mirrors it: a CLIENT_STATUS PERFORM_RESPAWN pushes isDead = false and flushes four slots at once, deliberately wiping stale death states to defeat disablers that delay selected responses.
// ===== FILE: amnoah-BetterAnticheat, core/src/main/java/better/anticheat/core/player/tracker/impl/PlayerStatusTracker.java =====
package better.anticheat.core.player.tracker.impl;
import better.anticheat.core.player.Player;
import better.anticheat.core.player.tracker.Tracker;
import better.anticheat.core.player.tracker.impl.confirmation.ConfirmationTracker;
import com.github.retrooper.packetevents.event.simple.PacketPlayReceiveEvent;
import com.github.retrooper.packetevents.event.simple.PacketPlaySendEvent;
import com.github.retrooper.packetevents.protocol.attribute.Attribute;
import com.github.retrooper.packetevents.protocol.attribute.Attributes;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientClientStatus;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateAttributes;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateHealth;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import wtf.spare.sparej.xstate.manystate.BooleanManyState;
import wtf.spare.sparej.xstate.manystate.DoubleManyState;
import java.util.HashMap;
import java.util.Map;
import java.util.Objects;
@Getter
@Slf4j
public class PlayerStatusTracker extends Tracker {
private final BooleanManyState isDead = new BooleanManyState(10);
private final ConfirmationTracker confirmationTracker;
private final Map<Attribute, DoubleManyState> attributes = new HashMap<>();
public PlayerStatusTracker(final Player player, final ConfirmationTracker confirmationTracker) {
super(player);
this.confirmationTracker = confirmationTracker;
// Default attribute values.
final var entityInteractionRange = attributes.computeIfAbsent(Attributes.ENTITY_INTERACTION_RANGE, (ignored) -> new DoubleManyState(10));
final var blockInteractionRange = attributes.computeIfAbsent(Attributes.BLOCK_INTERACTION_RANGE, (ignored) -> new DoubleManyState(10));
final var scale = attributes.computeIfAbsent(Attributes.SCALE, (ignored) -> new DoubleManyState(10));
entityInteractionRange.addNew(3.0);
blockInteractionRange.addNew(5.0);
scale.addNew(1.0);
/*
entityInteractionRange.flushOld();
blockInteractionRange.flushOld();
scale.flushOld();
*/
}
/*
* Packet handling.
*/
@Override
public void handlePacketPlaySend(final PacketPlaySendEvent event) {
switch (event.getPacketType()) {
case PacketType.Play.Server.UPDATE_HEALTH -> {
final var wrapper = new WrapperPlayServerUpdateHealth(event);
confirmationTracker
.confirm()
.onBegin(() -> {
isDead.addNew(wrapper.getHealth() == 0);
log.debug("added to {} due to health", wrapper.getHealth() == 0);
})
.onAfterConfirm(() -> {
isDead.flushOld();
log.debug("flushed to {} due to health", wrapper.getHealth() == 0);
});
}
case DEATH_COMBAT_EVENT -> confirmationTracker
.confirm()
.onBegin(() -> {
isDead.addNew(true);
log.debug("added to true due to death");
})
.onAfterConfirm(() -> {
isDead.flushOld();
log.debug("flushed to true due to death");
});
case UPDATE_ATTRIBUTES -> {
final var wrapper = new WrapperPlayServerUpdateAttributes(event);
if (wrapper.getEntityId() != player.getUser().getEntityId()) return;
final var confirmationState = confirmationTracker.confirm();
for (final var property : wrapper.getProperties()) {
confirmationState.onBegin(() -> {
final var state = attributes.computeIfAbsent(property.getAttribute(), k -> new DoubleManyState(10));
state.addNew(property.getValue());
log.debug("added to {} due to {}", property.getValue(), property.getAttribute());
}).onAfterConfirm(() -> {
final var state = attributes.get(property.getAttribute());
if (state != null) {
state.flushOld();
log.debug("flushed to {} due to {}", property.getValue(), property.getAttribute());
}
});
}
}
}
}
public double[] getMostLikelyPoses() {
if (!attributes.containsKey(Attributes.SCALE)) log.error("No scale attribute, attrs: {}", attributes);
final var scale = attributes.get(Attributes.SCALE).getCurrent();
// Standing, sneaking then Elytra
return new double[]{1.62 * scale, 1.27 * scale, 0.4 * scale};
}
public void handlePacketPlayReceive(final PacketPlayReceiveEvent event) {
switch (event.getPacketType()) {
case CLIENT_STATUS -> {
final var wrapper = new WrapperPlayClientClientStatus(event);
if (Objects.requireNonNull(wrapper.getAction()) == WrapperPlayClientClientStatus.Action.PERFORM_RESPAWN) {
isDead.addNew(false);
// Once client says alive, flush ALL the deads, as client state is all that matters.
// This is done to prevent disabler exploits where you selectively delay the response to certain packets.
for (int i = 0; i < 4; i++) {
isDead.flushOld();
}
log.debug("added and flushed to false due to respawn");
}
}
}
}
}
// NOTE (AI): The update-health branch is lines 57-70. The isDead many-state is also fed by the DEATH_COMBAT_EVENT branch (72-81), and the PERFORM_RESPAWN flush (116-128) is the client-side half of the death cycle.
Flag fast regeneration: health regaining faster than the version's natural regen interval allows.
RegenProtocol.onRegen listens to EntityRegainHealthEvent for players. It skips players with active regen-affecting potions, records the time between regains and flags when the gap is below the version's timeBetweenTwoRegen plus ping (per-version table in Version). A gap under 50 ms plus ping is a hard violation, and the event is cancelled when setbacks are enabled. The protocol also tags the player's flying reason on golden-apple interactions so movement checks can discount regen-based vertical motion.
// ===== FILE: Elikill58-Negativity, src/com/elikill58/negativity/spigot/protocols/RegenProtocol.java =====
package com.elikill58.negativity.spigot.protocols;
import org.bukkit.Difficulty;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityRegainHealthEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import com.elikill58.negativity.spigot.SpigotNegativity;
import com.elikill58.negativity.spigot.SpigotNegativityPlayer;
import com.elikill58.negativity.universal.Cheat;
import com.elikill58.negativity.universal.CheatKeys;
import com.elikill58.negativity.universal.FlyingReason;
import com.elikill58.negativity.universal.ReportType;
import com.elikill58.negativity.universal.Version;
import com.elikill58.negativity.universal.utils.UniversalUtils;
public class RegenProtocol extends Cheat implements Listener {
public RegenProtocol() {
super(CheatKeys.REGEN, true, Material.GOLDEN_APPLE, CheatCategory.PLAYER, true, "regen", "autoregen");
}
@EventHandler
public void onPlayerInteract(PlayerInteractEvent e) {
Player p = e.getPlayer();
if(e.getItem() == null)
return;
Material m = e.getItem().getType();
if (m.equals(Material.GOLDEN_APPLE) || m.equals(Material.GOLDEN_CARROT))
SpigotNegativityPlayer.getNegativityPlayer(p).flyingReason = FlyingReason.REGEN;
}
@EventHandler
public void onRegen(EntityRegainHealthEvent e) {
if (!(e.getEntity() instanceof Player))
return;
Player p = (Player) e.getEntity();
SpigotNegativityPlayer np = SpigotNegativityPlayer.getNegativityPlayer(p);
boolean hasPotion = false;
for (PotionEffect pe : p.getActivePotionEffects())
if (pe.getType().equals(PotionEffectType.POISON) || pe.getType().equals(PotionEffectType.BLINDNESS)
|| pe.getType().equals(PotionEffectType.WITHER)
|| pe.getType().equals(PotionEffectType.SLOW_DIGGING)
|| pe.getType().equals(PotionEffectType.WEAKNESS) || pe.getType().equals(PotionEffectType.CONFUSION)
|| pe.getType().equals(PotionEffectType.HUNGER))
hasPotion = true;
if (hasPotion)
np.flyingReason = FlyingReason.POTION;
else
np.flyingReason = FlyingReason.REGEN;
long actual = System.currentTimeMillis(), dif = actual - np.LAST_REGEN;
if (np.LAST_REGEN != 0 && !p.hasPotionEffect(PotionEffectType.REGENERATION) && !p.hasPotionEffect(PotionEffectType.HEAL) && np.hasDetectionActive(this)
&& (np.LAST_REGEN != System.currentTimeMillis() && Version.getVersion().isNewerOrEquals(Version.V1_14))
&& !p.getWorld().getDifficulty().equals(Difficulty.PEACEFUL)) {
int ping = np.ping;
if (dif < (Version.getVersion().getTimeBetweenTwoRegenFromVersion() + ping)) {
boolean mayCancel = SpigotNegativity.alertMod(dif < (50 + ping) ? ReportType.VIOLATION : ReportType.WARNING, p, this,
UniversalUtils.parseInPorcent(200 - dif - ping), "Player regen, last regen: " + np.LAST_REGEN
+ " Actual time: " + actual + " Difference: " + dif + "ms",
hoverMsg("main", "%time%", dif));
if(isSetBack() && mayCancel)
e.setCancelled(true);
}
}
np.LAST_REGEN = actual;
}
}
// NOTE (AI): The regen window math is on lines 56-70; Version.getTimeBetweenTwoRegenFromVersion() is the per-version baseline (4 seconds at 1.8). The check keys off the Bukkit event, not the S06 packet, because the packet is server-authored.
Classic satiated-regen rate check: health must not regenerate faster than the configured interval.
FightListener.onRegen records the SATIATED regain timestamp into FightData when the check can run; Regeneration.check computes now minus lastHealthEvent and fails when the gap is below the regen-time value read from the check config (3400 ms default). It is one of the smallest checks in the corpus: a timestamp, a subtraction and a threshold.
// ===== FILE: Vrekt-Arc-v2, src/main/java/me/vrekt/arc/check/combat/Regeneration.java =====
package me.vrekt.arc.check.combat;
import me.vrekt.arc.Arc;
import me.vrekt.arc.check.Check;
import me.vrekt.arc.check.CheckType;
import me.vrekt.arc.data.combat.FightData;
import org.bukkit.entity.Player;
public class Regeneration extends Check {
private long regenerationTime = 0;
public Regeneration() {
super(CheckType.REGENERATION);
regenerationTime = (long) Arc.getCheckManager().getValueInt(CheckType.REGENERATION, "regen-time");
}
public boolean check(Player player, FightData data) {
if (data.getLastHealthEvent() == 0) {
return false;
}
// time = 3400
long now = System.currentTimeMillis();
long past = data.getLastHealthEvent();
long timeSince = now - past;
// check if the time it took to regenerate is lower than allowed.
return timeSince < regenerationTime && checkViolation(player, "regeneration time too fast.");
}
}
// NOTE (AI): The corpus hit is the SATIATED-only timing pattern: FightListener.onRegen only stamps data.setLastHealthEvent when the regain reason is SATIATED, which is exactly the condition this check reads.
Detect players that ignore inflicted damage or keep an impossible health ceiling across regen and damage events.
GodMode.check runs on damage events against FightData bookkeeping: regainHealthTime is stamped by FightListener.onEntityRegainHealth, godModeHealth tracks the highest health the player has held, and the check flags when current health stays above the expected post-damage value or when no damage lands despite a hit. The regain-tracking variant is what the corpus shows; the original 2012-era sensitivity path is marked as likely obsolete in the source.
// ===== FILE: Updated-NoCheatPlus-NoCheatPlus, NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/fight/GodMode.java =====
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.checks.fight;
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.NCPAPIProvider;
import fr.neatmonster.nocheatplus.checks.Check;
import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.checks.net.NetData;
import fr.neatmonster.nocheatplus.compat.bukkit.BridgeHealth;
import fr.neatmonster.nocheatplus.compat.IBridgeCrossPlugin;
import fr.neatmonster.nocheatplus.compat.SchedulerHelper;
import fr.neatmonster.nocheatplus.components.registry.event.IGenericInstanceHandle;
import fr.neatmonster.nocheatplus.players.IPlayerData;
import fr.neatmonster.nocheatplus.utilities.CheckUtils;
import fr.neatmonster.nocheatplus.utilities.TickTask;
/**
* The GodMode check will find out if a player tried to stay invulnerable after being hit or after dying.
*/
public class GodMode extends Check {
private final IGenericInstanceHandle<IBridgeCrossPlugin> crossPlugin = NCPAPIProvider.getNoCheatPlusAPI().getGenericInstanceHandle(IBridgeCrossPlugin.class);
/**
* Instantiates a new god mode check.
*/
public GodMode() {
super(CheckType.FIGHT_GODMODE);
}
/**
* "New" style god mode check. Much more sensitive.
* Likely irrelevant check by now. Subject to removal.<br>
* Dates back to 2012 when god-mode exploits used to be quite common.
* Nowadays, such cheats are exceptionally rare and usually the result of a conflict of some sort with plugins, rather than a vanilla bug.
*
* @param player
* @param playerIsFake
* @param damage
* @param data
* @param pData
* @return True if to "cancel", to be interpreted as "cancel their invulnerability", thus inflicting/enforcing damage.
*/
public boolean check(final Player player, final boolean playerIsFake, final double damage, final FightData data, final IPlayerData pData) {
// TODO: In fact, this check is ineffective in general. Usually, GodMode cheats and the like don't even fire EntityDamageByEntity events
// so this check wouldn't even have the chance to pick up the cheat.
final int tick = TickTask.getTick();
final int noDamageTicks = Math.max(0, player.getNoDamageTicks());
final int invulnerabilityTicks = playerIsFake ? 0 : mcAccess.getHandle().getInvulnerableTicks(player);
/** Return, reduce VL */
boolean legit = false;
/** Set tick/ndt and return */
boolean set = false;
/** Reset accumulator counter */
boolean resetAcc = false;
/** Reset all and return */
boolean resetAll = false;
/** Check difference to expectation */
final int dTick = tick - data.lastDamageTick;
/** Check difference to expectation */
final int dNDT = data.lastNoDamageTicks - noDamageTicks;
final int delta = dTick - dNDT;
final double health = BridgeHealth.getHealth(player);
if (data.godModeHealth > health) {
data.godModeHealthDecreaseTick = tick;
legit = set = resetAcc = true;
}
// TODO: Might account for ndt/2 on regain health (!).
// Invulnerable or inconsistent.
// TODO: might check as well if NCP has taken over invulnerable ticks of this player.
if (invulnerabilityTicks != Integer.MAX_VALUE && invulnerabilityTicks > 0
|| tick < data.lastDamageTick) {
// (Second criteria is for MCAccessBukkit.)
legit = set = resetAcc = true;
}
// Reset accumulator.
if (20 + data.godModeAcc < dTick || dTick > 40) {
legit = resetAcc = set = true;
}
// Check if reduced more than expected or new/count down fully.
// TODO: Mostly workarounds.
if (delta <= 0 || data.lastNoDamageTicks <= player.getMaximumNoDamageTicks() / 2
|| dTick > data.lastNoDamageTicks
|| damage > BridgeHealth.getLastDamage(player)
|| damage == 0.0) {
// Not resetting acc.
legit = set = true;
}
if (dTick == 1 && noDamageTicks < 19) {
set = true;
}
if (delta == 1) {
// Ignore these, but keep reference value from before.
legit = true;
}
// Bukkit.getServer().broadcastMessage("God " + player.getName() + " delta=" + delta + " dt=" + dTick + " dndt=" + dNDT + " acc=" + data.godModeAcc + " d=" + damage + " ndt=" + noDamageTicks + " h=" + health + " slag=" + TickTask.getLag(dTick, true));
// TODO: might check last damage taken as well (really taken with health change)
// Resetting
data.godModeHealth = health;
if (resetAcc || resetAll) {
data.godModeAcc = 0;
}
// Reset all.
if (resetAll) {
data.lastNoDamageTicks = 0;
data.lastDamageTick = 0;
return false;
}
// Only set the tick values.
if (set) {
data.lastNoDamageTicks = noDamageTicks;
data.lastDamageTick = tick;
return false;
}
// Decrease VL and return
if (legit) {
data.godModeVL *= 0.97;
return false;
}
if (tick < data.godModeHealthDecreaseTick){
data.godModeHealthDecreaseTick = 0;
}
else {
final int dht = tick - data.godModeHealthDecreaseTick;
if (dht <= 20) {
return false;
}
}
final FightConfig cc = pData.getGenericInstance(FightConfig.class);
// Check for client side lag.
final long now = System.currentTimeMillis();
final long maxAge = cc.godModeLagMaxAge;
long keepAlive = Long.MIN_VALUE;
if (NCPAPIProvider.getNoCheatPlusAPI().hasFeatureTag("checks", "KeepAliveFrequency")) {
keepAlive = pData.getGenericInstance(NetData.class).lastKeepAliveTime;
}
keepAlive = Math.max(keepAlive, CheckUtils.guessKeepAliveTime(player, now, maxAge, pData));
if (keepAlive != Double.MIN_VALUE && now - keepAlive > cc.godModeLagMinAge && now - keepAlive < maxAge) {
// Assume lag.
return false;
}
// Violation probably.
data.godModeAcc += delta;
boolean cancel = false;
// TODO: bounds
if (data.godModeAcc > 2) {
data.godModeVL += delta;
cancel = executeActions(player, data.godModeVL, delta, pData.getGenericInstance(FightConfig.class).godModeActions).willCancel();
}
// Set tick values.
data.lastNoDamageTicks = noDamageTicks;
data.lastDamageTick = tick;
return cancel;
}
/**
* If a player apparently died, make sure they really die after some time if they didn't already, by setting up a
* Bukkit task.
* Again, most likely irrelevant check by now, but you can't be too sure with this game.
*
* @param player
* the player
*/
public void death(final Player player) {
// First check if the player is really dead (e.g. another plugin could have just fired an artificial event).
if (BridgeHealth.getHealth(player) <= 0.0 && player.isDead()
&& crossPlugin.getHandle().isNativeEntity(player)) {
try {
// Schedule a task to be executed in roughly 1.5 seconds.
SchedulerHelper.runSyncDelayedTaskForEntity(player, Bukkit.getPluginManager().getPlugin("NoCheatPlus"), (arg) -> {
try {
// Check again if the player should be dead, and if the game didn't mark them as dead.
if (mcAccess.getHandle().shouldBeZombie(player)){
// Artificially "kill" them.
mcAccess.getHandle().setDead(player, 19);
}
}
catch (final Exception ignored) {}
}, null, 30);
}
catch (final Exception ignored) {}
}
}
}
// NOTE (AI): The corpus hits for this file are BridgeHealth calls inside the regain pipeline: FightListener.onEntityRegainHealth (lines 831-844) maintains godModeHealth and regainHealthTime, which is the data this check consumes. The file itself never references S06.
Related Packets
Wiki Cross-Reference
Food saturation acts as a food overcharge so food values do not decrease while saturation is above zero.
New or respawning players automatically get a saturation of 5.0, and eating food raises saturation as well as the food bar.
MCP 1.8.9 S06PacketUpdateHealth implements Packet
1.8.9 callers: EntityPlayerMP.onUpdateEntity sends new S06PacketUpdateHealth (line 403): 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.