0x0B S0BPacketAnimation
Broadcasts entity animation (arm swing, damage, etc.) to nearby players.
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| entityId | VarInt | Entity ID |
| type | byte | 0=swing, 1=damage, 2=leaveBed, 3/eat, 4/critical, 5/magicCritical, 6/crouch, 7/uncrouch |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Entity ID | VarInt | |
| Animation | unsigned byte | 0=swing, 1=damage, 2=leaveBed, 3=eat, 4=critical, 5=magic, 6=crouch, 7=uncrouch |
MCP References
NetHandlerPlayClient.handleAnimation()Handler Interface
INetHandlerPlayClientVanilla Source
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
Deobfuscated MCP 1.8.9 source of S0BPacketAnimation, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S0BPacketAnimation.java) at build time and verified present.
Deep Dive
Role in the protocol
S0B broadcasts an entity animation: a VarInt entity id and a byte type (0 swing, 1 damage, 2 leave bed, 3 eat or drink, 4 critical, 5 magic critical, 6 crouch, 7 uncrouch). EntityLivingBase.swingItem sends type 0 through the entity tracker, EntityPlayerMP sends 2 and 3 on bed leave and eating, and attackEntityAsMob sends 4 and 5 for crits. The client handler switches on the type and drives the entity's animation state.
Vanilla handling
NetHandlerPlayClient.handleAnimation looks up the entity and applies the animation: swingProgress for type 0, hurtTime for 1, and so on. Server-side the tracker fans the packet out to every player tracking the entity, so a swing is the one reliable signal that another player is attacking.
Why clients touch it
S0B is the swing ground truth, and the corpus uses it five ways. ClickerMimic (Rise 6.x) records per-player swing intervals and replays them as the client's own clicks. Ranking (Sigma) timestamps swings and attributes deaths to players who swung within 70 ms of the local player taking damage. Rise 5.99 runs its own anticheat off S0B: AutoClickerA counts swings against movement packets, KeepSprintA couples swings to sprint state. PlayerHacks (Rise 5.99) gates its remote aura and nuker on the master's swings, and SocialCreditScore subtracts points for every weapon swing it observes. Nekoware and Rise 5.99 Scaffold import S0B for placement-swing sync without handling it. LiquidSense Dev's AntiBot records every type-0 swing entity id into a swing set on the packet bus and flags entities that never swing as bots when its Swing check is enabled, the only swing telemetry in the corpus outside Rise's checks.
Exploit surface
S0B is clientbound only and cannot be spoofed outward, so abuse is observational. A player who hits without producing swings, or with perfectly regular intervals, is an autoclicker; that is exactly what Rise's AutoClickerA and KeepSprintA checks measure on the client's own users. ClickerMimic inverts the trick: it measures a victim's swing rhythm and reproduces it, so the client's clicks inherit a human-looking distribution without any randomization logic of its own.
Server-Side Handling
EntityLivingBase.swingItem sends S0B type 0 to all tracking entities; EntityPlayerMP sends type 2 on bed leave, type 3 on eating, and attackEntityAsMob emits types 4 and 5 for critical hits through func_151248_b. The server applies no rate limit: swings are broadcast as produced, which is what makes swing-count heuristics possible.
Protocol Analysis
Fields: VarInt entity id, unsigned byte animation type. Clientbound in PLAY state. The type byte is read as readUnsignedByte, so values above 7 are legal on the wire and ignored by the vanilla switch. The swing type 0 is the only animation players emit at click rate, which is why every module keys on it specifically.
Anti-Cheat Landscape
Swing-vs-movement ratio is the autoclicker tell: more than 3 swings per movement packet flags AutoClickerA. Keepsprint couples swings to sprint state. The client-side checks in Rise 5.99 are notable because they run in the cheat itself, proof that S0B is the swing source of truth for both sides of the ecosystem.
implementation Implementation Cases
The animation broadcast: entity id plus a type byte, fanned out by the entity tracker. The only reliable signal that another player swung, which makes it the heartbeat of click mimicry, swing-based anticheat checks, combat logging, aura gating and bot filtering across the reference clients.
Record the swing intervals of every visible player and replay them as the client's own clicks, so the local click pattern mirrors the victim's rhythm.
On PacketReceiveEvent, each S0B stamps ticksExisted into a per-name interval list. While the attack key is held, PreUpdateEvent replays the recorded intervals as mc.clickMouse() calls, halved in duration. Sneaking clears the recordings.
// ===== FILE: Rise 6.1.30, com/alan/clients/module/impl/combat/mimic/ClickerMimic.java =====
package com.alan.clients.module.impl.combat.mimic;
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.PreUpdateEvent;
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
import com.alan.clients.module.impl.combat.Mimic;
import com.alan.clients.util.chat.ChatUtil;
import com.alan.clients.value.Mode;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S0BPacketAnimation;
import net.minecraft.util.Tuple;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Optional;
public class ClickerMimic extends Mode<Mimic> {
public ClickerMimic(String name, Mimic parent) {
super(name, parent);
}
private long next;
private HashMap<String, Tuple<ArrayList<Integer>, Integer>> clicks = new HashMap<>();
@EventLink(value = Priorities.VERY_LOW)
public final Listener<PacketReceiveEvent> onReceive = event -> {
Packet<?> packet = event.getPacket();
if (packet instanceof S0BPacketAnimation) {
S0BPacketAnimation animation = ((S0BPacketAnimation) packet);
int id = animation.getEntityID();
if (id == mc.thePlayer.getEntityId()) return;
String name = mc.theWorld.getEntityByID(id).getCommandSenderName();
int tick = mc.thePlayer.ticksExisted;
if (!clicks.containsKey(name)) {
clicks.put(name, new Tuple<>(new ArrayList<>(), tick));
}
Tuple<ArrayList<Integer>, Integer> data = clicks.get(name);
ChatUtil.display("Recorded " + (tick - data.getSecond()) + " von " + name);
data.getFirst().add(tick - data.getSecond());
data.setSecond(tick);
}
};
@EventLink(value = Priorities.VERY_LOW)
public final Listener<PreUpdateEvent> onPreUpdate = event -> {
if (!mc.gameSettings.keyBindAttack.isKeyDown()) return;
if (mc.gameSettings.keyBindSneak.isKeyDown()) clicks = new HashMap<>();
if (System.currentTimeMillis() > next) {
long next = 0;
while (next == 0 || next >= 9 * 50) {
if (next != 0) ChatUtil.display("Running again prev " + next);
Optional<String> first = clicks.keySet().stream().findFirst();
if (!first.isPresent()) {
ChatUtil.display("Empty");
return;
}
Tuple<ArrayList<Integer>, Integer> data = clicks.get(first.get());
if (data.getFirst().isEmpty()) {
clicks.remove(first.get());
return;
}
next = data.getFirst().get(0) * 50;
data.getFirst().remove(0);
ChatUtil.display("Running " + first.get() + " " + next);
}
this.next = System.currentTimeMillis() + next / 2L;
mc.clickMouse();
mc.leftClickCounter = 1;
}
};
}
// NOTE (AI): Records the swing rhythm of every other player visible to the client: each S0B stamps ticksExisted into a per-name interval list (the type byte is not checked, but type 0 swing is the only animation other players broadcast at click rate). While the attack key is held, the module replays the recorded intervals as mc.clickMouse() calls, halved in duration, so the client's own clicks inherit the victim's distribution. The module is purely observational: it reads the server broadcast and mimics, sending nothing and cancelling nothing. The ChatUtil.display debug spam marks this as a work-in-progress build.Gate a remote aura and nuker on the selected master player's swings: the module only acts after observing an S0B from that entity.
onPacketReceive sets the swung flag when an S0B entity id matches the master. onPreMotion then pathfinds the master along a computed route on a worker thread, sends C04 position packets and C02 attack packets, and reverses the route. The onlyOnSwing setting requires a fresh swing before each pass.
// ===== FILE: Rise 5.99, dev/rise/module/impl/other/PlayerHacks.java =====
/*
Copyright Alan Wood 2021
None of this code to be reused without my written permission
Intellectual Rights owned by Alan Wood
*/
package dev.rise.module.impl.other;
import dev.rise.Rise;
import dev.rise.event.impl.motion.PreMotionEvent;
import dev.rise.event.impl.other.AttackEvent;
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 dev.rise.module.impl.render.Freecam;
import dev.rise.setting.impl.BooleanSetting;
import dev.rise.setting.impl.ModeSetting;
import dev.rise.setting.impl.NoteSetting;
import dev.rise.setting.impl.NumberSetting;
import dev.rise.util.math.TimeUtil;
import dev.rise.util.pathfinding.MainPathFinder;
import dev.rise.util.pathfinding.Vec3;
import dev.rise.util.player.PacketUtil;
import net.minecraft.block.Block;
import net.minecraft.block.BlockAir;
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.C02PacketUseEntity;
import net.minecraft.network.play.client.C03PacketPlayer;
import net.minecraft.network.play.client.C07PacketPlayerDigging;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.network.play.server.S0BPacketAnimation;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.MathHelper;
import java.util.*;
import java.util.stream.Collectors;
@ModuleInfo(name = "PlayerHacks", description = "Gives another player hacks", category = Category.OTHER)
public final class PlayerHacks extends Module {
private final NoteSetting modeSettings = new NoteSetting("Mode Settings", this);
private final ModeSetting mode = new ModeSetting("Mode", this, "Aura", "Aura", "Nuker");
private final ModeSetting auraMode = new ModeSetting("Aura Mode", this, "Single", "Single", "Multi");
private final NoteSetting nukerSettings = new NoteSetting("Nuker Settings", this);
private final NumberSetting delay = new NumberSetting("Delay", this, 100, 0, 5000, 50);
private final NumberSetting nukerRange = new NumberSetting("Nuker Range", this, 4, 1, 7, 0.5);
private final BooleanSetting instantOnly = new BooleanSetting("Instant Only", this, false);
private final BooleanSetting scatter = new BooleanSetting("Scatter", this, false);
private final NoteSetting auraSettings = new NoteSetting("Aura Settings", this);
private final NumberSetting cps = new NumberSetting("CPS", this, 5, 1, 20, 1);
private final NumberSetting auraRange = new NumberSetting("Aura Range", this, 8, 4, 120, 1);
private final NumberSetting maxTargets = new NumberSetting("Max Targets", this, 25, 2, 50, 1);
private final NoteSetting generalSettings = new NoteSetting("General Settings", this);
private final BooleanSetting onlyOnSwing = new BooleanSetting("Only On Swing", this, true);
private final BooleanSetting swing = new BooleanSetting("Swing", this, true);
private final TimeUtil timer = new TimeUtil();
public static String master = "";
private boolean swung;
@Override
public void onUpdateAlwaysInGui() {
switch (mode.getMode()) {
case "Aura":
auraSettings.hidden = false;
auraMode.hidden = false;
cps.hidden = false;
auraRange.hidden = false;
maxTargets.hidden = !auraMode.is("Multi");
nukerSettings.hidden = true;
delay.hidden = true;
nukerRange.hidden = true;
instantOnly.hidden = true;
scatter.hidden = true;
break;
case "Nuker":
nukerSettings.hidden = false;
delay.hidden = false;
nukerRange.hidden = false;
instantOnly.hidden = false;
scatter.hidden = false;
auraSettings.hidden = true;
auraMode.hidden = true;
cps.hidden = true;
auraRange.hidden = true;
maxTargets.hidden = true;
break;
}
}
@Override
public void onPreMotion(final PreMotionEvent event) {
if (mc.theWorld.getPlayerEntityByName(master) == null || (!swung && onlyOnSwing.isEnabled()))
return;
final Entity masterEntity = mc.theWorld.getPlayerEntityByName(master);
final EntityPlayer thePlayer = mc.thePlayer;
final boolean freecamEnabled = Objects.requireNonNull(Rise.INSTANCE.getModuleManager().getModule("Freecam")).isEnabled();
double x = thePlayer.posX;
double y = thePlayer.posY;
double z = thePlayer.posZ;
if (freecamEnabled) {
x = Freecam.startX;
y = Freecam.startY;
z = Freecam.startZ;
}
final double finalZ = z;
final double finalY = y;
final double finalX = x;
switch (mode.getMode()) {
case "Aura": {
if (!timer.hasReached((long) (((20 - cps.getValue()) * 50) - Math.random() * 100)))
return;
final List<EntityPlayer> targets = getEntities(masterEntity, auraRange.getValue());
final int maxTargets = (int) Math.round(this.maxTargets.getValue());
if (auraMode.is("Multi") && targets.size() > maxTargets)
targets.subList(maxTargets, targets.size()).clear();
if (targets.isEmpty())
return;
timer.reset();
final EntityPlayer target = targets.get(0);
/* Creating a new thread */
switch (auraMode.getMode()) {
case "Single": {
final double targetX = target.posX;
final double targetY = target.posY;
final double targetZ = target.posZ;
new Thread(() -> {
/* Getting path */
final ArrayList<Vec3> path = MainPathFinder.computePath(new Vec3(finalX, finalY, finalZ), new Vec3(targetX, targetY, targetZ));
for (final Vec3 vec : path)
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C04PacketPlayerPosition(vec.getX(), vec.getY(), vec.getZ(), true));
if (swing.isEnabled())
mc.thePlayer.swingItem();
/*
* Calls attack event so other modules can use information from the entity
* When the C02 packet is sent the attack event does not
* get called, so we have to manually call it ourselves in here.
*/
final AttackEvent attackEvent = new AttackEvent(target);
attackEvent.call();
if (!attackEvent.isCancelled())
PacketUtil.sendPacketWithoutEvent(new C02PacketUseEntity(target, C02PacketUseEntity.Action.ATTACK));
Collections.reverse(path);
for (final Vec3 vec : path)
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C04PacketPlayerPosition(vec.getX(), vec.getY(), vec.getZ(), true));
}).start();
break;
}
case "Multi": {
for (final EntityPlayer player : targets) {
final double targetX = player.posX;
final double targetY = player.posY;
final double targetZ = player.posZ;
new Thread(() -> {
/* Getting path */
final ArrayList<Vec3> path = MainPathFinder.computePath(new Vec3(finalX, finalY, finalZ), new Vec3(targetX, targetY, targetZ));
for (final Vec3 vec : path)
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C04PacketPlayerPosition(vec.getX(), vec.getY(), vec.getZ(), true));
if (swing.isEnabled())
mc.thePlayer.swingItem();
/*
* Calls attack event so other modules can use information from the entity
* When the C02 packet is sent the attack event does not
* get called, so we have to manually call it ourselves in here.
*/
final AttackEvent attackEvent = new AttackEvent(player);
attackEvent.call();
if (!attackEvent.isCancelled())
PacketUtil.sendPacketWithoutEvent(new C02PacketUseEntity(player, C02PacketUseEntity.Action.ATTACK));
Collections.reverse(path);
for (final Vec3 vec : path)
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C04PacketPlayerPosition(vec.getX(), vec.getY(), vec.getZ(), true));
}).start();
}
break;
}
}
swung = false;
break;
}
case "Nuker": {
if (!timer.hasReached((long) delay.getValue()))
return;
final double radius = nukerRange.getValue() - 1;
timer.reset();
/* Creating a new thread */
final double masterX = masterEntity.posX;
final double masterY = masterEntity.posY;
final double masterZ = masterEntity.posZ;
new Thread(() -> {
/* Getting path */
final ArrayList<Vec3> path = MainPathFinder.computePath(new Vec3(finalX, finalY, finalZ), new Vec3(masterX, masterY, masterZ));
for (final Vec3 vec : path)
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C04PacketPlayerPosition(vec.getX(), vec.getY(), vec.getZ(), true));
nuke(radius, masterX, masterY, masterZ);
Collections.reverse(path);
for (final Vec3 vec : path)
PacketUtil.sendPacketWithoutEvent(new C03PacketPlayer.C04PacketPlayerPosition(vec.getX(), vec.getY(), vec.getZ(), true));
}).start();
swung = false;
break;
}
}
}
@Override
public void onPacketReceive(final PacketReceiveEvent event) {
if (mc.theWorld.getPlayerEntityByName(master) == null)
return;
final Packet<?> p = event.getPacket();
if (p instanceof S0BPacketAnimation) {
final S0BPacketAnimation packetAnimation = (S0BPacketAnimation) p;
if (packetAnimation.getEntityID() == mc.theWorld.getPlayerEntityByName(master).getEntityId())
swung = true;
}
if (mode.is("Nuker") && p instanceof S02PacketChat) {
final S02PacketChat packetChat = (S02PacketChat) p;
final String message = packetChat.getChatComponent().getUnformattedText();
if (!packetChat.isChat() && message.equals("You can't build outside the plot!"))
event.setCancelled(true);
}
}
private List<EntityPlayer> getEntities(final Entity master, final double range) {
// Returns the list of entities
return mc.theWorld.playerEntities
// Stream our entity list.
.stream()
// Only get the entities we can attack.
.filter(entity -> {
if (entity.isDead) return false;
if (entity.deathTime != 0) return false;
if (entity.ticksExisted < 2) return false;
for (final String name : Rise.INSTANCE.getFriends()) {
if (name.equalsIgnoreCase(entity.getGameProfile().getName()))
return false;
}
return master != entity && mc.thePlayer != entity;
})
// Do a proper distance calculation to get entities we can reach.
.filter(entity -> {
// DO NOT TOUCH THIS VALUE ITS CALCULATED WITH MATH
final double girth = 0.5657;
// See if the other entity is in our range.
return master.getDistanceToEntity(entity) - girth < range;
})
// Sort out potential targets with the algorithm provided as a setting.
.sorted(Comparator.comparingDouble(master::getDistanceSqToEntity))
.sorted(Comparator.comparingDouble(entity -> {
final float[] rotation = rotateToEye(entity);
final float pitch = rotation[1];
final float yaw = rotation[0];
return Math.abs(pitch - master.rotationPitch) + Math.abs(yaw - master.rotationYaw);
}))
// Sort out all the specified targets.
.sorted(Comparator.comparing(entity -> !Rise.INSTANCE.getTargets().contains(entity.getName())))
// Get the possible targets and put them in a list.
.collect(Collectors.toList());
}
private float[] rotateToEye(final EntityLivingBase entityLivingBase) {
final double x = entityLivingBase.posX;
final double y = entityLivingBase.posY + entityLivingBase.getEyeHeight() / 2.0f;
final double z = entityLivingBase.posZ;
return getRotationFromPosition(x, y, z);
}
private float[] getRotationFromPosition(final double x, final double y, final double z) {
final double xDiff = x - mc.theWorld.getPlayerEntityByName(master).posX;
final double zDiff = z - mc.theWorld.getPlayerEntityByName(master).posZ;
final double yDiff = y - mc.theWorld.getPlayerEntityByName(master).posY - 1.2;
final double dist = MathHelper.sqrt_double(xDiff * xDiff + zDiff * zDiff);
final float yaw = (float) (Math.atan2(zDiff, xDiff) * 180.0D / Math.PI) - 90.0F;
final float pitch = (float) -(Math.atan2(yDiff, dist) * 180.0D / Math.PI);
return new float[]{yaw, pitch};
}
private void nuke(final double range, final double xPos, final double yPos, final double zPos) {
if (range == 0) {
final BlockPos blockPos = new BlockPos(xPos, yPos, zPos);
final Block block = mc.theWorld.getBlockState(blockPos).getBlock();
if (block instanceof BlockAir || (block.getBlockHardness() > 0 && instantOnly.isEnabled()))
return;
PacketUtil.sendPacketWithoutEvent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, blockPos, EnumFacing.NORTH));
PacketUtil.sendPacketWithoutEvent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, blockPos, EnumFacing.NORTH));
if (swing.isEnabled())
mc.thePlayer.swingItem();
} else {
for (double x = -range; x < range; x++) {
for (double y = range; y > -range; y--) {
for (double z = -range; z < range; z++) {
if (scatter.isEnabled() && !((mc.thePlayer.ticksExisted % 2 == 0 ? x : z) % 2 == 0))
continue;
final BlockPos blockPos = new BlockPos(xPos + x, yPos + y, zPos + z);
final Block block = mc.theWorld.getBlockState(blockPos).getBlock();
if (block instanceof BlockAir || (block.getBlockHardness() > 0 && instantOnly.isEnabled()))
continue;
PacketUtil.sendPacketWithoutEvent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.START_DESTROY_BLOCK, blockPos, EnumFacing.NORTH));
PacketUtil.sendPacketWithoutEvent(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK, blockPos, EnumFacing.NORTH));
if (swing.isEnabled())
mc.thePlayer.swingItem();
}
}
}
}
}
@Override
protected void onEnable() {
if (master.isEmpty())
Rise.addChatMessage("Use the PlayerHacks command to set the target.");
swung = false;
timer.reset();
}
}
// NOTE (AI): S0B is the gate for the aura and nuker: the module only acts for the selected master player after a swing animation from that entity is observed (swung flag, onlyOnSwing setting). The swing is the human-input signal the module waits for before pathfinding the master along a computed route and attacking everything in range with C02 use-entity packets sent on worker threads. It is the only packet the module reads about other players, which is why S0B appears here at all: aura-gating and kill-effect modules use arm swings as their trigger.Joke-module telemetry: penalize the tracked player's social credit score for every observed weapon swing.
handlePacketEvent runs on the packet bus: each S0B with type 0 and the tracked entity id subtracts 50 score for a sword, 10 otherwise; handleUpdate additionally charges 100 for merely holding a tool or sword.
// ===== FILE: Rise 5.99, dev/rise/util/misc/socialcreditscore/SocialCreditScore.java =====
package dev.rise.util.misc.socialcreditscore;
import dev.rise.event.impl.packet.PacketReceiveEvent;
import lombok.Getter;
import net.minecraft.client.entity.EntityOtherPlayerMP;
import net.minecraft.item.Item;
import net.minecraft.item.ItemSword;
import net.minecraft.item.ItemTool;
import net.minecraft.network.play.server.S0BPacketAnimation;
import java.util.HashMap;
@Getter
public class SocialCreditScore {
private int score;
private boolean ownsWeapon;
private EntityOtherPlayerMP entity;
private final HashMap<String, EnumCrimes> crimes = new HashMap<>();
public void handlePacketEvent(final PacketReceiveEvent event) {
if (event.getPacket() instanceof S0BPacketAnimation) {
final S0BPacketAnimation packetAnimation = (S0BPacketAnimation) event.getPacket();
if (packetAnimation.getAnimationType() == 0 && packetAnimation.getEntityID() == entity.getEntityId()) {
score -= entity.getHeldItem().getItem() instanceof ItemSword ? 50 : 10;
// if(!crimes.containsValue(EnumCrimes.ATTACK))
}
}
}
public void handleUpdate() {
if (!ownsWeapon) {
final Item item = entity.getHeldItem().getItem();
if (item instanceof ItemTool || item instanceof ItemSword) {
ownsWeapon = true;
score -= 100;
}
}
}
}
// NOTE (AI): Joke-module telemetry. Every type-0 swing from the tracked entity subtracts 50 score when the entity holds a sword, 10 otherwise, and merely owning a tool or sword costs 100 points. The S0B stream is the only input and the handlePacketEvent is called from the client's packet-receive bus; nothing is mutated or sent. This is the smallest functional S0B consumer in the corpus.Hidden telemetry: timestamp swings and attribute deaths to players who swung within 70 ms of the local player taking damage.
On EventPacket, S0B timestamps are stored per entity id; when S06PacketUpdateHealth shows the local player losing health, any player with a swing under 70 ms old and within 9 blocks is registered as a prosecutor. S08 resets the state as a respawn; S18 teleports and S13 destroy-entities finalize records, and the sendStat bodies are empty in this build.
// ===== FILE: Sigma 4.11, info/sigmaclient/module/impl/other/Ranking.java =====
package info.sigmaclient.module.impl.other;
import info.sigmaclient.Client;
import info.sigmaclient.event.Event;
import info.sigmaclient.event.RegisterEvent;
import info.sigmaclient.event.impl.EventAttack;
import info.sigmaclient.event.impl.EventPacket;
import info.sigmaclient.event.impl.EventUpdate;
import info.sigmaclient.management.users.TTSystem;
import info.sigmaclient.module.Module;
import info.sigmaclient.module.data.ModuleData;
import info.sigmaclient.util.Timer;
import info.sigmaclient.util.misc.ChatUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.*;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
public class Ranking extends Module {
private HashMap<Integer, HitEntity> hitEntities = new HashMap<>();
private HashMap<Integer, HitEntity> prosecutorEntities = new HashMap<>();
private HashMap<Integer, Long> lastAnimationTimestamp = new HashMap<>();
private info.sigmaclient.util.Timer delay = new Timer();
public Ranking(ModuleData data) {
super(data);
setHidden(true);
if (!isEnabled()) {
toggle();
}
}
@Override
@RegisterEvent(events = {EventAttack.class, EventPacket.class, EventUpdate.class})
public void onEvent(Event e) {
if (e instanceof EventAttack) {
EventAttack ea = (EventAttack) e;
if (ea.getEntity() instanceof EntityPlayer) {
EntityPlayer ep = (EntityPlayer) ea.getEntity();
if (!ep.getName().isEmpty()) {
if (!hitEntities.containsKey(ep.getEntityId())) {
hitEntities.put(ep.getEntityId(), new HitEntity(ep));
} else {
hitEntities.get(ep.getEntityId()).refresh();
}
}
}
} else if (e instanceof EventPacket) {
EventPacket ep = (EventPacket) e;
Packet packet = ep.getPacket();
if (packet instanceof S0BPacketAnimation) {
S0BPacketAnimation packetAnimation = (S0BPacketAnimation) packet;
lastAnimationTimestamp.put(packetAnimation.func_148978_c(), System.currentTimeMillis());
}
if (packet instanceof S06PacketUpdateHealth) {
S06PacketUpdateHealth packetUpdateHealth = (S06PacketUpdateHealth) packet;
if (packetUpdateHealth.getHealth() <= Minecraft.getMinecraft().thePlayer.getHealth()) {
try{
for (Object o : mc.theWorld.getLoadedEntityList()) {
if (o instanceof EntityPlayer) {
EntityPlayer entityPlayer = (EntityPlayer) o;
if (!(entityPlayer instanceof EntityPlayerSP) && lastAnimationTimestamp.containsKey(entityPlayer.getEntityId())) {
if (lastAnimationTimestamp.get(entityPlayer.getEntityId()) > System.currentTimeMillis() - 70 && entityPlayer.getPositionVector().squareDistanceTo(Minecraft.getMinecraft().thePlayer.getPositionVector()) < 9 * 9) {
if (!prosecutorEntities.containsKey(entityPlayer.getEntityId())) {
prosecutorEntities.put(entityPlayer.getEntityId(), new HitEntity(entityPlayer, true));
} else {
prosecutorEntities.get(entityPlayer.getEntityId()).refresh();
}
}
}
}
}
}catch(ConcurrentModificationException ee){};
}
if (packetUpdateHealth.getHealth() <= 0) {
onDeath();
}
}
if (packet instanceof S02PacketChat) {
S02PacketChat packetChat = (S02PacketChat) packet;
String message = packetChat.func_148915_c().getUnformattedText();
Iterator it = hitEntities.entrySet().iterator();
while (it.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000 && message.contains(hitEntity.getName())) {
if (hitEntity.onChatMessage()) {
it.remove();
}
}
}
Iterator it2 = prosecutorEntities.entrySet().iterator();
while (it2.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it2.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000 && message.contains(hitEntity.getName()) && message.contains(Minecraft.getMinecraft().thePlayer.getName())) {
if (hitEntity.onChatMessage()) {
it2.remove();
}
}
}
} else if (packet instanceof S18PacketEntityTeleport) {
S18PacketEntityTeleport packetTeleport = (S18PacketEntityTeleport) packet;
int entityId = packetTeleport.func_149451_c();
onEntityRemoved(entityId);
} else if (packet instanceof S08PacketPlayerPosLook) {
onDeath();
} else if (packet instanceof S13PacketDestroyEntities) {
S13PacketDestroyEntities packetDestroyEntities = (S13PacketDestroyEntities) packet;
for (int entityId : packetDestroyEntities.func_149098_c()) {
onEntityRemoved(entityId);
}
} else if (packet instanceof S40PacketDisconnect) {
S40PacketDisconnect packetDisconnect = (S40PacketDisconnect) packet;
if (packetDisconnect.func_149165_c().getUnformattedText().toLowerCase().contains("ban") && Minecraft.getMinecraft().thePlayer != null && Minecraft.getMinecraft().thePlayer.ticksExisted > 15 * 20) {
sendStat("ban", "");
}
}
} else if (e instanceof EventUpdate) {
if (delay.delay(1000 * 60 * 10)) {
delay.reset();
sendStat("tick", "");
}
}
}
private void onDeath() {
Iterator it2 = prosecutorEntities.entrySet().iterator();
while (it2.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it2.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000) {
if (hitEntity.onRemoved()) {
it2.remove();
}
}
}
}
private void onEntityRemoved(int entityId) {
Iterator it = hitEntities.entrySet().iterator();
while (it.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000 && entityId == hitEntity.getEntityId()) {
if (hitEntity.onRemoved()) {
it.remove();
}
}
}
}
public void sendStat(String type, String data) {
}
private class HitEntity {
private long time = System.currentTimeMillis();
private UUID uuid;
private String name;
private int entityId;
private boolean removed = false;
private boolean chatMessage = false;
private boolean prosecutor = false;
public HitEntity(EntityPlayer ep) {
uuid = ep.getUniqueID();
name = ep.getName();
entityId = ep.getEntityId();
}
public HitEntity(EntityPlayer ep, boolean prosecutor) {
uuid = ep.getUniqueID();
name = ep.getName();
entityId = ep.getEntityId();
this.prosecutor = prosecutor;
}
public boolean onRemoved() {
removed = true;
if (chatMessage) {
if (prosecutor) {
prosecuted();
} else {
killed();
}
return true;
}
return false;
}
public boolean onChatMessage() {
chatMessage = true;
if (removed) {
if (prosecutor) {
prosecuted();
} else {
killed();
}
return true;
}
return false;
}
private void killed() {
//ChatUtil.printChat("Kill (" + name + ") " + uuid.toString());
sendStat("kill", "&uuid=" + uuid.toString().replaceAll("-", ""));
}
public void refresh() {
time = System.currentTimeMillis();
}
public String getName() {
return name;
}
public long getTime() {
return time;
}
public int getEntityId() {
return entityId;
}
public void prosecuted() {
//ChatUtil.printChat("Prosecuted (" + name + ") " + uuid.toString());
sendStat("death", "&uuid=" + uuid.toString().replaceAll("-", ""));
}
}
}
// NOTE (AI): Sigma's hidden telemetry module. S0B swing packets are timestamped per entity id; when S06PacketUpdateHealth shows the local player losing health, any player whose swing is under 70 ms old and within 9 blocks is registered as a prosecutor (attacker). Deaths are attributed through chat messages, S18 teleports and S13 destroy-entities finalize kill and death records, and S08 is treated as a respawn that resets the prosecutor list. The sendStat() bodies are empty in this build, so the HTTP kill-reporting was stripped, but the 70 ms swing-window attribution is intact and is the only combat-logging use of S0B in the corpus.Rise's own client-side autoclicker check: verify that the local player's swings are consistent with its movement packet stream.
Counts S0B packets whose entity id is the local player, then on each relative-move packet compares the count: more than 3 swings per movement packet with a warmed buffer fails the check; otherwise the buffer decays after one second.
// ===== FILE: Rise 5.99, dev/rise/anticheat/check/impl/combat/autoclicker/AutoClickerA.java =====
package dev.rise.anticheat.check.impl.combat.autoclicker;
import dev.rise.anticheat.check.Check;
import dev.rise.anticheat.check.api.CheckInfo;
import dev.rise.anticheat.data.PlayerData;
import dev.rise.anticheat.util.PacketUtil;
import dev.rise.util.math.TimeUtil;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S0BPacketAnimation;
@CheckInfo(name = "AutoClicker", type = "A", description = "Detects clicking too fast")
public final class AutoClickerA extends Check {
private final TimeUtil timer = new TimeUtil();
private int swings;
public AutoClickerA(final PlayerData data) {
super(data);
}
@Override
public void handle(final Packet<?> packet) {
if (packet instanceof S0BPacketAnimation) {
final S0BPacketAnimation wrapper = (S0BPacketAnimation) packet;
if (wrapper.getEntityID() == data.getPlayer().getEntityId())
swings++;
}
if (PacketUtil.isRelMove(packet)) {
if (swings > 3) {
if (getBuffer() >= 3)
fail();
increaseBuffer();
timer.reset();
} else if (timer.hasReached(1000L)) {
decreaseBuffer();
timer.reset();
}
swings = 0;
}
}
}
// NOTE (AI): Not a cheat module: this is Rise 5.99's own client-side anticheat. The check counts S0B swing packets whose entity id is the local player and compares them against relative-move packets: more than 3 swings per movement packet with a warmed buffer fails the AutoClicker check. It demonstrates that S0B is the swing ground truth the whole ecosystem, cheats and anti-cheats alike, keys on. KeepSprintA is the sibling check in the same package, coupling swings to sprint state to catch keepsprint cheats.Feed S0B swing events into the bot detector: entities that never produce a type-0 swing become bot candidates.
The onPacket handler checks the packet class, reads the animation entity id and appends it to a swing list when the type byte is 0. The static isBot() consult used by KillAura and other modules flags an entity when the Swing setting is enabled and the id is absent from the swing list. The same handler tracks S14 relative moves for ground and air state, and the list is cleared only on world change or module disable.
// ===== 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): LiquidSense's AntiBot consumes S0B as bot-detection telemetry. The onPacket handler (lines 276-282) records every type-0 animation's entity id into the swing list, and the static isBot() check consults that list when the Swing setting is enabled: an entity that has never swung is flagged. The same handler tracks S14 relative moves for ground and air state, which feed the Ground and Air bot checks. The swing recording is append-only per entity id and cleared only on world change or module disable, so an entity that swings once is never re-flagged. This is the only packet-level telemetry in the module; the rest of the detection runs on the per-tick entity list scan in onUpdate, which removes flagged bots from the world when BotKiller is on.anticheat Anti-Cheat Checks
S0B is the server-to-client animation broadcast, and the swing type (0) is the only animation a player emits at click rate, which makes it the one reliable signal that another player is attacking. Server-side anticheats cannot read the client's own swing inside S0B because it is outbound, so the swing checks in this corpus consume the inbound arm-animation packet (C0A, PacketPlayInArmAnimation) that the client sends on every left click, plus the outbound S0B on the few checks that listen on the send side. The corpus splits into no-swing validators (NCP fight NoSwing, Grim NoSwingBreak, ThotPatrol NoSwingA, MIU NoSwing), autoclicker statistics over the swing stream (Frequency AutoClickerA, Hydro AutoClickerA-D, Kauri AutoclickerA-D, Artemis AutoClickerA-M, Salmon SwingA), and packet-order rules that demand a swing after every attack (Grim Post and PacketOrderB, Photon PacketAnalysisAnimation, Truthful PacketOrderA/D).
Require an arm swing between attacks so that damage without the arm-animation packet is flagged.
FightListener invokes check() on the Bukkit PlayerAnimationEvent that mirrors the inbound arm-animation packet. A counter increments per attack: when a swing arrives first, the violation level decays by a factor of 0.9; when an attack arrives without a swing, 1 violation level is added and the configured actions run, cancelling the attack once the threshold is crossed.
// ===== FILE: Updated-NoCheatPlus-NoCheatPlus, NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/fight/NoSwing.java =====
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.checks.fight;
import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.checks.Check;
import fr.neatmonster.nocheatplus.checks.CheckType;
/**
* We require that the player moves their arm between attacks, this is basically what gets checked here.
*/
public class NoSwing extends Check {
/**
* Instantiates a new no swing check.
*/
public NoSwing() {
super(CheckType.FIGHT_NOSWING);
}
/**
* Checks a player.
*
* @param player
* the player
* @return true, if successful
*/
public boolean check(final Player player, final FightData data, final FightConfig cc) {
boolean cancel = false;
if (data.exemptArmSwing) {
data.exemptArmSwing = false;
}
// Did they swing his arm before?
else if (++data.noSwingCount <= 1) {
// Yes, reward them with reduction of their violation level.
data.noSwingVL *= 0.9D;
}
else {
data.noSwingCount = 0;
// No, increase their violation level.
data.noSwingVL += 1D;
// Execute whatever actions are associated with this check and the violation level and find out if we should
// cancel the event.
cancel = executeActions(player, data.noSwingVL, 1D, cc.noSwingActions).willCancel();
}
return cancel;
}
}
// NOTE (AI): NCP runs the same NoSwing pattern for block break and block place; this combat instance is fed from PlayerAnimationEvent, so the swing requirement is enforced per attack.Verify that a swing animation accompanies block digging, flagging diggers that never swing.
Registers as both a BlockBreakListener and a PreViaPacketReceiveListener. onBlockBreak sets sentBreak for any dig action that is not a cancel; onPreViaPacketReceive sets sentAnimation when Play.Client.ANIMATION arrives; on the next tick packet the check flags if a break was recorded without an animation. Both flags reset every tick, so the swing must land inside the same tick as the dig start. The check is marked experimental.
// ===== FILE: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/checks/impl/breaking/NoSwingBreak.java =====
package ac.grim.grimac.checks.impl.breaking;
import ac.grim.grimac.checks.Check;
import ac.grim.grimac.checks.CheckData;
import ac.grim.grimac.checks.type.BlockBreakListener;
import ac.grim.grimac.checks.type.PreViaPacketReceiveListener;
import ac.grim.grimac.player.GrimPlayer;
import ac.grim.grimac.utils.anticheat.update.BlockBreak;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.player.DiggingAction;
@CheckData(name = "NoSwingBreak", stableKey = "grim.breaking.no_swing_break", description = "Did not swing while breaking block", experimental = true)
public class NoSwingBreak extends Check implements BlockBreakListener, PreViaPacketReceiveListener {
private boolean sentAnimation;
private boolean sentBreak;
public NoSwingBreak(GrimPlayer playerData) {
super(playerData);
}
@Override
public void onBlockBreak(BlockBreak blockBreak) {
if (blockBreak.action != DiggingAction.CANCELLED_DIGGING) {
sentBreak = true;
}
}
@Override
public void onPreViaPacketReceive(PacketReceiveEvent event) {
if (event.getPacketType() == PacketType.Play.Client.ANIMATION) {
sentAnimation = true;
}
if (isTickPacket(event.getPacketType())) {
if (sentBreak && !sentAnimation) {
flag();
}
sentAnimation = sentBreak = false;
}
}
}
// NOTE (AI): Grim's Post check covers the inverse relationship on the outbound side: it reads the server's entity-animation packet (S0B) and exempts the player from swing-order requirements when ViaVersion injects swings.Statistical autoclicker check over the arm-animation stream: human click timing must vary.
PacketCheck on WrappedPlayInArmAnimation: while CPS is above 6.5 and the player is not digging or placing, the number of movement packets between swings is sampled. After 20 samples the check computes the standard deviation and the outlier count; a deviation below 2 with fewer than 2 outliers fails. Constant-interval autoclickers produce near-zero variance and trip the check.
// ===== FILE: ElevatedDev-Frequency, src/main/java/xyz/elevated/frequency/check/impl/autoclicker/AutoClickerA.java =====
package xyz.elevated.frequency.check.impl.autoclicker;
import com.google.common.collect.Lists;
import xyz.elevated.frequency.check.CheckData;
import xyz.elevated.frequency.check.type.PacketCheck;
import xyz.elevated.frequency.data.PlayerData;
import xyz.elevated.frequency.util.MathUtil;
import xyz.elevated.frequency.util.Pair;
import xyz.elevated.frequency.wrapper.impl.client.WrappedPlayInArmAnimation;
import xyz.elevated.frequency.wrapper.impl.client.WrappedPlayInFlying;
import java.util.Deque;
import java.util.List;
@CheckData(name = "AutoClicker (A)")
public final class AutoClickerA extends PacketCheck {
private int movements = 0;
private final Deque<Integer> samples = Lists.newLinkedList();
public AutoClickerA(final PlayerData playerData) {
super(playerData);
}
@Override
public void process(final Object object) {
if (object instanceof WrappedPlayInArmAnimation) {
final boolean valid = playerData.getCps().get() > 6.5
&& movements < 4 && !playerData.getActionManager().getDigging().get() && !playerData.getActionManager().getPlacing().get();
// If the movement are not incredibly low and the player isn't digging
if (valid) samples.add(movements);
if (samples.size() == 20) {
// Get the outliers properly from the math utility
final Pair<List<Double>, List<Double>> outlierPair = MathUtil.getOutliers(samples);
// Get the deviation from the math utility and the outliers
final double deviation = MathUtil.getStandardDeviation(samples);
final double outliers = outlierPair.getX().size() + outlierPair.getY().size();
// Low deviation and low outliers
if (deviation < 2.d && outliers < 2) fail();
// Clear the list
samples.clear();
}
// Reset the movements
movements = 0;
} else if (object instanceof WrappedPlayInFlying) {
++movements;
}
}
}
// NOTE (AI): Frequency is the 1.8-generation base that FrequencyPlus and Degrade fork; all three register the same WrappedPlayInArmAnimation handler.Enforce the client's own attack sequence: an arm animation must directly follow an attack.
Listens to INTERACT_ENTITY and ANIMATION at LOW priority. An attack on an entity sets a packetAnalysisAnimationExpected flag; the next ANIMATION clears it; if another attack arrives while the flag is still set, the previous attack never produced a swing and the module flags with +30 violation level under a decaying violation management. Disabled on 1.8 servers, where ViaVersion reorders animations.
// ===== FILE: Photon-GitHub-AntiCheatAddition, src/main/java/de/photon/anticheataddition/modules/checks/packetanalysis/PacketAnalysisAnimation.java =====
package de.photon.anticheataddition.modules.checks.packetanalysis;
import com.github.retrooper.packetevents.event.PacketListenerPriority;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientInteractEntity;
import de.photon.anticheataddition.ServerVersion;
import de.photon.anticheataddition.modules.ModuleLoader;
import de.photon.anticheataddition.modules.ViolationModule;
import de.photon.anticheataddition.util.protocol.PacketAdapterBuilder;
import de.photon.anticheataddition.util.violationlevels.Flag;
import de.photon.anticheataddition.util.violationlevels.ViolationLevelManagement;
import de.photon.anticheataddition.util.violationlevels.ViolationManagement;
public final class PacketAnalysisAnimation extends ViolationModule
{
public static final PacketAnalysisAnimation INSTANCE = new PacketAnalysisAnimation();
private PacketAnalysisAnimation()
{
super("PacketAnalysis.parts.Animation");
}
@Override
protected ViolationManagement createViolationManagement()
{
return ViolationLevelManagement.builder(this)
.emptyThresholdManagement()
.withDecay(200, 2).build();
}
@Override
protected ModuleLoader createModuleLoader()
{
/* Protocol:
* 1) Player left clicks
* 2) Entity use packet with attack.
* 3) Arm Animation packet.
* */
final var packetAdapter = PacketAdapterBuilder
.of(this, PacketType.Play.Client.INTERACT_ENTITY, PacketType.Play.Client.ANIMATION)
.priority(PacketListenerPriority.LOW)
.onReceiving((event, user) -> {
final var packetType = event.getPacketType();
final var boolData = user.getData().bool;
if (packetType == PacketType.Play.Client.ANIMATION) boolData.packetAnalysisAnimationExpected = false;
else if (packetType == PacketType.Play.Client.INTERACT_ENTITY) {
// Expected Animation after attack, but didn't arrive.
if (boolData.packetAnalysisAnimationExpected) {
boolData.packetAnalysisAnimationExpected = false;
getManagement().flag(Flag.of(user).setAddedVl(30).setDebug(() -> "PacketAnalysisData-Debug | Player: " + user.getPlayer().getName() + " did not send animation packet after an attack."));
}
// Make sure an arm animation packet is sent directly after an attack as it is the next packet in the client code.
final var wrapper = new WrapperPlayClientInteractEntity(event);
if (wrapper.getAction() == WrapperPlayClientInteractEntity.InteractAction.ATTACK) boolData.packetAnalysisAnimationExpected = true;
}
}).build();
return ModuleLoader.builder(this)
.setAllowedServerVersions(ServerVersion.NON_188_VERSIONS)
.addPacketListeners(packetAdapter)
.build();
}
}
// NOTE (AI): The module is one part of Photon's PacketAnalysis family, which also covers aim-step and equal-rotation patterns.Verify that action packets arrive inside the expected movement tick, and consume the outbound S0B swing to exempt injected animations.
On the send side, WrapperPlayServerEntityAnimation (the S0B packet) for the player's own entity id records the current transaction when the type is SWING_MAIN_ARM or SWING_OFF_HAND. On the receive side, action packets (attack, dig, place, animation, interact) that arrive after a flying packet are queued, and a transaction boundary with queued packets flags a post violation through the prediction pipeline. The swing exemption keeps ViaVersion-injected animations from falsing the check.
// ===== FILE: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/checks/impl/misc/Post.java =====
package ac.grim.grimac.checks.impl.misc;
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.checks.type.PostPredictionListener;
import ac.grim.grimac.checks.type.PostPredictionListener;
import ac.grim.grimac.player.GrimPlayer;
import ac.grim.grimac.utils.anticheat.update.PredictionComplete;
import ac.grim.grimac.utils.lists.EvictingQueue;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.protocol.packettype.PacketTypeCommon;
import com.github.retrooper.packetevents.protocol.player.ClientVersion;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientEntityAction;
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityAnimation;
import java.util.ArrayDeque;
import java.util.List;
import java.util.Locale;
import static com.github.retrooper.packetevents.protocol.packettype.PacketType.Play.Client.*;
@CheckData(name = "Post", stableKey = "grim.post.invalid_order", description = "Sent packets out of the expected movement tick order")
public class Post extends Check implements PacketReceiveListener, PacketSendListener, PostPredictionListener {
private static final Verbose V = Verbose.of("{str}");
private final ArrayDeque<PacketTypeCommon> post = new ArrayDeque<>();
// Due to 1.9+ missing the idle packet, we must queue flags
// 1.8 clients will have the same logic for simplicity, although it's not needed
private final List<String> flags = new EvictingQueue<>(10);
private boolean sentFlying = false;
private int isExemptFromSwingingCheck = Integer.MIN_VALUE;
public Post(GrimPlayer playerData) {
super(playerData);
}
@Override
public void onPredictionComplete(final PredictionComplete predictionComplete) {
if (flags.isEmpty()) {
return;
}
// Okay, the user might be cheating, let's double check
// 1.8 clients have the idle packet, and this shouldn't false on 1.8 clients
// 1.9+ clients have predictions, which will determine if hidden tick skipping occurred
if (player.isTickingReliablyFor(3)) {
for (String flag : flags) {
flag(V.write(verbose()).str(flag));
}
}
flags.clear();
}
@Override
public void onPacketSend(final PacketSendEvent event) {
if (event.getPacketType() == PacketType.Play.Server.ENTITY_ANIMATION) {
WrapperPlayServerEntityAnimation animation = new WrapperPlayServerEntityAnimation(event);
if (animation.getEntityId() == player.entityID) {
if (animation.getType() == WrapperPlayServerEntityAnimation.EntityAnimationType.SWING_MAIN_ARM ||
animation.getType() == WrapperPlayServerEntityAnimation.EntityAnimationType.SWING_OFF_HAND) {
isExemptFromSwingingCheck = player.lastTransactionSent.get();
}
}
}
}
@Override
public void onPacketReceive(final PacketReceiveEvent event) {
if (isTickPacket(event.getPacketType())) { // Don't count teleports or duplicates as movements
post.clear();
sentFlying = true;
return;
}
// 1.13+ clients can click inventory outside tick loop, so we can't post check those two packets on 1.13+
PacketTypeCommon packetType = event.getPacketType();
if (isTransaction(packetType) && player.packetStateData.lastTransactionPacketWasValid) {
if (sentFlying && !post.isEmpty()) {
flags.add(post.getFirst().toString().toLowerCase(Locale.ROOT).replace("_", " ") + " v" + player.getClientVersion().getReleaseName());
}
post.clear();
sentFlying = false;
return;
}
if (!sentFlying) {
return;
}
if (PLAYER_ABILITIES.equals(packetType)
|| (HELD_ITEM_CHANGE.equals(packetType) && player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_8))
|| INTERACT_ENTITY.equals(packetType) || PLAYER_BLOCK_PLACEMENT.equals(packetType)
|| ATTACK.equals(packetType) || SPECTATE_ENTITY.equals(packetType)
|| USE_ITEM.equals(packetType) || PLAYER_DIGGING.equals(packetType)) {
post.add(event.getPacketType());
} else if (CLICK_WINDOW.equals(packetType) && player.getClientVersion().isOlderThan(ClientVersion.V_1_13)) {
// Why do 1.13+ players send the click window packet whenever? This doesn't make sense.
post.add(event.getPacketType());
} else if (ANIMATION.equals(packetType)
&& (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_9) // ViaVersion delays animations for 1.8 clients
|| PacketEvents.getAPI().getServerManager().getVersion().isOlderThanOrEquals(ServerVersion.V_1_8_8)) // when on 1.9+ servers
&& player.getClientVersion().isOlderThan(ClientVersion.V_1_13) // 1.13 clicking inventory causes weird animations
&& isExemptFromSwingingCheck < player.lastTransactionReceived.get()) { // Exempt when the server sends animations because viaversion
post.add(event.getPacketType());
} else if (ENTITY_ACTION.equals(packetType) // ViaRewind sends START_FALL_FLYING packets async for 1.8 clients on 1.9+ servers
&& (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_9) || new WrapperPlayClientEntityAction(event).getAction() != WrapperPlayClientEntityAction.Action.START_FLYING_WITH_ELYTRA)) {
// https://github.com/GrimAnticheat/Grim/issues/824
if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_19_3) && player.inVehicle()) {
return;
}
if (player.getClientVersion().isNewerThanOrEquals(ClientVersion.V_1_13) && new WrapperPlayClientEntityAction(event).getAction() == WrapperPlayClientEntityAction.Action.LEAVE_BED)
return;
post.add(event.getPacketType());
}
}
}
// NOTE (AI): Post is the only check in the corpus that reads the outbound S0B entity-animation packet directly.Related Packets
Wiki Cross-Reference
PLAY id 0x0B: VarInt entityId plus unsigned-byte type; 1.8.9 types are 0 swing, 1 hurt, 2 leave bed, 3 eat, 4 crit, 5 magic crit.
Type 0 is the only click-rate signal, so swing counters, AntiBot swing sets and combat attribution all key on it.
MCP 1.8.9 S0BPacketAnimation implements Packet
1.8.9 callers: EntityLivingBase.swingItem sends new S0BPacketAnimation (line 1351) +1 more: https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/entity/EntityLivingBase.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 S0BPacketAnimation
Full source walkthroughs of the modules and anti-cheats that use this packet.