0x00 S00PacketKeepAlive
Server sends a keep-alive ID that the client must echo back in C00PacketKeepAlive.
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| id | VarInt | Random keep-alive ID to echo back |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Keep Alive ID | int | Random ID |
MCP References
NetHandlerPlayClient.handleKeepAlive()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 | |
Deobfuscated MCP 1.8.9 source of S00PacketKeepAlive, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S00PacketKeepAlive.java) at build time and verified present.
Deep Dive
Role in the protocol
S00PacketKeepAlive is the clientbound half of the play-state liveness probe. NetHandlerPlayServer sends it roughly once per second from its update loop with a server-chosen int key (field_147378_h), and the vanilla client echoes it back as C00PacketKeepAlive with the same key. NetHandlerPlayServer.processKeepAlive compares the echoed key and folds the round-trip into the player's ping EMA: ping = (ping * 3 + delta) / 4. Because it is the only timing-only packet in the play state, it is the reference clock that ping spoofers, disablers and timing-based velocity exploits all anchor on.
Vanilla handling
NetHandlerPlayClient.handleKeepAlive echoes immediately: addToSendQueue(new C00PacketKeepAlive(packetIn.func_149134_c())). Server side, processKeepAlive is a pure timing check: a matching key updates the ping EMA, a wrong key is silently ignored. There is no per-connection timeout in the vanilla 1.8.9 server for a missing echo; timeouts are enforced by the network layer read timeout or by anti-cheat plugins. That asymmetry, an immediate client echo versus a server that never punishes a missing one, is what every keepalive-timing exploit depends on.
Why clients touch it
Four distinct uses in the 8 clients. (1) Debugger in Rise 5.99, 6.1.30 and 6.2.4 prints incoming keepalive ids to chat so the user can watch server cadence while tuning other modules. (2) Rise 6.2.4 WatchdogVelocity and WatchdogPredictionVelocity cancel the keepalive while a velocity spoof is armed, silencing the server's timing reference during the spoof window. (3) Sigma 4.11 Disabler Erisium mode captures the key on receive and replays a stale C00 every 1500ms, freezing the measured ping. (4) Rise 6.x NetworkAPI registers the class so JavaScript scripts can hook its receive. Note the corpus has no PingSpoof hit for S00: the spoofers in these clients intercept the C00 echo side instead.
Exploit surface
Because the vanilla echo is immediate, any delay, cancellation or replay shows up as a ping shift or a stalled keepalive stream. The Watchdog velocity modules cancel S00 while holding S12/S32 packets so the server cannot correlate a latency spike with the velocity cancel; WatchdogPredictionVelocity re-injects the buffered keepalive on the strafe trigger to restore sequencing. Sigma's Erisium mode cancels C00 echoes and re-sends the last captured key on a timer, which keeps the server's key comparison failing silently so the ping EMA never updates. The trade-off is structural: cancellation is invisible to the packet stream but leaves the connection dead on servers that do track keepalive gaps.
Server-Side Handling
NetHandlerPlayServer sends S00PacketKeepAlive(field_147378_h) roughly every second from its tick loop. processKeepAlive: if the echoed key matches field_147378_h, ping = (ping * 3 + (now - lastPingTime)) / 4; wrong or missing keys are silently dropped with no penalty. There is no vanilla timeout for a dead keepalive; connection liveness is the network layer's job.
Protocol Analysis
PLAY state, id 0x00, one VarInt int key (server-tick counter in vanilla). Clientbound; the serverbound echo is C00PacketKeepAlive with the same id value but a different class in the opposite direction. The key is opaque to the client: modules that mutate or replay it rely on the server never validating beyond equality with the last sent key. Because it arrives constantly, it is also the cheapest packet for modules to use as a timing beacon.
Anti-Cheat Landscape
NCP and AAC track keepalive timing to separate real latency from timer abuse; a frozen or wildly inflated ping is a classic timer/fly tell. Verus-era checks correlate keepalive gaps with C0F transaction gaps, which is why the Rise 6.2.4 Watchdog modes cancel S00 and S32 together, and why Sigma's Erisium mode replays keys instead of cancelling outright: pure cancellation is strong but lethal on servers with keepalive timeouts. Debugger and NetworkAPI are observation-only and never flag.
implementation Implementation Cases
The clientbound keepalive, echoed instantly by vanilla and used by clients as the timing reference for ping, disabler and velocity-spoof logic. Corpus hits: Debugger (Rise 5.99/6.x), WatchdogVelocity and WatchdogPredictionVelocity (Rise 6.2.4), Sigma's Erisium disabler mode, and the Rise 6.x script NetworkAPI registry.
Print incoming keepalive ids to chat so the user can observe the server's keepalive cadence while developing or tuning timing-based modules.
A PacketReceiveEvent handler checks instanceof S00PacketKeepAlive and prints 'KeepAlive | id:
// ===== FILE: Rise 5.99, dev/rise/module/impl/other/Debugger.java =====
package dev.rise.module.impl.other;
import dev.rise.Rise;
import dev.rise.event.impl.packet.PacketReceiveEvent;
import dev.rise.module.Module;
import dev.rise.module.api.ModuleInfo;
import dev.rise.module.enums.Category;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S00PacketKeepAlive;
import net.minecraft.network.play.server.S32PacketConfirmTransaction;
@ModuleInfo(name = "Debugger", description = "Debugs packets", category = Category.OTHER)
public final class Debugger extends Module {
@Override
public void onPacketReceive(final PacketReceiveEvent event) {
final Packet<?> packet = event.getPacket();
if (packet instanceof S32PacketConfirmTransaction) {
final S32PacketConfirmTransaction wrapper = ((S32PacketConfirmTransaction) packet);
Rise.addChatMessage("Transaction | id: " + wrapper.getActionNumber());
}
if (packet instanceof S00PacketKeepAlive) {
final S00PacketKeepAlive wrapper = ((S00PacketKeepAlive) packet);
Rise.addChatMessage("KeepAlive | id: " + wrapper.func_149134_c());
}
}
}
// NOTE (AI): Debugger never mutates the packet, so the vanilla echo in NetHandlerPlayClient.handleKeepAlive still fires and the ping EMA updates normally. It exists to expose keepalive cadence and ids in chat, which is exactly the information the authors needed when tuning the ping-spoof and disabler timings elsewhere in the client. The paired S32 logging shows keepalive and transaction were inspected together, matching the Verus-style correlation anti-cheats use.Cancel incoming keepalives while a velocity spoof is armed, so the server's timing probes stay silent during the window where the client holds velocity and transaction packets.
A PacketReceiveEvent switch: while active, S12PacketEntityVelocity and S32PacketConfirmTransaction are buffered and cancelled, and the S00PacketKeepAlive case either cancels outright (WatchdogVelocity, gated by a spoof BooleanValue) or buffers it on every third tick (WatchdogPredictionVelocity). On the strafe/boost trigger the buffer is replayed through PacketUtil.receive, restoring the keepalive and transaction sequence.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/module/impl/combat/velocity/WatchdogPredictionVelocity.java =====
package com.alan.clients.module.impl.combat.velocity;
import com.alan.clients.component.impl.player.BadPacketsComponent;
import com.alan.clients.component.impl.player.PingSpoofComponent;
import com.alan.clients.component.impl.player.TargetComponent;
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.motion.StrafeEvent;
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
import com.alan.clients.module.impl.combat.Velocity;
import com.alan.clients.module.impl.movement.Flight;
import com.alan.clients.util.chat.ChatUtil;
import com.alan.clients.module.impl.movement.LongJump;
import com.alan.clients.util.packet.PacketUtil;
import com.alan.clients.util.player.MoveUtil;
import com.alan.clients.util.vector.Vector2d;
import com.alan.clients.value.Mode;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C0APacketAnimation;
import net.minecraft.network.play.server.S00PacketKeepAlive;
import net.minecraft.network.play.server.S12PacketEntityVelocity;
import net.minecraft.network.play.server.S32PacketConfirmTransaction;
import java.util.ArrayList;
import java.util.List;
public class WatchdogPredictionVelocity extends Mode<Velocity> {
public WatchdogPredictionVelocity(String name, Velocity parent) {
super(name, parent);
}
private boolean active, receiving;
private int offGroundTicks;
private final ArrayList<Packet<?>> packets = new ArrayList<>();
private float desiredYaw;
private double velX, velZ;
@EventLink
public final Listener<PacketReceiveEvent> onPacketReceive = event -> {
if (receiving || getModule(LongJump.class).isEnabled() && mc.thePlayer.offGroundTicks < 29 || getModule(Flight.class).isEnabled())
return;
switch (event.getPacket()) {
case S12PacketEntityVelocity velocity -> {
if (velocity.getEntityID() == mc.thePlayer.getEntityId()) {
if (!event.isCancelled()) {
active = true;
// packets.add(velocity);
// PingSpoofComponent.spoof(50, true, false, false, false, false, false);
// mc.thePlayer.motionY = velocity.getMotionY() / 8000.0D;
active = true;
// Calculate desiredYaw based on incoming velocity
double velX = velocity.getMotionX() / 8000.0D;
double velZ = velocity.getMotionZ() / 8000.0D;
desiredYaw = (float) Math.toDegrees(Math.atan2(velZ, velX));
// Adjust desiredYaw to match the player's yaw range (-180 to 180)
if (desiredYaw < -180) desiredYaw += 360;
if (desiredYaw > 180) desiredYaw -= 360;
packets.add(velocity);
event.setCancelled();
this.velX = velX;
this.velZ = velZ;
velocity.motionY *= 1;
event.setPacket(velocity);
}
}
}
case S32PacketConfirmTransaction transaction -> {
if (active) {
packets.add(transaction);
event.setCancelled();
// active = false;
// PingSpoofComponent.spoof(50, true, false, false, false, false, false);
}
}
case S00PacketKeepAlive keepAlive -> {
if (active) {
if(mc.thePlayer.ticksExisted % 3 ==0){
// ChatUtil.display("added");
packets.add(keepAlive);
}else{
// ChatUtil.display("lost");
}
event.setCancelled();
}
}
default -> {
}
}
};
@EventLink
public final Listener<PreMotionEvent> onPreMotionEvent = event -> {
List<EntityLivingBase> targets = TargetComponent.getTargets(7);
if (targets.isEmpty()) return;
if(active && mc.thePlayer.onGround || receiving){
double cancelX = -this.velX;
double cancelZ = -this.velZ;
// ChatUtil.display("s");
mc.thePlayer.motionX = cancelX;
mc.thePlayer.motionZ = cancelZ;
// event.setPosY(event.getPosY() - 1);
} else if(mc.thePlayer.onGround && mc.thePlayer.hurtTime > 7){
double cancelX = -this.velX;
double cancelZ = -this.velZ;
// cancelX = Math.max(-1D, Math.min(1D, cancelX));
// cancelZ = Math.max(-1D, Math.min(1D, cancelZ));
// ChatUtil.display("s");
mc.thePlayer.motionX *= cancelX;
mc.thePlayer.motionZ *= cancelZ;
mc.thePlayer.jump();
}
};
@EventLink
public final Listener<StrafeEvent> onStrafe = event -> {
if (active) {
// Get the player's current yaw
float playerYaw = mc.thePlayer.rotationYaw % 360F;
if (playerYaw < -180F) playerYaw += 360F;
if (playerYaw > 180F) playerYaw -= 360F;
// Calculate the difference between the player's yaw and desiredYaw
float yawDifference = Math.abs(playerYaw - desiredYaw);
// Define the leeway in degrees (e.g., 10 degrees)
float leeway = 20F;
// Check if the yaw difference is within the leeway
if (yawDifference <= leeway || yawDifference >= (360F - leeway)) {
// Process the packets to give a boost
receiving = true;
active = false;
ChatUtil.display("boost");
packets.forEach(PacketUtil::receive);
packets.clear();
receiving = false;
offGroundTicks = 0;
} else if(mc.thePlayer.onGround ) {
// ChatUtil.display("jump reset");
if(!mc.thePlayer.isJumping){
// mc.thePlayer.jump();
// ChatUtil.display("jump reset 2");
}
mc.thePlayer.motionX *= -1D;
mc.thePlayer.motionZ *= -1D;
// If offGroundTicks exceed 11, release the packets when back on the ground
receiving = true;
active = false;
packets.forEach(PacketUtil::receive);
packets.clear();
receiving = false;
} else if (mc.thePlayer.offGroundTicks>12){
receiving = true;
active = false;
packets.forEach(PacketUtil::receive);
packets.clear();
mc.thePlayer.jump();
mc.thePlayer.motionX *= 0.6D;
mc.thePlayer.motionZ *= 0.6D;
receiving = false;
}
}
};
}
// NOTE (AI): The keepalive case runs only while the velocity spoof is armed: WatchdogPredictionVelocity buffers the packet on every third tick and cancels it otherwise, so the server's timing probe stays quiet during the spoof window. The buffered keepalive and transactions are replayed through PacketUtil.receive on the strafe trigger, which restores the S00/C00 and C0F sequencing the server expects. The cancelled keepalive means the vanilla echo never fires, so the server's ping EMA freezes for the duration of the spoof.Freeze the server's ping measurement by cancelling C00 echoes and re-sending a stale captured key on a fixed 1500ms cadence.
The EventPacket receive handler intercepts S00PacketKeepAlive, stores func_149134_c() as lastKey, and arms the erisium flag. In EventUpdate, when erisium is set and the timer hits 1500ms, the module sends C00PacketKeepAlive(lastKey) via sendPacketNoEvent. The send-side branch cancels real C00 echoes in Faithful, Erisium, SagePvP and ColdNetwork modes.
// ===== FILE: Sigma 4.11, info/sigmaclient/module/impl/other/Disabler.java =====
package info.sigmaclient.module.impl.other;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import info.sigmaclient.Client;
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.management.notifications.Notifications;
import info.sigmaclient.module.Module;
import info.sigmaclient.module.data.ModuleData;
import info.sigmaclient.module.data.Options;
import info.sigmaclient.module.data.Setting;
import info.sigmaclient.module.impl.movement.Phase;
import info.sigmaclient.util.Timer;
import info.sigmaclient.util.misc.ChatUtil;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBook;
import net.minecraft.item.ItemStack;
import net.minecraft.network.Packet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.network.play.client.C00PacketKeepAlive;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.client.C0APacketAnimation;
import net.minecraft.network.play.client.C0FPacketConfirmTransaction;
import net.minecraft.network.play.client.C17PacketCustomPayload;
import net.minecraft.network.play.server.S00PacketKeepAlive;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
public class Disabler extends Module {
String MODE = "MODE";
boolean faithful = false, watchdog = false, erisium = false;
Timer timer = new Timer();
int lastKey;
String mode;
public Disabler(ModuleData data) {
super(data);
settings.put(MODE, new Setting<>(MODE, new Options("Mode", "Hypixel", new String[]{"Hypixel", "Faithful", "Erisium", "SagePvP", "ColdNetwork"}), "Disabler method."));
}
@Override
public void onEnable() {
if (mc.theWorld == null)
return;
erisium = false;
timer.reset();
mode = ((Options) settings.get(MODE).getValue()).getSelected();
if (mode.equalsIgnoreCase("ViperMC")) {
if (!MoveUtils.isOnGround(0.0001)) {
this.toggle();
Notifications.getManager().post("Disabler", "Try again on ground !", Notifications.Type.WARNING);
}
}
if (mode.equalsIgnoreCase("Hypixel")) {
if (MoveUtils.isOnGround(0.001) && mc.thePlayer.isCollidedVertically) {
double x = mc.thePlayer.posX;
double y = mc.thePlayer.posY;
double z = mc.thePlayer.posZ;
mc.thePlayer.sendQueue.getNetworkManager().sendPacketNoEvent(new C03PacketPlayer.C04PacketPlayerPosition(x, y + 0.16, z, true));
mc.thePlayer.sendQueue.getNetworkManager().sendPacketNoEvent(new C03PacketPlayer.C04PacketPlayerPosition(x, y + 0.07, z, true));
watchdog = true;
Notifications.getManager().post("Disabler", "Wait 5s.", Notifications.Type.INFO);
} else {
watchdog = false;
}
} else if (mode.equalsIgnoreCase("Faithful")) {
Notifications.getManager().post("Disabler", "Relog to disable Area 51.", Notifications.Type.INFO);
}
}
@Override
@RegisterEvent(events = {EventUpdate.class, EventPacket.class})
public void onEvent(Event event) {
if (mode == null) {
mode = ((Options) settings.get(MODE).getValue()).getSelected();
}
if (!mode.equalsIgnoreCase(((Options) settings.get(MODE).getValue()).getSelected())) {
mode = ((Options) settings.get(MODE).getValue()).getSelected();
if (mode.equalsIgnoreCase("Faithful")) {
Notifications.getManager().post("Disabler", "Relog to disable Area 51.", Notifications.Type.INFO);
}
}
this.setSuffix(mode);
if (event instanceof EventUpdate) {
EventUpdate em = (EventUpdate) event;
if (em.isPre()) {
if (mc.thePlayer.ticksExisted <= 1) {
erisium = false;
}
if (mode.equalsIgnoreCase("ViperMC")) {
if (timer.delay(3000)) {
em.setY(mc.thePlayer.posY + 0.4);
return;
}
for (int i = 0; i < 10; ++i) {
boolean i2 = i > 2 && i < 8;
double x = i2 ? 0.2 : -0.2D;
C03PacketPlayer.C04PacketPlayerPosition packet = new C03PacketPlayer.C04PacketPlayerPosition(
mc.thePlayer.posX, mc.thePlayer.posY + x, mc.thePlayer.posZ, true);
mc.thePlayer.sendQueue.addToSendQueue(packet);
}
}
if (mode.equalsIgnoreCase("Hypixel"))
if (!watchdog) {
if (MoveUtils.isOnGround(0.001) && mc.thePlayer.isCollidedVertically) {
double x = mc.thePlayer.posX;
double y = mc.thePlayer.posY;
double z = mc.thePlayer.posZ;
mc.thePlayer.sendQueue.getNetworkManager().sendPacketNoEvent(new C03PacketPlayer.C04PacketPlayerPosition(x, y, z, true));
mc.thePlayer.sendQueue.getNetworkManager().sendPacketNoEvent(new C03PacketPlayer.C04PacketPlayerPosition(x, y + 0.16, z, true));
mc.thePlayer.sendQueue.getNetworkManager().sendPacketNoEvent(new C03PacketPlayer.C04PacketPlayerPosition(x, y + 0.07, z, true));
watchdog = true;
Notifications.getManager().post("Disabler", "Please wait 5s.", Notifications.Type.INFO);
}
} else {
mc.thePlayer.motionX = 0;
mc.thePlayer.motionY = 0;
mc.thePlayer.motionZ = 0;
mc.thePlayer.jumpMovementFactor = 0;
mc.thePlayer.noClip = true;
mc.thePlayer.onGround = false;
}
if (mode.equalsIgnoreCase("Erisium")) {
if (erisium && timer.delay(1500)) {
erisium = !erisium;
mc.thePlayer.sendQueue.getNetworkManager().sendPacketNoEvent(new C00PacketKeepAlive(lastKey));
}
}
}
} else if (event instanceof EventPacket) {
EventPacket ep = (EventPacket) event;
Packet p = ep.getPacket();
if (ep.isPre()) {
if (p instanceof C03PacketPlayer) {
if (mode.equalsIgnoreCase("Hypixel") && watchdog) {
ep.setCancelled(true);
}
}
if (p instanceof S08PacketPlayerPosLook) {
S08PacketPlayerPosLook pac = (S08PacketPlayerPosLook) ep.getPacket();
pac.yaw = mc.thePlayer.rotationYaw;
pac.pitch = mc.thePlayer.rotationPitch;
if (watchdog && mode.equalsIgnoreCase("Hypixel")) {
Notifications.getManager().post("Disabler", "You can do what you want for 5s !", Notifications.Type.INFO);
this.toggle();
}
}
if (p instanceof S00PacketKeepAlive) {
S00PacketKeepAlive packet = (S00PacketKeepAlive) p;
int KEY = packet.func_149134_c();
if (mode.equalsIgnoreCase("Erisium")) {
timer.reset();
erisium = true;
lastKey = KEY;
}
}
if (p instanceof C00PacketKeepAlive) {
C00PacketKeepAlive packet = (C00PacketKeepAlive) p;
if (mode.equalsIgnoreCase("Faithful") || mode.equalsIgnoreCase("Erisium") || mode.equalsIgnoreCase("SagePvP") || mode.equalsIgnoreCase("ColdNetwork")) {
ep.setCancelled(true);
}
}
if (p instanceof C0FPacketConfirmTransaction) {
C0FPacketConfirmTransaction packet = (C0FPacketConfirmTransaction) p;
int id = packet.getId();
boolean accepted = packet.isAccepted();
int uid = packet.getUid();
if (id == 0 && accepted)
if (mode.equalsIgnoreCase("SagePvP") || mode.equalsIgnoreCase("ColdNetwork")) {
ep.setCancelled(true);
}
}
}
}
}
}
// NOTE (AI): The S00PacketKeepAlive branch is the capture half of Erisium mode: it stores the key and arms the replay timer. The replay half lives in the EventUpdate handler, which every 1500ms pushes C00PacketKeepAlive(lastKey) through sendPacketNoEvent, bypassing the event bus. Because the send-side branch cancels the real echo, the server's key comparison keeps failing and the ping EMA never updates, freezing the tab-list ping instead of letting it grow.Expose S00PacketKeepAlive to the JavaScript scripting API so user scripts can hook its receive event.
A static Class array named clientbound lists S00PacketKeepAlive.class alongside every other play-state server packet; the script engine maps the registered classes to receive events for script handlers. The corresponding serverbound array lists C00PacketKeepAlive.class for the send side.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/script/api/NetworkAPI.java =====
package com.alan.clients.script.api;
import com.alan.clients.util.chat.ChatUtil;
import lombok.SneakyThrows;
import net.minecraft.network.EnumPacketDirection;
import net.minecraft.network.Packet;
import net.minecraft.network.play.INetHandlerPlayClient;
import net.minecraft.network.play.INetHandlerPlayServer;
import net.minecraft.network.play.client.*;
import net.minecraft.network.play.server.*;
import javax.script.ScriptException;
import java.util.Arrays;
public class NetworkAPI extends API {
public final static Class<Packet<INetHandlerPlayServer>>[] serverbound = new Class[]{
C00PacketKeepAlive.class,
C01PacketChatMessage.class,
C02PacketUseEntity.class,
C03PacketPlayer.class,
C03PacketPlayer.C04PacketPlayerPosition.class,
C03PacketPlayer.C05PacketPlayerLook.class,
C03PacketPlayer.C06PacketPlayerPosLook.class,
C07PacketPlayerDigging.class,
C08PacketPlayerBlockPlacement.class,
C09PacketHeldItemChange.class,
C0APacketAnimation.class,
C0BPacketEntityAction.class,
C0CPacketInput.class,
C0DPacketCloseWindow.class,
C0EPacketClickWindow.class,
C0FPacketConfirmTransaction.class,
C10PacketCreativeInventoryAction.class,
C11PacketEnchantItem.class,
C12PacketUpdateSign.class,
C13PacketPlayerAbilities.class,
C14PacketTabComplete.class,
C15PacketClientSettings.class,
C16PacketClientStatus.class,
C17PacketCustomPayload.class,
C18PacketSpectate.class,
C19PacketResourcePackStatus.class,
};
public final static Class<Packet<INetHandlerPlayClient>>[] clientbound = new Class[]{
S00PacketKeepAlive.class,
S01PacketJoinGame.class,
S02PacketChat.class,
S03PacketTimeUpdate.class,
S04PacketEntityEquipment.class,
S05PacketSpawnPosition.class,
S06PacketUpdateHealth.class,
S07PacketRespawn.class,
S08PacketPlayerPosLook.class,
S09PacketHeldItemChange.class,
S0APacketUseBed.class,
S0BPacketAnimation.class,
S0CPacketSpawnPlayer.class,
S0DPacketCollectItem.class,
S0EPacketSpawnObject.class,
S0FPacketSpawnMob.class,
S10PacketSpawnPainting.class,
S11PacketSpawnExperienceOrb.class,
S12PacketEntityVelocity.class,
S13PacketDestroyEntities.class,
S14PacketEntity.class,
S18PacketEntityTeleport.class,
S19PacketEntityHeadLook.class,
S19PacketEntityStatus.class,
S1BPacketEntityAttach.class,
S1CPacketEntityMetadata.class,
S1DPacketEntityEffect.class,
S1EPacketRemoveEntityEffect.class,
S1FPacketSetExperience.class,
S20PacketEntityProperties.class,
S21PacketChunkData.class,
S22PacketMultiBlockChange.class,
S23PacketBlockChange.class,
S24PacketBlockAction.class,
S25PacketBlockBreakAnim.class,
S26PacketMapChunkBulk.class,
S27PacketExplosion.class,
S28PacketEffect.class,
S29PacketSoundEffect.class,
S2APacketParticles.class,
S2BPacketChangeGameState.class,
S2CPacketSpawnGlobalEntity.class,
S2DPacketOpenWindow.class,
S2EPacketCloseWindow.class,
S2FPacketSetSlot.class,
S30PacketWindowItems.class,
S31PacketWindowProperty.class,
S32PacketConfirmTransaction.class,
S33PacketUpdateSign.class,
S34PacketMaps.class,
S35PacketUpdateTileEntity.class,
S36PacketSignEditorOpen.class,
S37PacketStatistics.class,
S38PacketPlayerListItem.class,
S39PacketPlayerAbilities.class,
S3APacketTabComplete.class,
S3BPacketScoreboardObjective.class,
S3CPacketUpdateScore.class,
S3DPacketDisplayScoreboard.class,
S3EPacketTeams.class,
S3FPacketCustomPayload.class,
S40PacketDisconnect.class,
S41PacketServerDifficulty.class,
S42PacketCombatEvent.class,
S43PacketCamera.class,
S44PacketWorldBorder.class,
S45PacketTitle.class,
S46PacketSetCompressionLevel.class,
S47PacketPlayerListHeaderFooter.class,
S48PacketResourcePackSend.class,
S49PacketUpdateEntityNBT.class
};
@SneakyThrows
private static Packet<?> instantiatePacket(final EnumPacketDirection direction, final int id, final Object... params) {
Packet<?> packet = null;
try {
if (direction == EnumPacketDirection.CLIENTBOUND) {
packet = (Packet<?>) Arrays.stream(clientbound[id].getConstructors()).filter(x -> x.getParameterCount() == params.length).findFirst().get().newInstance(params);
} else if (direction == EnumPacketDirection.SERVERBOUND) {
packet = (Packet<?>) Arrays.stream(serverbound[id].getConstructors()).filter(x -> x.getParameterCount() == params.length).findFirst().get().newInstance(params);
}
} catch (Exception ex) {
ChatUtil.display("Failed to instantiate packet!");
throw new ScriptException(ex);
}
return packet;
}
public void sendPacket(final int id, final Object... params) {
final Packet<?> packet = instantiatePacket(EnumPacketDirection.SERVERBOUND, id, params);
MC.getNetHandler().addToSendQueue(packet);
}
public void receivePacket(final int id, final Object... params) {
final Packet<?> packet = instantiatePacket(EnumPacketDirection.CLIENTBOUND, id, params);
MC.getNetHandler().addToReceiveQueue(packet);
}
public boolean isSingleplayer() {
return MC.isSingleplayer();
}
public boolean isMultiplayer() {
return !MC.isSingleplayer() && MC.getCurrentServerData() != null;
}
public String getServerIP() {
return MC.getCurrentServerData() != null
? MC.getCurrentServerData().serverIP
: null;
}
public String getServerName() {
return MC.getCurrentServerData() != null
? MC.getCurrentServerData().serverName
: null;
}
public String getServerMOTD() {
return MC.getCurrentServerData() != null
? MC.getCurrentServerData().serverMOTD
: null;
}
}
// NOTE (AI): This is the script bridge, not a gameplay module: S00PacketKeepAlive.class sits in the static clientbound registry that the engine uses to route receive events to JavaScript handlers. Scripts can therefore observe keepalive timing without touching Java, which makes it the scripting counterpart of the Debugger module. The registry spans the full play-state packet table, and the keepalive entry is what lets script-based ping spoofers exist in Rise 6.x.anticheat Anti-Cheat Checks
S00 is the server's keep-alive probe: the client must echo the id back in C00. Anticheats use the round trip as their latency clock: the server records when it sent each id and when the matching reply arrives, which yields the player's ping and exposes ping-spoof, timer and connection-manipulation cheats. The corpus shows the same echo-tracking pattern at every scale, from the four-line ConnectionManager in Frequency to NCP's keepalive-frequency check with kick actions and Grim's validation that the replied id was actually sent.
Flags keep-alive replies whose id was never sent by the server, the signature of a spoofed or replayed keep-alive stream.
Tracks every OUT keep-alive id in a queue. On the IN keep-alive reply, searches the queue for the id: a match removes the id (pruning the queue) and passes, while a reply with an unknown id flags and cancels the packet.
// ===== FILE: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/checks/impl/badpackets/BadPacketsO.java =====
package ac.grim.grimac.checks.impl.badpackets;
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.type.PacketReceiveListener;
import ac.grim.grimac.checks.type.PacketSendListener;
import ac.grim.grimac.player.GrimPlayer;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientKeepAlive;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerKeepAlive;
import java.util.LinkedList;
@CheckData(name = "BadPacketsO", stableKey = "grim.badpackets.invalid_keepalive", description = "Responded with a keepalive ID that was not sent by the server")
public class BadPacketsO extends Check implements PacketReceiveListener, PacketSendListener {
private static final Verbose V = Verbose.of("id={slong}");
private final LinkedList<Long> keepalives = new LinkedList<>();
public BadPacketsO(GrimPlayer player) {
super(player);
}
@Override
public void onPacketSend(PacketSendEvent event) {
if (event.getPacketType() == PacketType.Play.Server.KEEP_ALIVE) {
keepalives.add(new WrapperPlayServerKeepAlive(event).getId());
}
}
@Override
public void onPacketReceive(PacketReceiveEvent event) {
if (event.getPacketType() == PacketType.Play.Client.KEEP_ALIVE) {
final long id = new WrapperPlayClientKeepAlive(event).getId();
for (long keepalive : keepalives) {
if (keepalive == id) {
// Found the ID, remove stuff until we get to it (to stop very slow memory leaks)
Long data;
do {
data = keepalives.poll();
} while (data != null && data != id);
return;
}
}
if (flag(V.write(verbose()).slong(id)) && shouldModifyPackets()) {
event.setCancelled(true);
player.onPacketCancel();
}
}
}
}
// NOTE (AI): The queue pruning doubles as a memory guard: only ids the server actually sent are ever accepted.Limits keep-alive reply frequency and records last keep-alive timing for the god-mode and moving checks.
ProtocolLib adapter on both keep-alive directions: the receiving side always updates lastKeepAliveTime (even when the check is disabled, because fight.godmode depends on it) and runs the KeepAliveFrequency check, which cancels the reply when the frequency exceeds the configured limits; the sending side records the outgoing id so the expected-reply model stays consistent.
// ===== FILE: Updated-NoCheatPlus-NoCheatPlus, NCPCompatProtocolLib/src/main/java/fr/neatmonster/nocheatplus/checks/net/protocollib/KeepAliveAdapter.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.net.protocollib;
import java.util.Arrays;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.events.ListenerPriority;
import com.comphenix.protocol.events.PacketEvent;
import fr.neatmonster.nocheatplus.NCPAPIProvider;
import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.checks.net.KeepAliveFrequency;
import fr.neatmonster.nocheatplus.checks.net.NetConfig;
import fr.neatmonster.nocheatplus.checks.net.NetData;
import fr.neatmonster.nocheatplus.players.DataManager;
import fr.neatmonster.nocheatplus.players.IPlayerData;
/**
* Limit keep alive packet frequency, set lastKeepAliveTime (even if disabled,
* in case fight.godmode is enabled).
*
* @author asofold
*
*/
public class KeepAliveAdapter extends BaseAdapter {
/** Dummy check for bypass checking and actions execution. */
private final KeepAliveFrequency frequencyCheck = new KeepAliveFrequency();
public KeepAliveAdapter(Plugin plugin) {
super(plugin, ListenerPriority.LOW, PacketType.Play.Client.KEEP_ALIVE, PacketType.Play.Server.KEEP_ALIVE);
this.checkType = CheckType.NET_KEEPALIVEFREQUENCY;
// Add feature tags for checks.
if (NCPAPIProvider.getNoCheatPlusAPI().getWorldDataManager().isActiveAnywhere(CheckType.NET_KEEPALIVEFREQUENCY)) {
NCPAPIProvider.getNoCheatPlusAPI().addFeatureTags("checks", Arrays.asList(KeepAliveFrequency.class.getSimpleName()));
}
NCPAPIProvider.getNoCheatPlusAPI().addComponent(frequencyCheck);
}
@Override
public void onPacketReceiving(final PacketEvent event) {
try {
if (event.isPlayerTemporary()) return;
}
catch(NoSuchMethodError e) {}
final long time = System.currentTimeMillis();
final Player player = event.getPlayer();
if (player == null) {
counters.add(ProtocolLibComponent.idNullPlayer, 1);
event.setCancelled(true);
return;
}
// Always update last received time.
final IPlayerData pData = DataManager.getPlayerDataSafe(player);
if (pData == null) return;
final NetData data = pData.getGenericInstance(NetData.class);
recordKeepAlivePacketDetails(event, data, time);
data.lastKeepAliveTime = time;
final NetConfig cc = pData.getGenericInstance(NetConfig.class);
// Run check(s).
// KeepAlive model: outgoing server ids are recorded in onPacketSending; matching replies are expected.
// TODO: Better modeling of actual packet sequences (flying vs. keep alive vs. request/ping).
// TODO: Better integration with god-mode check / trigger reset ndt.
if (frequencyCheck.isEnabled(player, pData)
&& frequencyCheck.check(player, time, data, cc, pData)) {
event.setCancelled(true);
}
}
private void recordKeepAlivePacketDetails(final PacketEvent event, final NetData data, final long time) {
final KeepAlivePacketInfo info = KeepAlivePacketInfo.read(event.getPacket());
data.recordKeepAlivePacket(time, info.idAvailable, info.id, info.idType, info.longCount, info.intCount,
event.isAsync(), Thread.currentThread().getName());
}
@Override
public void onPacketSending(PacketEvent event) {
final Player player = event.getPlayer();
if (player == null) {
return;
}
final IPlayerData pData = DataManager.getPlayerDataSafe(player);
if (pData == null) {
return;
}
final KeepAlivePacketInfo info = KeepAlivePacketInfo.read(event.getPacket());
pData.getGenericInstance(NetData.class).recordOutgoingKeepAlivePacket(System.currentTimeMillis(),
info.idAvailable, info.id, info.idType, info.longCount, info.intCount,
event.isAsync(), Thread.currentThread().getName());
}
}
// NOTE (AI): NCP also shares lastKeepAliveTime with the god-mode check, so the keep-alive stream doubles as a damage-timing clock.Tracks the keep-alive round trip as the player's latency clock, feeding ping data to every other check.
On the OUT keep-alive, stores the id with a send timestamp in an expected map. On the IN reply, looks up the id, removes it and computes keepAlivePing as the receive timestamp minus the send timestamp, setting the acceptedKeepAlive flag. The ping value is displayed in the /hydro debug command and feeds the ping-based exclusions.
// ===== FILE: Incognitolol-Hydro, src/main/java/integral/studios/hydro/model/tracker/impl/KeepAliveTracker.java =====
package integral.studios.hydro.model.tracker.impl;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientKeepAlive;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerKeepAlive;
import integral.studios.hydro.model.tracker.Tracker;
import integral.studios.hydro.model.PlayerData;
import it.unimi.dsi.fastutil.longs.Long2LongArrayMap;
import it.unimi.dsi.fastutil.longs.Long2LongMap;
import lombok.Getter;
@Getter
public class KeepAliveTracker extends Tracker {
private final Long2LongMap expectedKeepAlives = new Long2LongArrayMap();
private boolean acceptedKeepAlive;
private long keepAlivePing;
public KeepAliveTracker(PlayerData playerData) {
super(playerData);
}
@Override
public void registerIncomingPreHandler(PacketReceiveEvent event) {
if (event.getPacketType() == PacketType.Play.Client.KEEP_ALIVE) {
WrapperPlayClientKeepAlive keepAlive = new WrapperPlayClientKeepAlive(event);
long key = keepAlive.getId();
long timestamp = event.getTimestamp();
if (expectedKeepAlives.containsKey(key)) {
keepAlivePing = timestamp - expectedKeepAlives.remove(key);
acceptedKeepAlive = true;
}
}
}
@Override
public void registerOutgoingPreHandler(PacketSendEvent event) {
if (event.getPacketType() == PacketType.Play.Server.KEEP_ALIVE) {
WrapperPlayServerKeepAlive serverKeepAlive = new WrapperPlayServerKeepAlive(event);
expectedKeepAlives.put(serverKeepAlive.getId(), event.getTimestamp());
}
}
}
// NOTE (AI): Hydro also ships BadPacketsE and BadPacketsF, which flag spoofed and duplicate keep-alive ids on top of this tracker.Converts keep-alive and transaction echoes into a measured ping that every check reads for latency exemptions.
TickManager sends the OUT keep-alive and stores the id with a timestamp; the incoming processor calls onKeepAlive when the reply arrives. ConnectionManager looks up the recorded send time for that id and stores the difference as keepAlivePing. PingSpoofA/B and the lag exemptions then compare this keep-alive ping against the transaction ping.
// ===== FILE: ElevatedDev-Frequency, src/main/java/xyz/elevated/frequency/data/impl/ConnectionManager.java =====
package xyz.elevated.frequency.data.impl;
import lombok.RequiredArgsConstructor;
import xyz.elevated.frequency.data.PlayerData;
import java.util.Map;
import java.util.Optional;
@RequiredArgsConstructor
public final class ConnectionManager {
private final PlayerData playerData;
public void onTransaction(final short actionNumber, final long now) {
final Optional<Long> entry = this.getTransactionTime(actionNumber);
entry.ifPresent(time -> playerData.getTransactionPing().set(now - time));
}
public void onKeepAlive(final int identification, final long now) {
final Optional<Long> entry = this.getKeepAliveTime(identification);
entry.ifPresent(time -> playerData.getKeepAlivePing().set(now - time));
}
public Optional<Long> getTransactionTime(final short actionNumber) {
final Map<Short, Long> entries = playerData.getTransactionUpdates();
if (entries.containsKey(actionNumber)) return Optional.of(entries.get(actionNumber));
return Optional.empty();
}
public Optional<Long> getKeepAliveTime(final int identification) {
final Map<Integer, Long> entries = playerData.getKeepAliveUpdates();
if (entries.containsKey(identification)) return Optional.of(entries.get(identification));
return Optional.empty();
}
}
// NOTE (AI): The same manager serves the transaction stream, which is how Frequency detects ping spoofing as a keep-alive-versus-transaction divergence.Related Packets
Wiki Cross-Reference
The server kicks the client if it does not respond to a keep-alive within 15 seconds, and the client disconnects with a timeout if the server sends none for 20 seconds.
The vanilla server generates the keep-alive ID from a system-dependent time in milliseconds.
MCP 1.8.9 S00PacketKeepAlive implements Packet
1.8.9 callers: NetHandlerPlayServer.update sends new S00PacketKeepAlive (line 152): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/network/NetHandlerPlayServer.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.