0x14 S14PacketEntity
Base class for entity relative movement and rotation updates. Subclasses S15 (rel move), S16 (look), S17 (move+look).
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| entityId | VarInt | Entity ID |
| dx/dy/dz | byte | Relative movement delta × 32 (S15/S17) |
| yaw/pitch | byte | New rotation × 256/360 (S16/S17) |
| onGround | boolean | Ground state |
Subclasses
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Entity ID | VarInt | |
| DX | byte | dx * 32 |
| DY | byte | dy * 32 |
| DZ | byte | dz * 32 |
| Yaw | byte | yaw * 256/360 |
| Pitch | byte | pitch * 256/360 |
| On Ground | bool |
MCP References
NetHandlerPlayClient.handleEntityMovement()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 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
| 162 | |
| 163 | |
| 164 | |
| 165 | |
| 166 | |
| 167 | |
| 168 | |
| 169 | |
| 170 | |
| 171 | |
| 172 | |
| 173 | |
| 174 | |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | |
| 182 | |
| 183 | |
| 184 | |
| 185 | |
| 186 | |
| 187 | |
| 188 | |
| 189 | |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | |
| 195 | |
| 196 | |
| 197 | |
| 198 | |
| 199 | |
| 200 | |
| 201 | |
| 202 | |
| 203 | |
| 204 | |
| 205 | |
| 206 | |
| 207 | |
Deobfuscated MCP 1.8.9 source of S14PacketEntity, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S14PacketEntity.java) at build time and verified present.
Deep Dive
Role in the protocol
S14PacketEntity is the abstract base for the three relative entity-movement packets. The wire IDs are S15PacketEntityRelMove (0x15), S16PacketEntityLook (0x16) and S17PacketEntityLookMove (0x17); the base class itself is never registered as a sendable ID and EnumConnectionState registers only the subclasses. Every variant carries a VarInt entityId and an onGround flag, plus byte deltas (x 32) and/or rotation bytes (x 256/360). The client accumulates the deltas onto the entity's last server position, so a position error in one tick carries into every later tick until the server sends an absolute S18.
Vanilla handling
NetHandlerPlayClient.handleEntityMovement (Memeware 7.3 bundle, line 551) is shared by all three subclasses: it adds the packet's posX/posY/posZ to entity.serverPosX/Y/Z, recomputes the position as serverPos / 32.0, keeps the current yaw/pitch unless the packet carries rotation (S16/S17), then calls setPositionAndRotation2 with interpolation factor 3 and teleport flag false, and finally writes packetIn.onGround into entity.onGround. Server-side, EntityTrackerEntry picks the variant by motion magnitude: look-move when both position and rotation changed, rel-move when only position changed, look when only rotation changed (corpus lines 213-217, 265).
Why clients touch it
The 8-client corpus shows three consumer families, none of them ESP. Rise 6.x combat: LegitReach accumulates a server-truth realPosition from S14 deltas for its ping-spoof reach, and WatchdogVelocity buffers the S15/S16/S17 subclasses and replays them for its Watchdog Backtrack mode. Rise 6.x infrastructure: the translation component's PacketType enum maps ENTITY_REL_MOVE, ENTITY_LOOK_MOVE and ENTITY_LOOK into a per-entity position cache, and PingSpoofComponent classifies all S14 subclasses in its players tuple. Rise 5.99 anticheat: PlayerData re-derives position, deltas and onGround from S15/S17 and feeds KeepSprintA, SpeedA, EagleA and GroundSpoofA/B. Memeware, Nekoware, Sigma, Spicy and Tenacity reference the packet only through the vanilla handler. LiquidSense Dev consumes the stream for bot detection: AntiBot records per-entity ground/air/invaildGround flags from the S14 onGround bit, and its MixinNetHandlerPlayClient fires an EntityMovementEvent from handleEntityMovement for modules that react to entity movement. November Recode 2.0 has no S14 corpus hit; it processes the packet through the vanilla handler only.
Exploit surface
Relative deltas are trusted per packet and corrected only by S18, which makes the S14 stream the raw material of every position-based client-side simulation: reach modules reconstruct the opponent's true position, anticheats reconstruct it to verify onGround transitions and speed. The onGround bit is authoritative for the tick it arrives in, which is exactly what GroundSpoofA/B and EagleA test. Reach exploits work through latency: LegitReach delays all player-class packets so the server keeps a stale player position while the client attacks from a closer interpolated one. Dropping or reordering S14 packets is invisible to the server because they are clientbound state announcements with no acknowledgement.
Server-Side Handling
The server never processes S14 on receive; it is purely clientbound. The client handler accumulates: entity.serverPosX += posX (and Y/Z), position = serverPos / 32.0, rotation kept unless S16/S17 carry bytes, then setPositionAndRotation2(..., 3, false) and entity.onGround = packet onGround. Because the accumulation never resets, any dropped packet permanently shifts the entity by its delta until an S18 arrives. EntityTrackerEntry emits S15/S16/S17 at the tracking update rate (every 2 ticks for players, more often for fast entities) and switches to S18 once the one-tick displacement exceeds the 4-block threshold.
Protocol Analysis
Deltas are signed bytes x 32, so a single packet moves an entity at most 3.97 blocks per axis; rotation bytes decode as yaw * 360 / 256. The onGround flag is present on the base class and therefore on all three subclasses. S16 (look) and S17 (look-move) are the only places the body yaw/pitch of a tracked entity changes; S19PacketEntityHeadLook separately updates only the head yaw. There is no ordering guarantee between S14 and S18 for the same entity; a teleport supersedes any pending deltas because it overwrites serverPosX/Y/Z.
Anti-Cheat Landscape
Client-side anticheats (Rise 5.99) and server anticheats both treat the S14 stream as ground truth for movement verification. Ground-spoof detection keys on the onGround flag combined with block probes; eagle detection on the sneak flag in the S1C metadata stream timed against S14 ticks; keepsprint on the speed delta around S0B animations. For cheat clients, the S14 stream is what makes ping-spoof reach and backtrack possible: buffering it has zero server cost, and the server cannot distinguish a delayed entity stream from lag. The trade-off is visual, not statistical: held entity packets produce stutter and frozen-head artifacts that staff can spot.
implementation Implementation Cases
The relative movement family (S15/S16/S17 under the S14 base) is the highest-frequency entity state in the play state. In the 8 clients it feeds three things: Rise 6.x reach and backtrack modules that rebuild a server-truth position, Rise 6.x packet-classification components, and the Rise 5.99 built-in anticheat that replays server-side style checks against the reconstructed position stream. LiquidSense Dev's AntiBot reads the same stream to classify bots by onGround transitions.
Extend effective attack range by ping-spoofing the server's view of the player while the opponent's real position is tracked from the S14/S18 stream.
On PostMotionEvent it picks the nearest target (TargetComponent.getTargets(9)). realPosition is seeded from the entity's client position and then maintained on PacketReceiveEvent: S14 deltas are added via getPosX() / 32D, S18 snaps it to absolute coordinates. When realDistance exceeds clientDistance and lands inside 2.3-5.9 blocks, it calls PingSpoofComponent.spoof(maxPingSpoof, true, true, true, true) so all incoming player-class packets are parked for up to the configured milliseconds; otherwise it disables and dispatches the component. Render3DEvent draws the real-location bounding box with eased animation.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/module/impl/combat/LegitReach.java =====
package com.alan.clients.module.impl.combat;
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.PostMotionEvent;
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
import com.alan.clients.event.impl.render.Render3DEvent;
import com.alan.clients.module.Module;
import com.alan.clients.module.api.Category;
import com.alan.clients.module.api.ModuleInfo;
import com.alan.clients.util.animation.Animation;
import com.alan.clients.util.animation.Easing;
import com.alan.clients.util.render.ColorUtil;
import com.alan.clients.util.render.RenderUtil;
import com.alan.clients.value.impl.BooleanValue;
import com.alan.clients.value.impl.NumberValue;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S14PacketEntity;
import net.minecraft.network.play.server.S18PacketEntityTeleport;
import net.minecraft.util.Vec3;
import org.lwjgl.opengl.GL11;
import java.util.List;
@ModuleInfo(aliases = {"module.combat.legitreach.name", "Back Track"}, description = "module.combat.legitreach.description", category = Category.COMBAT)
public final class LegitReach extends Module {
public NumberValue maxPingSpoof = new NumberValue("Max Ping Spoof", this, 1000, 50, 10000, 1);
public BooleanValue render = new BooleanValue("Render Real Location", this, true);
private Vec3 realPosition = new Vec3(0, 0, 0);
private final Animation animatedX = new Animation(Easing.LINEAR, 50);
private final Animation animatedY = new Animation(Easing.LINEAR, 50);
private final Animation animatedZ = new Animation(Easing.LINEAR, 50);
public Entity targetEntity;
public boolean isActive;
@EventLink()
public final Listener<PostMotionEvent> onPost = event -> {
// Getting targets and selecting the nearest one
List<EntityLivingBase> targets = TargetComponent.getTargets(9);
if (targets.isEmpty()) {
isActive = true;
targetEntity = null;
return;
}
Entity entity = targets.get(0);
if (entity != targetEntity) {
targetEntity = entity;
realPosition.xCoord = entity.posX;
realPosition.yCoord = entity.posY;
realPosition.zCoord = entity.posZ;
}
if (targetEntity == null || !(mc.thePlayer.isSwingInProgress || getModule(KillAura.class).isEnabled())) {
return;
}
double realDistance = realPosition.distanceTo(mc.thePlayer);
double clientDistance = targetEntity.getDistanceToEntity(mc.thePlayer);
boolean on = realDistance > clientDistance && realDistance > 2.3 && realDistance < 5.9;
if (on) {
PingSpoofComponent.spoof(maxPingSpoof.getValue().intValue(), true, true, true, true);
} else {
PingSpoofComponent.disable();
PingSpoofComponent.dispatch();
}
};
@EventLink()
public final Listener<PacketReceiveEvent> onPacketReceiveEvent = event -> {
final Packet<?> packet = event.getPacket();
if (targetEntity == null) {
return;
}
if (packet instanceof S14PacketEntity) {
S14PacketEntity s14PacketEntity = ((S14PacketEntity) packet);
if (s14PacketEntity.entityId == targetEntity.getEntityId()) {
realPosition.xCoord += s14PacketEntity.getPosX() / 32D;
realPosition.yCoord += s14PacketEntity.getPosY() / 32D;
realPosition.zCoord += s14PacketEntity.getPosZ() / 32D;
}
} else if (packet instanceof S18PacketEntityTeleport) {
S18PacketEntityTeleport s18PacketEntityTeleport = ((S18PacketEntityTeleport) packet);
if (s18PacketEntityTeleport.getEntityId() == targetEntity.getEntityId()) {
realPosition = new Vec3(s18PacketEntityTeleport.getX() / 32D, s18PacketEntityTeleport.getY() / 32D, s18PacketEntityTeleport.getZ() / 32D);
}
}
};
@EventLink()
public final Listener<Render3DEvent> onRender3D = event -> {
if (targetEntity == null || !render.getValue()) {
return;
}
animatedX.setDuration(150);
animatedY.setDuration(150);
animatedZ.setDuration(150);
animatedX.run(realPosition.xCoord);
animatedY.run(realPosition.yCoord);
animatedZ.run(realPosition.zCoord);
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
GlStateManager.enableBlend();
GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
GL11.glDepthMask(false);
double expand = 0.14;
RenderUtil.color(ColorUtil.withAlpha(getTheme().getFirstColor(), 50));
RenderUtil.drawBoundingBox(mc.thePlayer.getEntityBoundingBox().offset(-mc.thePlayer.posX, -mc.thePlayer.posY, -mc.thePlayer.posZ).
offset(animatedX.getValue(), animatedY.getValue(), animatedZ.getValue()).expand(expand, expand, expand));
GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
GlStateManager.disableBlend();
GL11.glDepthMask(true);
GlStateManager.popAttrib();
GlStateManager.popMatrix();
GlStateManager.resetColor();
};
}
// NOTE (AI): realPosition is the server-truth position of the target, rebuilt from S14 deltas and S18
// NOTE (AI): absolutes while the renderer entity interpolates normally. The reach window opens when the
// NOTE (AI): real distance exceeds the client distance inside 2.3-5.9 blocks; PingSpoofComponent.spoof
// NOTE (AI): then delays all incoming player-class packets for up to maxPingSpoof ms, which keeps the
// NOTE (AI): server-side player position stale while the client hits from the closer interpolated spot.
Velocity cancel combined with an entity backtrack: the S14 subclasses are held and replayed to keep the client and server entity timelines deliberately divergent.
On PacketReceiveEvent, S12 velocity for self is cancelled (with a stacking option), C0F/C00 are held while active, and with Watchdog Backtrack enabled the three S14 subclasses plus S19PacketEntityHeadLook and S18PacketEntityTeleport are cancelled and queued. The queue is replayed through PacketUtil.receive after 100-250 ms, when the distance to the tracked realPosition crosses the 4.5/2.5 thresholds, when the player takes damage (hurtTime == 9), or during the first 100 ticks of a world. realPosition is accumulated from S14 and re-anchored by S18.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/module/impl/combat/velocity/WatchdogVelocity.java =====
package com.alan.clients.module.impl.combat.velocity;
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.Priorities;
import com.alan.clients.event.annotations.EventLink;
import com.alan.clients.event.impl.motion.*;
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
import com.alan.clients.event.impl.packet.PacketSendEvent;
import com.alan.clients.event.impl.render.Render3DEvent;
import com.alan.clients.module.impl.combat.Criticals;
import com.alan.clients.module.impl.combat.KillAura;
import com.alan.clients.module.impl.combat.Velocity;
import com.alan.clients.module.impl.movement.Flight;
import com.alan.clients.module.impl.movement.LongJump;
import com.alan.clients.module.impl.movement.Speed;
import com.alan.clients.module.impl.player.Scaffold;
import com.alan.clients.module.impl.render.chat.Chat;
import com.alan.clients.util.chat.ChatUtil;
import com.alan.clients.util.packet.PacketUtil;
import com.alan.clients.util.player.MoveUtil;
import com.alan.clients.util.player.PlayerUtil;
import com.alan.clients.util.render.ColorUtil;
import com.alan.clients.util.render.RenderUtil;
import com.alan.clients.util.vector.Vector2d;
import com.alan.clients.value.Mode;
import com.alan.clients.value.impl.BooleanValue;
import com.alan.clients.value.impl.NumberValue;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.Blocks;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C0BPacketEntityAction;
import net.minecraft.network.play.server.*;
import net.minecraft.util.Vec3;
import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.concurrent.ConcurrentLinkedQueue;
public final class WatchdogVelocity extends Mode<Velocity> {
public WatchdogVelocity(String name, Velocity parent) {
super(name, parent);
}
private long active2StartTime = -1; // Tracks when active2 was set to true
boolean active2 = false;
boolean send = false;
public final BooleanValue stack = new BooleanValue("Stack", this, true);
public final BooleanValue spoof = new BooleanValue("Ping Spoof", this, true);
public final BooleanValue spoof2 = new BooleanValue("Watchdog Backtrack", this, false);
public final BooleanValue boost = new BooleanValue("Damage Boost (not for hypixel)", this, false);
private final NumberValue speed = new NumberValue("Damage Boost Speed", this, 1, 1, 10, .01);
private boolean active, receiving, buffer;
private Vec3 realPosition = new Vec3(0, 0, 0);
public Entity targetEntity;
private int amount;
private final ArrayList<Packet<?>> packets = new ArrayList<>();
private boolean isSpoof2Packet(Packet<?> packet) {
return packet instanceof S14PacketEntity.S16PacketEntityLook ||
packet instanceof S14PacketEntity.S15PacketEntityRelMove ||
packet instanceof S14PacketEntity.S17PacketEntityLookMove ||
packet instanceof S19PacketEntityHeadLook ||
packet instanceof S18PacketEntityTeleport;
}
@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 (stack.getValue() && amount < 1 && (!mc.thePlayer.onGround) && Math.random() < 0.73 && !(mc.thePlayer.offGroundTicks > 13) || mc.thePlayer.inWater || (getModule(Scaffold.class).isEnabled() )) {
amount++;
buffer = true;
// ChatUtil.display("stack");
event.setCancelled();
buffer = false;
}
if (!event.isCancelled() && (!getModule(Scaffold.class).isEnabled() ) && !(mc.thePlayer.offGroundTicks > 11) && ((!mc.thePlayer.onGround ) || (mc.thePlayer.onGround && !MoveUtil.isMoving())) && !(velocity.getMotionY()/800D < .08 && !(getModule(Speed.class).isEnabled() || mc.thePlayer.inWater || !mc.thePlayer.isInLava()) )) {
amount = 0;
active = true;
// ChatUtil.display("Set Active");
packets.add(velocity);
event.setCancelled();
} else if (!event.isCancelled() ) {
if((!getModule(Scaffold.class).isEnabled() )){
mc.thePlayer.motionY = velocity.getMotionY() / 8000.0D;
}
// ChatUtil.display("normal");
event.setCancelled();
}
}
}
case S32PacketConfirmTransaction transaction -> {
if (active && spoof.getValue()) {
packets.add(transaction);
event.setCancelled();
// PingSpoofComponent.spoof(50, true, false, false, false, false, false);
}
}
case S00PacketKeepAlive keepAlive -> {
if (active && spoof.getValue()) {
// packets.add(keepAlive);
event.setCancelled();
}
}
case S14PacketEntity.S16PacketEntityLook s16PacketEntityLook -> {
if ((active2 || active) && spoof2.getValue() && !send) {
packets.add(s16PacketEntityLook);
event.setCancelled();
}
}
case S14PacketEntity.S15PacketEntityRelMove s15PacketEntityRelMove -> {
if ((active2 || active) && spoof2.getValue() && !send) {
packets.add(s15PacketEntityRelMove);
event.setCancelled();
}
}
case S14PacketEntity.S17PacketEntityLookMove s17PacketEntityLookMove -> {
if ((active2 || active) && spoof2.getValue() && !send) {
packets.add(s17PacketEntityLookMove);
event.setCancelled();
}
}
case S19PacketEntityHeadLook s19PacketEntityHeadLook -> {
if ((active2 || active) && spoof2.getValue() && !send) {
packets.add(s19PacketEntityHeadLook);
event.setCancelled();
}
}
default -> {
}
}
List<EntityLivingBase> targets = TargetComponent.getTargets(12);
targets.sort(Comparator.comparingDouble(entity -> entity.hurtTime));
if (targets.isEmpty()) {
targetEntity = null;
// Add logic here to reset or flush your spoof2 states.
// For example:
if (spoof2.getValue()) {
receiving = true;
packets.stream().filter(this::isSpoof2Packet).forEach(PacketUtil::receive);
packets.clear();
receiving = false;
active2 = false;
send = false;
}
return;
}
Entity entity = targets.get(0);
if (spoof2.getValue()) {
if (entity != targetEntity) {
targetEntity = entity;
realPosition.xCoord = entity.posX;
realPosition.yCoord = entity.posY;
realPosition.zCoord = entity.posZ;
}
Vec3 playerEyesPos = mc.thePlayer.getPositionEyes(1.0F);
Vec3 targetEyesPos = new Vec3(realPosition.xCoord, realPosition.yCoord, realPosition.zCoord);
double distance = playerEyesPos.distanceTo(targetEyesPos);
if ((distance > 4.5) && active || mc.thePlayer.offGroundTicks>9 && active) {
send = true;
} else if(active){
send = false;
}
//ChatUtil.display(distance);
active2 = distance < 4.5;
if( mc.thePlayer.isSwingInProgress && distance>3.1&& distance<4.5 && getModule(KillAura.class).isEnabled()){
// ChatUtil.display("reach:" + distance);
}
if (active2) {
// Check if this is the first frame where active2 is true
if (active2StartTime == -1) {
active2StartTime = System.currentTimeMillis(); // Record the starting time
}
// Check if 200ms has passed
if (System.currentTimeMillis() - active2StartTime >= Math.round((Math.random()*150))+100) {
receiving = true;
packets.stream()
.filter(this::isSpoof2Packet)
.forEach(PacketUtil::receive);
packets.clear();
receiving = false;
// ChatUtil.display(mc.thePlayer.ticksExisted);
// Reset active2 and timer
active2 = false;
active2StartTime = -1;
}
} else {
// Reset the timer if active2 is false
active2StartTime = -1;
}
if (send && active) {
// ChatUtil.display(send);
active2 = false; // If active2 is set to false, reset the timer
receiving = true;
packets.stream()
.filter(this::isSpoof2Packet)
.forEach(PacketUtil::receive);
packets.clear();
receiving = false;
}
if(mc.thePlayer.ticksExisted<100){
active2 = false; // If active2 is set to false, reset the timer
receiving = true;
packets.stream()
.filter(this::isSpoof2Packet)
.forEach(PacketUtil::receive);
packets.clear();
receiving = false;
}
if (mc.thePlayer.hurtTime == 9) {
// ChatUtil.display(send);
active2 = false;
receiving = true;
packets.stream()
.filter(this::isSpoof2Packet)
.forEach(PacketUtil::receive);
packets.clear();
receiving = false;
}
if ((distance < 2.5)) {
active2 = false;
// ChatUtil.display(send);
receiving = true;
packets.stream()
.filter(this::isSpoof2Packet)
.forEach(PacketUtil::receive);
packets.clear();
receiving = false;
}
if ((distance > 4.5)) {
active2 = false;
// ChatUtil.display(send);
receiving = true;
packets.stream()
.filter(this::isSpoof2Packet)
.forEach(PacketUtil::receive);
packets.clear();
receiving = false;
}
final Packet<?> packet = event.getPacket();
if (packet instanceof S14PacketEntity) {
S14PacketEntity s14PacketEntity = ((S14PacketEntity) packet);
if (s14PacketEntity.entityId == targetEntity.getEntityId()) {
realPosition.xCoord += s14PacketEntity.getPosX() / 32D;
realPosition.yCoord += s14PacketEntity.getPosY() / 32D;
realPosition.zCoord += s14PacketEntity.getPosZ() / 32D;
}
} else if (packet instanceof S18PacketEntityTeleport) {
S18PacketEntityTeleport s18PacketEntityTeleport = ((S18PacketEntityTeleport) packet);
if (s18PacketEntityTeleport.getEntityId() == targetEntity.getEntityId()) {
realPosition = new Vec3(s18PacketEntityTeleport.getX() / 32D, s18PacketEntityTeleport.getY() / 32D, s18PacketEntityTeleport.getZ() / 32D);
}
}
}
};
@EventLink(value = Priorities.VERY_HIGH)
public final Listener<JumpEvent> onJump = event -> {
if (mc.thePlayer.onGround && active) {
active = false;
// ChatUtil.display("Set Active");
receiving = true;
send = false;
// MoveUtil.strafe(MovdeUtil.getbaseMoveSpeed() + Math.random() / 10);
// mc.thePlayer.jump();
Vector2d motion = new Vector2d(mc.thePlayer.motionX, mc.thePlayer.motionZ);
packets.forEach(PacketUtil::receive);
// ChatUtil.display("jump");
packets.clear();
if (!boost.getValue()) {
mc.thePlayer.motionX = motion.getX();
mc.thePlayer.motionZ = motion.getY();
} else {
MoveUtil.strafe();
mc.thePlayer.motionX *= speed.getValue().doubleValue();
mc.thePlayer.motionZ *= speed.getValue().doubleValue();
}
receiving = false;
}
};
@EventLink(value = Priorities.VERY_HIGH)
public final Listener<PreUpdateEvent> onPreUpdate = event -> {
if(active2 && !active && spoof2.getValue()){
PingSpoofComponent.spoof(50, true, false, false, false, true, false);
}
};
@EventLink(value = Priorities.VERY_HIGH)
public final Listener<StrafeEvent> onStrafe = event -> {
if (mc.thePlayer.onGround && active && !mc.thePlayer.isJumping) {
active = false;
receiving = true;
send = false;
// MoveUtil.strafe(MoveUtil.WALK_SPEED);
Vector2d motion = new Vector2d(mc.thePlayer.motionX, mc.thePlayer.motionZ);
double motiony = mc.thePlayer.motionY;
// PingSpoofComponent.dispatch();
packets.forEach(PacketUtil::receive);
// ChatUtil.display("jump");
packets.clear();
mc.thePlayer.jump();
// PingSpoofComponent.dispatch();
mc.thePlayer.motionX = motion.getX();
mc.thePlayer.motionZ = motion.getY();
// active = false;
receiving = false;
// receiving = true;
// Vector2d motion = new Vector2d(mc.thePlayer.motionX, mc.thePlayer.motionZ);
// packets.forEach(PacketUtil::receive);
// ChatUtil.display("normal");
// packets.clear();
// mc.thePlayer.motionX = motion.getX();
// mc.thePlayer.motionZ = motion.getY();
// receiving = false;
}
};
@EventLink(value = Priorities.VERY_HIGH)
public final Listener<PostStrafeEvent> onPostStrafe = event -> {
if (mc.thePlayer.offGroundTicks > 12 && active) {
active = false;
receiving = true;
// MoveUtil.strafe(MoveUtil.getbaseMoveSpeed() + Math.random() / 10);
// mc.thePlayer.jump();
Vector2d motion = new Vector2d(mc.thePlayer.motionX, mc.thePlayer.motionZ);
double motiony = mc.thePlayer.motionY;
// PingSpoofComponent.dispatch();
packets.forEach(PacketUtil::receive);
// ChatUtil.display("jump");
packets.clear();
// PingSpoofComponent.dispatch();
mc.thePlayer.motionX = motion.getX();
mc.thePlayer.motionZ = motion.getY();
// mc.thePlayer.motionY = motiony;
receiving = false;
}
};
@EventLink()
public final Listener<Render3DEvent> onRender3D = event -> {
if (targetEntity == null || !spoof2.getValue() || (!active2 && !active)) {
return;
}
GlStateManager.pushMatrix();
GlStateManager.pushAttrib();
GlStateManager.enableBlend();
GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
GL11.glDepthMask(false);
double expand = -0.14;
RenderUtil.color(Color.red, 45);
RenderUtil.drawBoundingBox(mc.thePlayer.getEntityBoundingBox()
.offset(-mc.thePlayer.posX, -mc.thePlayer.posY, -mc.thePlayer.posZ)
.offset(realPosition.xCoord, realPosition.yCoord, realPosition.zCoord)
.expand(expand, -.3, expand));
GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
GlStateManager.disableBlend();
GL11.glDepthMask(true);
GlStateManager.popAttrib();
GlStateManager.popMatrix();
GlStateManager.resetColor();
};
}
// NOTE (AI): The Watchdog Backtrack path cancels the S14 subclasses plus S19PacketEntityHeadLook and
// NOTE (AI): S18PacketEntityTeleport for the nearest target and replays them through PacketUtil.receive
// NOTE (AI): after 100-250 ms or when the distance to the tracked realPosition crosses the 4.5/2.5
// NOTE (AI): thresholds. Buffering clientbound packets is invisible to the server, which is why the
// NOTE (AI): module can hold the target's movement state without raising flags.
Client-side reproductions of server anticheat checks; the S14 stream is their movement clock and position source.
PlayerData.handle converts S15/S17 deltas into per-tick position, deltas and onGround (block probes at y - 0.43 and y - 0.99). KeepSprintA times S0B arm swings against S14 ticks, samples horizontal speed into attackingSamples vs beforeAttackingSamples and fails when the attack-period average exceeds the baseline by more than 0.15 while on ground. GroundSpoofA/B and SpeedA consume the same reconstructed state. EagleA is documented under S1CPacketEntityMetadata because it needs the sneak flag from the metadata stream.
// ===== FILE: Rise 5.99, dev/rise/anticheat/check/impl/combat/keepsprint/KeepSprintA.java =====
package dev.rise.anticheat.check.impl.combat.keepsprint;
import dev.rise.anticheat.check.Check;
import dev.rise.anticheat.check.api.CheckInfo;
import dev.rise.anticheat.data.PlayerData;
import dev.rise.util.misc.EvictingList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S0BPacketAnimation;
import net.minecraft.network.play.server.S14PacketEntity;
@CheckInfo(name = "KeepSprint", type = "A", description = "Detects sprinting whilst attacking")
public final class KeepSprintA extends Check {
private final EvictingList<Double> beforeAttackingSamples = new EvictingList<>(4);
private final EvictingList<Double> attackingSamples = new EvictingList<>(4);
private int ticksSinceAttack;
private int ticksSinceSwing;
public KeepSprintA(final PlayerData data) {
super(data);
}
@Override
public void handle(final Packet<?> packet) {
if (packet instanceof S0BPacketAnimation) {
final S0BPacketAnimation wrapper = ((S0BPacketAnimation) packet);
/*
* Check if the packet incoming has the data for our player we are currently checking.
* We can do this by comparing the entity id on the packet itself and our PlayerData object.
*/
if (wrapper.getEntityID() != data.getPlayer().getEntityId()) return;
/*
* Arm animations id is 0, so we are checking if the animation
* type is 0, and then we can start running the math for it.
*/
if (wrapper.getAnimationType() == 0) {
ticksSinceSwing = 0;
}
}
if (packet instanceof S14PacketEntity) {
final S14PacketEntity wrapper = ((S14PacketEntity) packet);
if (data.getPlayer().getEntityId() != wrapper.entityId) return;
ticksSinceAttack++;
ticksSinceSwing++;
final double speed = Math.hypot(data.getDeltaX(), data.getDeltaZ());
if (ticksSinceSwing <= 2) {
for (final EntityPlayer player : mc.theWorld.playerEntities) {
if (player.hurtTime >= 7 && player != data.getPlayer() && player.getDistanceToEntity(data.getPlayer()) < 9) {
ticksSinceAttack = 0;
}
}
}
if (ticksSinceAttack <= 5) {
attackingSamples.add(speed);
} else {
beforeAttackingSamples.add(speed);
}
if (ticksSinceAttack >= 9) return;
final double average = averageSpeed(beforeAttackingSamples);
final double averageAttacking = averageSpeed(attackingSamples);
final double diff = averageAttacking - average;
if (diff > 0.15 && average > 0.24 && averageAttacking != 0 && beforeAttackingSamples.size() >= 4 && attackingSamples.size() >= 4 && data.isOnGround()) {
increaseBuffer();
if (buffer >= 15) {
fail();
}
} else {
decreaseBufferBy(1);
}
}
}
private double averageSpeed(final EvictingList<Double> list) {
double combined = 0;
for (final double speed : list) {
combined += speed;
}
return combined / list.size();
}
}
// NOTE (AI): Part of Rise 5.99's built-in anticheat, which re-derives every tracked player's position
// NOTE (AI): from the S14 relative-move stream in PlayerData.handle. KeepSprintA uses S14 as its tick
// NOTE (AI): clock: it samples horizontal speed before and after an S0B arm swing and fails when the
// NOTE (AI): post-attack average exceeds the pre-attack baseline by more than 0.15 blocks/tick.
Maintain a per-entity position cache that mirrors server state independently of the vanilla interpolation, fed by the S14 subclasses, S18, S19 and spawn packets.
An enum of packet classes with a BiFunction per entry: ENTITY_REL_MOVE adds deltas to the cached Position, ENTITY_LOOK_MOVE and ENTITY_LOOK replace yaw/pitch (returning null when no entry exists), ENTITY_TELEPORT sets the entry to absolute coordinates, DESTROY_ENTITY removes it, and ENTITY_HEAD_LOOK writes the decoded head yaw into the yaw slot. Decoding is / 32.0 for position and * 360 / 256 for angles.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/component/impl/player/translation/PacketType.java =====
package com.alan.clients.component.impl.player.translation;
import lombok.Getter;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.*;
import java.util.Map;
import java.util.function.BiFunction;
public enum PacketType {
SPAWN_MOB(S0FPacketSpawnMob.class, (packet, entityPositions) -> {
S0FPacketSpawnMob spawnMobPacket = (S0FPacketSpawnMob) packet;
int entityId = spawnMobPacket.getEntityID();
double posX = spawnMobPacket.getX() / 32.0;
double posY = spawnMobPacket.getY() / 32.0;
double posZ = spawnMobPacket.getZ() / 32.0;
float yaw = (spawnMobPacket.getYaw() * 360) / 256.0F;
float pitch = (spawnMobPacket.getPitch() * 360) / 256.0F;
Position newPosition = new Position(posX, posY, posZ, yaw, pitch);
entityPositions.put(entityId, newPosition);
return entityPositions;
}),
ENTITY_TELEPORT(S18PacketEntityTeleport.class, (packet, entityPositions) -> {
S18PacketEntityTeleport teleportPacket = (S18PacketEntityTeleport) packet;
int entityId = teleportPacket.getEntityId();
double posX = teleportPacket.getX() / 32.0;
double posY = teleportPacket.getY() / 32.0;
double posZ = teleportPacket.getZ() / 32.0;
float yaw = (teleportPacket.getYaw() * 360) / 256.0F;
float pitch = (teleportPacket.getPitch() * 360) / 256.0F;
Position newPosition = new Position(posX, posY, posZ, yaw, pitch);
entityPositions.put(entityId, newPosition);
return entityPositions;
}),
ENTITY_REL_MOVE(S14PacketEntity.S15PacketEntityRelMove.class, (packet, entityPositions) -> {
S14PacketEntity.S15PacketEntityRelMove relMovePacket = (S14PacketEntity.S15PacketEntityRelMove) packet;
int entityId = relMovePacket.entityId;
Position currentPosition = entityPositions.get(entityId);
if (currentPosition != null) {
double newPosX = currentPosition.posX + relMovePacket.getPosX() / 32.0;
double newPosY = currentPosition.posY + relMovePacket.getPosY() / 32.0;
double newPosZ = currentPosition.posZ + relMovePacket.getPosZ() / 32.0;
float yaw = currentPosition.yaw;
float pitch = currentPosition.pitch;
Position newPosition = new Position(newPosX, newPosY, newPosZ, yaw, pitch);
entityPositions.put(entityId, newPosition);
return entityPositions;
}
return null;
}),
ENTITY_LOOK_MOVE(S14PacketEntity.S17PacketEntityLookMove.class, (packet, entityPositions) -> {
S14PacketEntity.S17PacketEntityLookMove lookMovePacket = (S14PacketEntity.S17PacketEntityLookMove) packet;
int entityId = lookMovePacket.getEntityId();
double deltaX = lookMovePacket.getPosX() / 32.0;
double deltaY = lookMovePacket.getPosY() / 32.0;
double deltaZ = lookMovePacket.getPosZ() / 32.0;
float yaw = (lookMovePacket.getYaw() * 360) / 256.0F;
float pitch = (lookMovePacket.getPitch() * 360) / 256.0F;
Position currentPosition = entityPositions.get(entityId);
if (currentPosition != null) {
double newPosX = currentPosition.posX + deltaX;
double newPosY = currentPosition.posY + deltaY;
double newPosZ = currentPosition.posZ + deltaZ;
// Ensure yaw and pitch are updated
Position newPosition = new Position(newPosX, newPosY, newPosZ, yaw, pitch);
entityPositions.put(entityId, newPosition);
return entityPositions;
}
return null;
}),
ENTITY_LOOK(S14PacketEntity.S16PacketEntityLook.class, (packet, entityPositions) -> {
S14PacketEntity.S16PacketEntityLook lookPacket = (S14PacketEntity.S16PacketEntityLook) packet;
int entityId = lookPacket.getEntityId();
float yaw = (lookPacket.getYaw() * 360) / 256.0F;
float pitch = (lookPacket.getPitch() * 360) / 256.0F;
Position currentPosition = entityPositions.get(entityId);
if (currentPosition != null) {
Position newPosition = new Position(currentPosition.posX, currentPosition.posY, currentPosition.posZ, yaw, pitch);
entityPositions.put(entityId, newPosition);
return entityPositions;
}
return null;
}),
DESTROY_ENTITY(S13PacketDestroyEntities.class, (packet, entityPositions) -> {
S13PacketDestroyEntities destroyEntitiesPacket = (S13PacketDestroyEntities) packet;
int[] entityIds = destroyEntitiesPacket.getEntityIDs();
for (int entityId : entityIds) {
entityPositions.remove(entityId);
}
return entityPositions;
}),
ENTITY_HEAD_LOOK(S19PacketEntityHeadLook.class, (packet, entityPositions) -> {
S19PacketEntityHeadLook headLookPacket = (S19PacketEntityHeadLook) packet;
int entityId = headLookPacket.getEntityId();
float headYaw = (headLookPacket.getYaw() * 360) / 256.0F;
Position currentPosition = entityPositions.get(entityId);
if (currentPosition != null) {
Position newPosition = new Position(currentPosition.posX, currentPosition.posY, currentPosition.posZ, headYaw, currentPosition.pitch);
entityPositions.put(entityId, newPosition);
return entityPositions;
}
return null;
});
@Getter
private final Class<? extends Packet<?>> packetClass;
private final BiFunction<Packet<?>, Map<Integer, Position>, Map<Integer, Position>> handler;
PacketType(Class<? extends Packet<?>> packetClass, BiFunction<Packet<?>, Map<Integer, Position>, Map<Integer, Position>> handler) {
this.packetClass = packetClass;
this.handler = handler;
}
public Map<Integer, Position> handle(Packet<?> packet, Map<Integer, Position> positions) {
return handler.apply(packet, positions);
}
}
// NOTE (AI): The translation component maintains a per-entity Position cache that mirrors server state
// NOTE (AI): independently of the vanilla renderer interpolation. ENTITY_REL_MOVE accumulates deltas,
// NOTE (AI): ENTITY_LOOK_MOVE and ENTITY_LOOK update yaw/pitch only when an entry already exists, and
// NOTE (AI): ENTITY_TELEPORT replaces the entry with absolute coordinates. The look-only handlers return
// NOTE (AI): null when the entity was never spawned into the cache (S0F/S0C never seen).
Classify anti-cheat bots by their S14 movement stream: which entities ever touch ground, fly in air, or move while reporting onGround.
onPacket fires for every S14PacketEntity: if the entity is a player, record the entity id in the ground/air lists by the onGround bit, and count in invaildGround every onGround packet where prevPosY != posY (halved on air packets). isBot() consumes the lists: groundValue flags entities never seen on ground, airValue flags never-seen-in-air, invaildGroundValue flags a count >= 10, plus the usual name/tab/derp checks.
// ===== FILE: LiquidSense Dev, net/ccbluex/liquidbounce/features/module/modules/misc/AntiBot.java =====
/*
* LiquidBounce Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/CCBlueX/LiquidBounce/
*/
package net.ccbluex.liquidbounce.features.module.modules.misc;
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.Ordering;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.*;
import net.ccbluex.liquidbounce.features.module.Module;
import net.ccbluex.liquidbounce.features.module.ModuleCategory;
import net.ccbluex.liquidbounce.features.module.ModuleInfo;
import net.ccbluex.liquidbounce.utils.EntityUtils;
import net.ccbluex.liquidbounce.utils.misc.StringUtils;
import net.ccbluex.liquidbounce.utils.render.ColorUtils;
import net.ccbluex.liquidbounce.utils.timer.TimerOther;
import net.ccbluex.liquidbounce.value.BoolValue;
import net.ccbluex.liquidbounce.value.FloatValue;
import net.ccbluex.liquidbounce.value.IntegerValue;
import net.ccbluex.liquidbounce.value.ListValue;
import net.minecraft.client.Minecraft;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C01PacketChatMessage;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.network.play.server.S0BPacketAnimation;
import net.minecraft.network.play.server.S14PacketEntity;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.WorldSettings;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import tv.twitch.chat.ChatEvent;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ModuleInfo(name = "AntiBot", description = "Prevents KillAura from attacking AntiCheat bots.", category = ModuleCategory.MISC)
public class AntiBot extends Module {
public static final List<String> playerName = new ArrayList<>();
private static List<EntityPlayer> invalid = new ArrayList<>();
private static List<EntityPlayer> removed = new ArrayList<>();
private final IntegerValue livingTime = new IntegerValue("LivingTimeValue", 160, 0, 500);
private final BoolValue killer = new BoolValue("BotKiller", true);
private final BoolValue tabValue = new BoolValue("Tab", true);
private final ListValue tabModeValue = new ListValue("TabMode", new String[]{"Equals", "Contains"}, "Contains");
private final BoolValue entityIDValue = new BoolValue("EntityID", true);
private final BoolValue colorValue = new BoolValue("Color", false);
private final BoolValue livingTimeValue = new BoolValue("LivingTime", false);
private final BoolValue groundValue = new BoolValue("Ground", true);
private final BoolValue airValue = new BoolValue("Air", false);
private final BoolValue invaildGroundValue = new BoolValue("InvaildGround", true);
private final BoolValue swingValue = new BoolValue("Swing", false);
private final BoolValue healthValue = new BoolValue("Health", false);
private final BoolValue derpValue = new BoolValue("Derp", true);
private final BoolValue wasInvisibleValue = new BoolValue("WasInvisible", false);
private final BoolValue armorValue = new BoolValue("Armor", false);
private final BoolValue pingValue = new BoolValue("Ping", false);
private final BoolValue needHitValue = new BoolValue("NeedHit", false);
private final BoolValue duplicateInWorldValue = new BoolValue("DuplicateInWorld", false);
private final BoolValue duplicateInTabValue = new BoolValue("DuplicateInTab", false);
private final BoolValue hytBedwarsValue = new BoolValue("HYTBedwars", false);
private final List<Integer> ground = new ArrayList<>();
private final List<Integer> air = new ArrayList<>();
private final Map<Integer, Integer> invaildGround = new HashMap<>();
private final List<Integer> swing = new ArrayList<>();
private final List<Integer> invisible = new ArrayList<>();
private final List<Integer> hitted = new ArrayList<>();
TimerOther lastRemoved = new TimerOther();
private TimerOther timer = new TimerOther();
@Override
public void onDisable() {
mc.ingameGUI.getChatGUI().addToSentMessages("test");
clearAll();
super.onDisable();
}
@EventTarget
public void onUpdate(UpdateEvent e) {
if (killer.get()) {
if (!removed.isEmpty()) {
if (lastRemoved.delay(1000)) {
if (removed.size() == 1) {
mc.thePlayer.addChatMessage(new ChatComponentText("§b"+removed.size() + " bot has been removed"));
} else {
mc.thePlayer.addChatMessage(new ChatComponentText("§f"+removed.size() + " bots has been removed"));
}
lastRemoved.reset();
removed.clear();
}
}
}
if (!invalid.isEmpty() && timer.delay(1000)) {
invalid.clear();
timer.reset();
}
// Loop through entity list
for (Object o : mc.theWorld.getLoadedEntityList()) {
if (o instanceof EntityPlayer) {
EntityPlayer ent = (EntityPlayer) o;
//Make sure it's not the local player + they are in a worrying distance. Ignore them if they're already invalid.
if (ent != mc.thePlayer && !invalid.contains(ent)) {
String formated = ent.getDisplayName().getFormattedText();
String custom = ent.getCustomNameTag();
String name = ent.getName();
if (ent.isInvisible() && !formated.startsWith("§c") && formated.endsWith("§r") && custom.equals(name)) {
double diffX = Math.abs(ent.posX - mc.thePlayer.posX);
double diffY = Math.abs(ent.posY - mc.thePlayer.posY);
double diffZ = Math.abs(ent.posZ - mc.thePlayer.posZ);
double diffH = Math.sqrt(diffX * diffX + diffZ * diffZ);
if (diffY < 13 && diffY > 10 && diffH < 3) {
List<EntityPlayer> list = getTabPlayerList();
if (!list.contains(ent)) {
if (killer.get() != null) {
lastRemoved.reset();
removed.add(ent);
mc.theWorld.removeEntity(ent);
}
invalid.add(ent);
}
}
}
//SHOP BEDWARS
if (!formated.startsWith("§") && formated.endsWith("§r")) {
invalid.add(ent);
}
if (ent.isInvisible()) {
//BOT INVISIBLES IN GAME
if (!custom.equalsIgnoreCase("") && custom.toLowerCase().contains("§c§c") && name.contains("§c")) {
if (killer.get() != null) {
lastRemoved.reset();
removed.add(ent);
mc.theWorld.removeEntity(ent);
}
invalid.add(ent);
}
}
//WATCHDOG BOT
if (!custom.equalsIgnoreCase("") && custom.toLowerCase().contains("§c") && custom.toLowerCase().contains("§r") || custom.endsWith("§c")) {
if (killer.get() != null) {
lastRemoved.reset();
removed.add(ent);
mc.theWorld.removeEntity(ent);
}
invalid.add(ent);
}
//BOT LOBBY
if (formated.contains("§8[NPC]")) {
invalid.add(ent);
}
if (!formated.contains("§c") && !custom.equalsIgnoreCase("")) {
invalid.add(ent);
}
}
}
}
}
public static List<EntityPlayer> getTabPlayerList() {
Minecraft mc = AntiBot.mc;
NetHandlerPlayClient var4 = mc.thePlayer.sendQueue;
ArrayList list = new ArrayList();
List players = Ordering.from(new PlayerComparator()).sortedCopy((Iterable) var4.getPlayerInfoMap());
for (Object o : players) {
NetworkPlayerInfo info = (NetworkPlayerInfo) o;
if (info == null) {
continue;
}
ArrayList list2 = list;
list2.add(mc.theWorld.getPlayerEntityByName(info.getGameProfile().getName()));
}
return (List<EntityPlayer>) list;
}
@EventTarget
public void onPacket(final PacketEvent event) {
if (mc.thePlayer == null || mc.theWorld == null)
return;
final Packet<?> packet = event.getPacket();
if (packet instanceof S02PacketChat) {
if (hytBedwarsValue.get()) {
S02PacketChat chatMessage = (S02PacketChat) packet;
Matcher matcher = Pattern.compile("杀死了 (.*?)\\(").matcher(chatMessage.getChatComponent().getUnformattedText());
Matcher matcher2 = Pattern.compile("> (.*?)\\(").matcher(chatMessage.getChatComponent().getUnformattedText());
if (matcher.find()) {
String name = matcher.group(1);
if (!name.equals("")) {
if (!AntiBot.playerName.contains(name)) {
AntiBot.playerName.add(name);
// mc.thePlayer.addChatMessage(new ChatComponentText("已加入列表: " + name));
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(6000);
playerName.remove(name);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
}).start();
}
}
}
if (matcher2.find()) {
String name = matcher2.group(1);
if (!name.equals("")) {
if (!AntiBot.playerName.contains(name)) {
AntiBot.playerName.add(name);
// mc.thePlayer.addChatMessage(new ChatComponentText("已加入列表: " + name));
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(6000);
playerName.remove(name);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
}).start();
}
}
}
}
}
if (packet instanceof S14PacketEntity) {
final S14PacketEntity packetEntity = (S14PacketEntity) event.getPacket();
final Entity entity = packetEntity.getEntity(mc.theWorld);
if (entity instanceof EntityPlayer) {
if (packetEntity.getOnGround() && !ground.contains(entity.getEntityId()))
ground.add(entity.getEntityId());
if (!packetEntity.getOnGround() && !air.contains(entity.getEntityId()))
air.add(entity.getEntityId());
if (packetEntity.getOnGround()) {
if (entity.prevPosY != entity.posY)
invaildGround.put(entity.getEntityId(), invaildGround.getOrDefault(entity.getEntityId(), 0) + 1);
} else {
final int currentVL = invaildGround.getOrDefault(entity.getEntityId(), 0) / 2;
if (currentVL <= 0)
invaildGround.remove(entity.getEntityId());
else
invaildGround.put(entity.getEntityId(), currentVL);
}
if (entity.isInvisible() && !invisible.contains(entity.getEntityId()))
invisible.add(entity.getEntityId());
}
}
if (packet instanceof S0BPacketAnimation) {
final S0BPacketAnimation packetAnimation = (S0BPacketAnimation) event.getPacket();
final Entity entity = mc.theWorld.getEntityByID(packetAnimation.getEntityID());
if (entity instanceof EntityLivingBase && packetAnimation.getAnimationType() == 0 && !swing.contains(entity.getEntityId()))
swing.add(entity.getEntityId());
}
}
@EventTarget
public void onAttack(final AttackEvent e) {
final Entity entity = e.getTargetEntity();
if (entity instanceof EntityLivingBase && !hitted.contains(entity.getEntityId()))
hitted.add(entity.getEntityId());
}
@EventTarget
public void onWorld(final WorldEvent event) {
clearAll();
}
private void clearAll() {
hitted.clear();
swing.clear();
ground.clear();
invaildGround.clear();
invisible.clear();
playerName.clear();
}
public static boolean isBot(final EntityLivingBase entity) {
if (!(entity instanceof EntityPlayer))
return false;
final AntiBot antiBot = (AntiBot) LiquidBounce.moduleManager.getModule(AntiBot.class);
// mc.ingameGUI.getChatGUI().addToSentMessages("tick: " + entity.ticksExisted);
if (antiBot == null || !antiBot.getState())
return false;
if (antiBot.colorValue.get() && !entity.getDisplayName().getFormattedText()
.replace("§r", "").contains("§"))
return true;
// mc.thePlayer.addChatMessage(new ChatComponentText(entity.getName()
// + " " + playerName.contains(entity.getName())
// + " " + playerName.size()));
if (antiBot.hytBedwarsValue.get() && playerName.contains(entity.getName()))
return true;
if (antiBot.livingTimeValue.get() && entity.ticksExisted < antiBot.livingTime.get())
return true;
if (antiBot.groundValue.get() && !antiBot.ground.contains(entity.getEntityId()))
return true;
if (antiBot.airValue.get() && !antiBot.air.contains(entity.getEntityId()))
return true;
if (antiBot.swingValue.get() && !antiBot.swing.contains(entity.getEntityId()))
return true;
if (antiBot.healthValue.get() && entity.getHealth() > 20F)
return true;
if (antiBot.entityIDValue.get() && (entity.getEntityId() >= 1000000000 || entity.getEntityId() <= -1))
return true;
if (antiBot.derpValue.get() && (entity.rotationPitch > 90F || entity.rotationPitch < -90F))
return true;
if (antiBot.wasInvisibleValue.get() && antiBot.invisible.contains(entity.getEntityId()))
return true;
if (antiBot.armorValue.get()) {
final EntityPlayer player = (EntityPlayer) entity;
if (player.inventory.armorInventory[0] == null && player.inventory.armorInventory[1] == null &&
player.inventory.armorInventory[2] == null && player.inventory.armorInventory[3] == null)
return true;
}
if (antiBot.pingValue.get()) {
EntityPlayer player = (EntityPlayer) entity;
if (mc.getNetHandler().getPlayerInfo(player.getUniqueID()).getResponseTime() == 0)
return true;
}
if (antiBot.needHitValue.get() && !antiBot.hitted.contains(entity.getEntityId()))
return true;
if (antiBot.invaildGroundValue.get() && antiBot.invaildGround.getOrDefault(entity.getEntityId(), 0) >= 10)
return true;
if (antiBot.tabValue.get()) {
final boolean equals = antiBot.tabModeValue.get().equalsIgnoreCase("Equals");
final String targetName = ColorUtils.stripColor(entity.getDisplayName().getFormattedText());
if (targetName != null) {
for (final NetworkPlayerInfo networkPlayerInfo : mc.getNetHandler().getPlayerInfoMap()) {
final String networkName = ColorUtils.stripColor(EntityUtils.getName(networkPlayerInfo));
if (networkName == null)
continue;
if (equals ? targetName.equals(networkName) : targetName.contains(networkName))
return false;
}
return true;
}
}
if (antiBot.duplicateInWorldValue.get()) {
if (mc.theWorld.loadedEntityList.stream()
.filter(currEntity -> currEntity instanceof EntityPlayer && ((EntityPlayer) currEntity)
.getDisplayNameString().equals(((EntityPlayer) currEntity).getDisplayNameString()))
.count() > 1)
return true;
}
if (antiBot.duplicateInTabValue.get()) {
if (mc.getNetHandler().getPlayerInfoMap().stream()
.filter(networkPlayer -> entity.getName().equals(ColorUtils.stripColor(EntityUtils.getName(networkPlayer))))
.count() > 1)
return true;
}
return entity.getName().isEmpty() || entity.getName().equals(mc.thePlayer.getName());
}
@SideOnly(Side.CLIENT)
public static class PlayerComparator implements Comparator<NetworkPlayerInfo> {
private PlayerComparator() {
}
public int compare(NetworkPlayerInfo p_compare_1_, NetworkPlayerInfo p_compare_2_) {
ScorePlayerTeam scoreplayerteam = p_compare_1_.getPlayerTeam();
ScorePlayerTeam scoreplayerteam1 = p_compare_2_.getPlayerTeam();
return ComparisonChain.start()
.compareTrueFirst(p_compare_1_.getGameType() != WorldSettings.GameType.SPECTATOR,
p_compare_2_.getGameType() != WorldSettings.GameType.SPECTATOR)
.compare(scoreplayerteam != null ? scoreplayerteam.getRegisteredName() : "",
scoreplayerteam1 != null ? scoreplayerteam1.getRegisteredName() : "")
.compare(p_compare_1_.getGameProfile().getName(), p_compare_2_.getGameProfile().getName()).result();
}
}
}
// NOTE (AI): The S14 consumer only records onGround transitions into per-entity id lists; isBot() then applies the configured heuristics. Note invaildGround counts onGround packets with a y change and halves the count on air packets, a teleporting-bot heuristic.
anticheat Anti-Cheat Checks
Server-side anticheats never see S14 on the wire: it is a clientbound announcement of entity relative movement, rotation and ground state. What they do see is the same stream on the send side, and the richest anticheats use it to keep a lag-compensated copy of every tracked entity's position so reach, phase and velocity checks compare the player against where the server actually believes entities are. The corpus splits into position-replication trackers (Hydro, Kauri, AntiHaxerman), wrappers that classify the S14 subclasses into a packet pipeline (Frequency, Artemis, FlopAC), and reach checks that either consume the replicated positions or, in ThotPatrol's case, admit that rel-move plus AABB would beat their own Bukkit-based math.
Rebuild other entities' positions from the S14 relative-move stream so reach and aim checks can query server-truth entity locations instead of trusting the player's rendered view.
handleMovement(deltaX, deltaY, deltaZ) wraps the S14 byte deltas into an EntityMovement of type RELATIVE, marks the entity as awaiting confirmation, and applies the deltas to every TrackedPosition in the queue. handlePostFlying advances the queue when the player's next flying packet confirms the tick, and handlePostTransaction removes positions that the confirmed state has passed. Confirmed and pending positions are exposed separately (getX/getY/getZ versus getPendingPosition), so checks can evaluate both the server-known location and the one the client has just been told about.
// ===== FILE: Incognitolol-Hydro, src/main/java/integral/studios/hydro/util/player/tracker/entity/TrackedEntity.java =====
package integral.studios.hydro.util.player.tracker.entity;
import lombok.Getter;
import java.util.ArrayDeque;
import java.util.Deque;
@Getter
public class TrackedEntity {
private final Deque<TrackedPosition> positions = new ArrayDeque<>();
private TrackedPosition confirmedPosition;
private TrackedPosition pendingPosition;
private EntityMovement pendingMovement = EntityMovement.none();
private boolean awaitingConfirmation = false;
private final int entityId;
public TrackedEntity(int entityId, double x, double y, double z) {
this.entityId = entityId;
TrackedPosition initialPos = new TrackedPosition(x, y, z);
this.positions.add(initialPos);
this.confirmedPosition = initialPos;
this.pendingPosition = initialPos.copy();
}
public TrackedEntity(double x, double y, double z) {
this(-1, x, y, z);
}
public void handleMovement(double deltaX, double deltaY, double deltaZ) {
pendingMovement = EntityMovement.relative(deltaX, deltaY, deltaZ);
awaitingConfirmation = true;
// Apply movement to all tracked positions
positions.forEach(pos -> pos.handleMovement(deltaX, deltaY, deltaZ));
}
public void handleTeleport(double x, double y, double z) {
pendingMovement = EntityMovement.absolute(x, y, z);
awaitingConfirmation = true;
// Apply teleport to all tracked positions
positions.forEach(pos -> pos.handleTeleport(x, y, z));
}
public void handlePostTransaction() {
if (!awaitingConfirmation) {
return;
}
awaitingConfirmation = false;
// Clean up old positions that match the confirmed position
positions.removeIf(pos -> pos.equals(confirmedPosition));
// Update confirmed position if we have new positions
if (!positions.isEmpty()) {
confirmedPosition = positions.poll();
// Keep at least one position in the queue
if (positions.isEmpty()) {
positions.add(confirmedPosition.copy());
}
}
}
public void handlePostFlying() {
// Apply pending movement if we're waiting for confirmation
if (awaitingConfirmation && pendingMovement.hasMovement()) {
// Create new position state for the pending movement
TrackedPosition newPosition = confirmedPosition.copy();
// Apply the movement based on type
if (pendingMovement.getType() == EntityMovement.Type.ABSOLUTE) {
newPosition.handleTeleport(
pendingMovement.getX(),
pendingMovement.getY(),
pendingMovement.getZ()
);
} else if (pendingMovement.getType() == EntityMovement.Type.RELATIVE) {
newPosition.handleMovement(
pendingMovement.getX(),
pendingMovement.getY(),
pendingMovement.getZ()
);
}
// Add to tracking queue if not already present
if (!positions.contains(newPosition)) {
positions.add(newPosition);
}
pendingPosition = newPosition;
}
// Update all positions (interpolation)
positions.forEach(TrackedPosition::onLivingUpdate);
confirmedPosition.onLivingUpdate();
}
public double getX() {
return confirmedPosition.getPosX();
}
public double getY() {
return confirmedPosition.getPosY();
}
public double getZ() {
return confirmedPosition.getPosZ();
}
public TrackedPosition getPendingPosition() {
return awaitingConfirmation ? pendingPosition : confirmedPosition;
}
public int getPositionQueueSize() {
return positions.size();
}
public boolean hasPendingMovement() {
return awaitingConfirmation;
}
public double getPendingDistance() {
if (!awaitingConfirmation) return 0;
double dx = pendingPosition.getPosX() - confirmedPosition.getPosX();
double dy = pendingPosition.getPosY() - confirmedPosition.getPosY();
double dz = pendingPosition.getPosZ() - confirmedPosition.getPosZ();
return Math.sqrt(dx * dx + dy * dy + dz * dz);
}
public void reset(double x, double y, double z) {
positions.clear();
TrackedPosition newPos = new TrackedPosition(x, y, z);
positions.add(newPos);
confirmedPosition = newPos;
pendingPosition = newPos.copy();
pendingMovement = EntityMovement.none();
awaitingConfirmation = false;
}
@Override
public String toString() {
return String.format("TrackedEntity{id=%d, pos=(%.2f,%.2f,%.2f), pending=%s, queueSize=%d}",
entityId, getX(), getY(), getZ(), awaitingConfirmation, positions.size());
}
}
// NOTE (AI): The S14 deltas arrive as raw fixed-point bytes; TrackedEntity applies them directly as doubles, matching the client's own accumulation behavior.
// NOTE (AI): The confirmed position only advances after the transaction confirms, which is the lag-compensation model used across the corpus.Keep a server-side copy of every tracked entity's interpolated location from the S14 stream, and spawn fake mobs around a target to verify that the client's own entity tracking and aim match the server's.
onRelPosition looks up the entity in the world tracker, skips non-allowed types, then adds the packet's x, y, z, yaw and pitch to the entity's new EntityLocation and sets the interpolation increment to 3. onFlying advances interpolation for every tracked entity whenever the player sends a flying packet. runAction delays the state change until a transaction confirms, or uses an instant action for the current combat target, timestamping entity updates against the player's connection. For a teleporting target it spawns three magma-cube fake mobs around the entity plus a slime on the player's aim ray, then moves them with the entity, so the client's hitbox testing can be verified server-side.
// ===== FILE: funkemunky-KauriV3, Anticheat/src/main/java/dev/brighten/ac/handler/EntityTrackHandler.java =====
package dev.brighten.ac.handler;
import com.github.retrooper.packetevents.protocol.attribute.Attribute;
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.player.ClientVersion;
import com.github.retrooper.packetevents.util.Vector3d;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerDestroyEntities;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityPositionSync;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityTeleport;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerUpdateAttributes;
import dev.brighten.ac.data.APlayer;
import dev.brighten.ac.handler.entity.FakeMob;
import dev.brighten.ac.handler.entity.TrackedEntity;
import dev.brighten.ac.packet.WPacketPlayOutEntity;
import dev.brighten.ac.utils.EntityLocation;
import dev.brighten.ac.utils.KLocation;
import dev.brighten.ac.utils.timer.Timer;
import dev.brighten.ac.utils.timer.impl.MillisTimer;
import dev.brighten.ac.utils.world.types.RayCollision;
import lombok.RequiredArgsConstructor;
import java.util.*;
import java.util.concurrent.atomic.AtomicBoolean;
@RequiredArgsConstructor
public class EntityTrackHandler {
private final APlayer data;
private final Timer lastFlying = new MillisTimer();
public Set<Integer> canCreateMob = new HashSet<>();
public int streak;
public AtomicBoolean clientHasEntity = new AtomicBoolean(false);
private final Set<EntityType> allowedEntityTypes = Set.of(EntityTypes.ZOMBIE, EntityTypes.SHEEP,
EntityTypes.BLAZE, EntityTypes.SKELETON, EntityTypes.PLAYER, EntityTypes.VILLAGER, EntityTypes.IRON_GOLEM,
EntityTypes.WITCH, EntityTypes.COW, EntityTypes.CREEPER);
public Optional<Integer> getTargetOfFakeMob(int fakeMobId) {
for (TrackedEntity value : data.getWorldTracker().getCurrentWorld().get()
.getTrackedEntities().values()) {
if(value.getFakeMobs().stream().anyMatch(mob -> mob.getEntityId() == fakeMobId)) {
return Optional.of(value.getEntityId());
}
}
return Optional.empty();
}
/**
*
* We are processing PacketPlayInFlying to iterate the tracked entity locations
*
*/
void onFlying() {
if(lastFlying.isNotPassed(1)) streak++;
else {
streak = 1;
}
processZombie();
data.getWorldTracker().getCurrentWorld().get().getTrackedEntities().values().forEach(entity -> {
var oldLoc = entity.getOldEntityLocation();
var newLoc = entity.getNewEntityLocation();
if(oldLoc != null) {
if(oldLoc.interpolatedLocations.size() > 1 && oldLoc.increment == 0) {
oldLoc.interpolatedLocations.removeFirst();
}
oldLoc.interpolateLocation();
}
if(newLoc != null) {
if(newLoc.interpolatedLocations.size() > 1 && newLoc.increment == 0) {
newLoc.interpolatedLocations.removeFirst();
}
newLoc.interpolateLocation();
}
});
lastFlying.reset();
}
/**
*
* Processing PacketPlayOutRelativePosition for updating entity locations in a relative manner.
*
* @param packet WrappedOutRelativePosition
*/
void onRelPosition(WPacketPlayOutEntity packet) {
Optional<TrackedEntity> entity = data.getWorldTracker().getCurrentWorld().get()
.getTrackedEntity(packet.getId());
if(entity.isEmpty() || !allowedEntityTypes.contains(entity.get().getEntityType())) return;
processFakeMobs(packet.getId(), true, packet.getX(), packet.getY(), packet.getZ());
EntityLocation eloc = entity.get().getNewEntityLocation();
entity.get().setOldEntityLocation(entity.get().getNewEntityLocation().clone());
runAction(entity.get(), () -> {
//We don't need to do version checking here. Atlas handles this for us.
eloc.newX += packet.getX();
eloc.newY += packet.getY();
eloc.newZ += packet.getZ();
eloc.newYaw += packet.getYaw();
eloc.newPitch += packet.getPitch();
eloc.increment = 3;
});
}
void onPositionSync(WrapperPlayServerEntityPositionSync packet) {
Optional<TrackedEntity> entity = data.getWorldTracker().getCurrentWorld().get()
.getTrackedEntity(packet.getId());
if(entity.isEmpty() || !allowedEntityTypes.contains(entity.get().getEntityType())) return;
processFakeMobs(packet.getId(), false, packet.getValues().getPosition().getX(),
packet.getValues().getPosition().getY(), packet.getValues().getPosition().getZ());
EntityLocation eloc = entity.get().getNewEntityLocation();
entity.get().setOldEntityLocation(entity.get().getNewEntityLocation().clone());
runAction(entity.get(), () -> {
//We don't need to do version checking here. Atlas handles this for us.
eloc.newX = packet.getValues().getPosition().getX();
eloc.newY = packet.getValues().getPosition().getY();
eloc.newZ = packet.getValues().getPosition().getZ();
eloc.newYaw = packet.getValues().getYaw();
eloc.newPitch = packet.getValues().getPitch();
eloc.increment = 3;
});
}
/**
*
* Processing PacketPlayOutEntityTeleport to update locations in a non-relative manner.
*
* @param packet WrappedOutEntityTeleportPacket
*/
void onTeleportSent(WrapperPlayServerEntityTeleport packet) {
Optional<TrackedEntity> entity = data.getWorldTracker().getCurrentWorld().get()
.getTrackedEntity(packet.getEntityId());
if(entity.isEmpty() || !allowedEntityTypes.contains(entity.get().getEntityType())) return;
processFakeMobs(packet.getEntityId(), false, packet.getPosition().getX(), packet.getPosition().getY(), packet.getPosition().getZ());
EntityLocation eloc = entity.get().getNewEntityLocation();
entity.get().setOldEntityLocation(entity.get().getNewEntityLocation().clone());
runAction(entity.get(), () -> {
if(data.getPlayerVersion().isNewerThanOrEquals(ClientVersion.V_1_9)) {
if (!(Math.abs(eloc.x - packet.getPosition().getX()) >= 0.03125D)
&& !(Math.abs(eloc.y - packet.getPosition().getY()) >= 0.015625D)
&& !(Math.abs(eloc.z - packet.getPosition().getZ()) >= 0.03125D)) {
eloc.increment = 0;
//We don't need to do version checking here. Atlas handles this for us.
eloc.newX = eloc.x = packet.getPosition().getX();
eloc.newY = eloc.y = packet.getPosition().getY();
eloc.newZ = eloc.z = packet.getPosition().getZ();
eloc.newYaw = eloc.yaw = packet.getYaw();
eloc.newPitch = eloc.pitch = packet.getPitch();
} else {
eloc.newX = packet.getPosition().getX();
eloc.newY = packet.getPosition().getY();
eloc.newZ = packet.getPosition().getZ();
eloc.newYaw = packet.getYaw();
eloc.newPitch = packet.getPitch();
eloc.increment = 3;
}
} else {
//We don't need to do version checking here. Atlas handles this for us.
eloc.newX = packet.getPosition().getX();
eloc.newY = packet.getPosition().getY();
eloc.newZ = packet.getPosition().getZ();
eloc.newYaw = packet.getYaw();
eloc.newPitch = packet.getPitch();
eloc.increment = 3;
}
});
}
void updateAttributes(WrapperPlayServerUpdateAttributes attributes) {
data.runKeepaliveAction(ka -> {
TrackedEntity tracked = data.getWorldTracker().getCurrentWorld().get()
.getTrackedEntity(attributes.getEntityId()).orElse(null);
if(tracked == null) return;
for (WrapperPlayServerUpdateAttributes.Property property : attributes.getProperties()) {
Attribute attribute = property.getAttribute();
if(attributes.getEntityId() == data.getBukkitPlayer().getEntityId() && attribute == Attributes.MOVEMENT_SPEED) {
ValuedAttribute value = tracked.getAttribute(attribute);
value.updateAttribute(property);
data.getInfo().setWalkSpeed(value.getValue());
}
tracked.updateAttribute(property);
}
});
}
/**
*
* We are running an action when a transaction is received. If the Entity provided is currently a target,
* we want to send a tranasction on this method being run and use that to more accurately get an estimate of when
* the client receives the transaction relative to what we want in the action. If not the target, then we use our
* transaction system which sends one transaction every tick, and then on return runs a list of Runnables which
* may be less accurate in some situations, but uses less processing and network resources.
*
* @param entity Entity
* @param action Runnable
*/
private void runAction(TrackedEntity entity, Runnable action) {
if(data.getInfo().getTarget() != null && data.getInfo().getTarget().getEntityId() == entity.getEntityId()) {
data.runInstantAction(ia -> {
if(!ia.isEnd()) {
action.run();
} else entity.setOldEntityLocation(null);
}, true);
} else {
data.runKeepaliveAction(keepalive -> action.run());
data.runKeepaliveAction(keepalive ->
entity.setOldEntityLocation(null), 1);
}
}
public void onEntityDestroy(WrapperPlayServerDestroyEntities packet) {
data.runKeepaliveAction(ka -> {
for(int id : packet.getEntityIds()) {
removeFakeMob(id);
}
});
}
public void removeFakeMob(int id) {
if(data.getWorldTracker().getCurrentWorld().get()
.getTrackedEntities().containsKey(id)) {
List<FakeMob> mobs = data.getWorldTracker().getCurrentWorld().get()
.getTrackedEntity(id).map(TrackedEntity::getFakeMobs).orElse(new ArrayList<>());
for (FakeMob mob : mobs) {
mob.despawn();
}
mobs.clear();
}
clientHasEntity.set(false);
}
private static final double[] offsets = new double[]{-1.25, 0, 1.25};
private void createFakeMob(int entityId, KLocation location) {
if (!canCreateMob.contains(entityId)) return;
Optional<TrackedEntity> trackedEntity = data.getWorldTracker().getCurrentWorld().get()
.getTrackedEntity(entityId);
Optional<TrackedEntity> playerEntity = data.getWorldTracker().getCurrentWorld().get()
.getTrackedEntity(data.getBukkitPlayer().getEntityId());
if(trackedEntity.isEmpty() || playerEntity.isEmpty()) return;
for (double offset : offsets) {
FakeMob mob = new FakeMob(EntityTypes.MAGMA_CUBE);
List<EntityData<?>> types = new ArrayList<>();
EntityData<?> entityData = new EntityData<>(16, EntityDataTypes.BYTE, (byte)10);
types.add(entityData);
// Setting Magma cube size to size 10
mob.spawn(true, location.clone().add(offset, offset, offset),
types, data);
trackedEntity.get().getFakeMobs().add(mob);
}
KLocation eyeLoc = data.getMovement().getTo().getLoc().clone()
.add(0, data.getEyeHeight() / 2.5, 0);
RayCollision collision = new RayCollision(eyeLoc.toVector(), eyeLoc.getDirection());
Vector3d point = collision.collisionPoint(0.4);
FakeMob mob = new FakeMob(EntityTypes.SLIME);
List<EntityData<?>> types = new ArrayList<>();
EntityData<?> entityData = new EntityData<>(16, EntityDataTypes.BYTE, (byte)5);
types.add(entityData);
mob.spawn(true, new KLocation(point.getX(), point.getY(), point.getZ()), types, data);
playerEntity.get().getFakeMobs().add(mob);
canCreateMob.remove(entityId);
data.runKeepaliveAction(ka -> clientHasEntity.set(true));
}
public void processZombie() {
List<FakeMob> fakeMobs = data.getWorldTracker().getCurrentWorld().get()
.getTrackedEntity(data.getBukkitPlayer().getEntityId())
.map(TrackedEntity::getFakeMobs)
.orElse(new ArrayList<>());
if(fakeMobs.size() > 1) {
fakeMobs.forEach(fakeMob -> removeFakeMob(fakeMob.getEntityId()));
}
for (FakeMob fakeMob : fakeMobs) {
if(fakeMob.getType() == EntityTypes.SLIME) {
KLocation eyeLoc = data.getMovement().getTo().getLoc().clone().add(0, 0.6, 0);
RayCollision collision = new RayCollision(eyeLoc.toVector(), eyeLoc.getDirection());
Vector3d point = collision.collisionPoint(0.4);
fakeMob.teleport(point.getX(), point.getY(), point.getZ(), 0 ,0);
break;
}
}
}
public void processFakeMobs(int entityId, boolean rel, double x, double y, double z) {
List<FakeMob> fakeMobs = data.getWorldTracker().getCurrentWorld().get()
.getTrackedEntity(entityId).map(TrackedEntity::getFakeMobs).orElse(new ArrayList<>());
if(fakeMobs.isEmpty()) {
if(!rel) {
createFakeMob(entityId, new KLocation(x, y, z));
}
if(data.getInfo().getTarget() != null && data.getInfo().getTarget().getEntityId() == entityId) {
clientHasEntity.set(false);
}
return;
}
if(fakeMobs.size() != offsets.length + 1) {
fakeMobs.forEach(fakeMob -> removeFakeMob(fakeMob.getEntityId()));
}
int current = 0;
for (FakeMob fakeMob : fakeMobs) {
double offset = offsets[current++];
if(rel) {
fakeMob.move(x, y, z);
} else {
fakeMob.teleport(x + offset, y + offset, z + offset, 0, 0);
}
}
}
}
// NOTE (AI): The fake-mob mechanism only activates for entities that can be targeted (canCreateMob), and the ray collision test uses a 0.4-meter collision point, so the check is a killaura verifier rather than a movement check.Classic 1.8 reach check; the corpus hit is the author's own TODO comment stating that tracking PacketPlayOutRelEntityMove and testing the AABB would be far more accurate than the Bukkit-position math the check actually uses.
On PacketAttackEvent the check measures the distance between attacker and victim eye locations, subtracts the vertical difference and a fixed 0.32 hitbox accommodation, and compares the result against maxReach. The threshold is inflated by ground state, yaw difference, recent horizontal speed (tracked on PlayerMoveEvent), the average ping of both players, TPS and the attacker's speed potion level. Three consecutive exceedances log a cheat.
// ===== FILE: freppp-ThotPatrol, src/main/java/me/frep/thotpatrol/checks/combat/reach/ReachD.java =====
package me.frep.thotpatrol.checks.combat.reach;
import me.frep.thotpatrol.ThotPatrol;
import me.frep.thotpatrol.checks.Check;
import me.frep.thotpatrol.packets.PacketPlayerType;
import me.frep.thotpatrol.packets.events.PacketAttackEvent;
import me.frep.thotpatrol.utils.UtilMath;
import me.frep.thotpatrol.utils.UtilPlayer;
import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.player.PlayerMoveEvent;
import org.bukkit.event.player.PlayerQuitEvent;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;
public class ReachD extends Check {
public static Map<UUID, Integer> verbose = new HashMap<UUID, Integer>();
private Map<UUID, Double> lastDist = new HashMap<>();
private Map<UUID, Integer> beforeVL = new HashMap<>();
public ReachD(ThotPatrol ThotPatrol) {
super("ReachD", "Reach (Type D)", ThotPatrol);
setEnabled(true);
setBannable(true);
setMaxViolations(7);
setViolationResetTime(120000);
}
//todo this is a somewhat decent blatant reach check, it shouldnt false too much, but obviously using PacketPlayOutRelEntityMove and AABB is much more accurate than anything that will be found in here
@EventHandler
public void onLeave(PlayerQuitEvent e) {
verbose.remove(e.getPlayer().getUniqueId());
lastDist.remove(e.getPlayer().getUniqueId());
beforeVL.remove(e.getPlayer().getUniqueId());
}
@EventHandler
public void onAttack(PacketAttackEvent e) {
if (!(e.getEntity() instanceof Player)) {
return;
}
Player d = e.getPlayer();
Player p = (Player)e.getEntity();
if(e.getType() != PacketPlayerType.USE
|| d.hasPermission("thotpatrol.bypass")
|| d.getAllowFlight()
|| p.getAllowFlight()
|| d.getGameMode().equals(GameMode.CREATIVE)) {
return;
}
int count = verbose.getOrDefault(d.getUniqueId(), 0);
int preVL = beforeVL.getOrDefault(d.getUniqueId(), 0);
double yDist = Math.abs(UtilPlayer.getEyeLocation(d).getY() - UtilPlayer.getEyeLocation(p).getY()) > 0.5
? Math.abs(UtilPlayer.getEyeLocation(d).getY() - UtilPlayer.getEyeLocation(p).getY()) : 0;
double yawDiff = Math.abs(180 - Math.abs(d.getLocation().getYaw() - p.getLocation().getYaw()));
double reach = (UtilPlayer.getEyeLocation(d).distance(p.getEyeLocation()) - yDist) - 0.32;
if (reach > 6.5) return;
double maxReach = 3.1;
double speed = lastDist.getOrDefault(d.getUniqueId(), 0D);
double tps = getThotPatrol().getLag().getTPS();
int ping = getThotPatrol().getLag().getPing(d);
int ping2 = getThotPatrol().getLag().getPing(p);
if (!UtilPlayer.isOnGround(d)) {
maxReach += .23;
}
maxReach += yawDiff > 100 && yDist < 0.1 ? yawDiff * 0.01 : yawDiff * 0.001;
maxReach += speed * .58;
maxReach += yDist * .75;
maxReach += ((ping + ping2) / 2) * 0.0034;
for (PotionEffect effect : d.getActivePotionEffects()) {
if (effect.getType().equals(PotionEffectType.SPEED)) {
int level = effect.getAmplifier() + 1;
maxReach += level * .125;
}
}
if (reach > maxReach) {
count++;
} else {
if (count > 0) {
count--;
}
}
if (count > 3) {
getThotPatrol().verbose(this, d, ping, tps, reach + " > " + maxReach);
preVL++;
}
if (preVL >= 2) {
count = 0;
preVL = 0;
getThotPatrol().logCheat(this, d, "Reach: " + reach + " > " + maxReach + " | Ping: " + ping + " | TPS: " + tps);
getThotPatrol().logToFile(d, this, "Reach (Consecutive)", "Reach: " + reach
+ " > " + maxReach + " | TPS: " + tps + " | Ping: " + ping);
}
beforeVL.put(d.getUniqueId(), preVL);
verbose.put(d.getUniqueId(), count);
}
@EventHandler
public void onMove(PlayerMoveEvent e) {
Player p = e.getPlayer();
double dist = UtilMath.getHorizontalDistance(e.getTo(), e.getFrom());
lastDist.put(p.getUniqueId(), dist);
}
}
// NOTE (AI): The packet class itself never appears in this file; the corpus match is the author's TODO comment. Included to show the historical gap between Bukkit-position reach checks and S14-driven AABB reach.Whitelist the packet classes AntiHaxerman's trackers may consume, including the three S14 subclasses, so entity replication only runs for state that actually reaches the client.
The constructor registers GPacketPlayServerEntity and its Look, RelEntityMove and RelEntityMoveLook inner classes, plus entity teleport, spawn, destroy, velocity, attributes and the movement/transaction set. isAllowed is the gate every later pipeline stage checks before processing a packet.
// ===== FILE: Tecnio-AntiHaxerman, src/main/java/me/tecnio/ahm/listener/network/NetworkFilter.java =====
package me.tecnio.ahm.listener.network;
import cc.ghast.packet.wrapper.packet.play.client.*;
import cc.ghast.packet.wrapper.packet.play.server.*;
import java.util.Arrays;
import java.util.HashSet;
public final class NetworkFilter {
private final HashSet<Class<?>> filters = new HashSet<>();
public NetworkFilter() {
this.filters.addAll(Arrays.asList(
GPacketPlayClientFlying.class,
GPacketPlayClientPosition.class,
GPacketPlayClientPositionLook.class,
GPacketPlayClientLook.class,
GPacketPlayClientUseEntity.class,
GPacketPlayClientKeepAlive.class,
GPacketPlayServerKeepAlive.class,
GPacketPlayClientTransaction.class,
GPacketPlayServerTransaction.class,
GPacketPlayServerEntity.class,
GPacketPlayServerEntity.GPacketPlayServerEntityLook.class,
GPacketPlayServerEntity.GPacketPlayServerRelEntityMove.class,
GPacketPlayServerEntity.GPacketPlayServerRelEntityMoveLook.class,
GPacketPlayServerEntityTeleport.class,
GPacketPlayServerSpawnNamedEntity.class,
GPacketPlayServerEntityDestroy.class,
GPacketPlayClientBlockPlace.class,
GPacketPlayClientArmAnimation.class,
GPacketPlayClientBlockDig.class,
GPacketPlayClientHeldItemSlot.class,
GPacketPlayServerPosition.class,
GPacketPlayServerBlockChange.class,
GPacketPlayServerBlockChangeMulti.class,
GPacketPlayClientEntityAction.class,
GPacketPlayServerEntityEffect.class,
GPacketPlayServerEntityEffectRemove.class,
GPacketPlayServerUpdateAttributes.class,
GPacketPlayServerEntityVelocity.class,
GPacketPlayClientBlockDig.class
));
}
public boolean isAllowed(final Class<?> clazz) {
return this.filters.contains(clazz);
}
}
// NOTE (AI): AntiHaxerman classifies the S14 subclasses so the EntityTracker can distinguish relative moves from look-only updates and teleports, mirroring vanilla's subclass structure.Minimal 1.8 wrapper exposing the S14 base packet to Frequency's outgoing packet pipeline.
The class extends PacketWrapper over PacketPlayOutEntity, giving the processor layer a typed handle for entity move packets. The identical file ships in the FrequencyPlus fork and in Degrade, which is a Frequency derivative.
// ===== FILE: ElevatedDev-Frequency, src/main/java/xyz/elevated/frequency/wrapper/impl/server/WrappedPacketPlayOutEntity.java =====
package xyz.elevated.frequency.wrapper.impl.server;
import net.minecraft.server.v1_8_R3.Packet;
import net.minecraft.server.v1_8_R3.PacketPlayOutEntity;
import xyz.elevated.frequency.wrapper.PacketWrapper;
public final class WrappedPacketPlayOutEntity extends PacketWrapper {
public WrappedPacketPlayOutEntity(final Packet<?> instance) {
super(instance, PacketPlayOutEntity.class);
}
public int getEntityId() {
return get("a");
}
public double getDeltaX() {
return ((byte) get("b")) / 32.d;
}
public double getDeltaY() {
return (byte) (get("c")) / 32.d;
}
public double getDeltaZ() {
return ((byte) get("d")) / 32.d;
}
}
// NOTE (AI): The wrapper is registered for the S14 base class, so it covers the S15/S16/S17 subclasses through inheritance, matching how the vanilla client handles the family.Related Packets
Wiki Cross-Reference
Yaw and pitch in the rotation updates are new absolute angles, not deltas, and for entities with separately rotating heads the yaw sets body rotation while head facing uses the head rotation packet.
MCP 1.8.9 S14PacketEntity implements Packet
1.8.9 callers: EntityTrackerEntry.? sends new S14PacketEntity (line 205): 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 S14PacketEntity
Full source walkthroughs of the modules and anti-cheats that use this packet.