Sigma 4.11 BowAimbot module 2 files, 301 lines

Sigma 4.11 BowAimbot: Full Source Analysis

Sigma 4.11's BowAimbot is a pre-fire aim predictor for bows.

info/sigmaclient/module/impl/combat/BowAimbot.java · GitHub source ↗

Published 2026-08-12 · Updated 2026-08-12

Packets This Module Uses

Analysis

Overview

Sigma 4.11's BowAimbot is a pre-fire aim predictor for bows. On the pre phase of EventUpdate it picks a target from the loaded entity list, and when a bow is drawn it computes predicted aim angles with RotationUtils.getBowAngles, which extrapolates the target's velocity forward, scales the extrapolation by the distance in 0.8-block steps with a 1.25 sprint multiplier, and compensates the pitch arc with a distance-scaled offset. The angles are written into the EventUpdate's yaw and pitch when the SILENT setting is on, so they ride the next C03 movement packet without moving the visible view, or straight into the player rotation when it is off. The server computes the arrow trajectory from the player's position and look at release time, so the predicted angles in the movement packet before the C07 RELEASE_USE_ITEM determine where the arrow flies.

Architecture

The module registers for EventUpdate and EventPacket but only implements the update path. onEvent runs in the pre phase: it refreshes the target field with getTarg(), and when shouldAim() passes it computes RotationUtils.getBowAngles(target) and either writes the angles into the event (SILENT, server-sided rotations) or sets the real player rotation. onDisable nulls the target. The SILENT setting is the only configuration, defaulting to true. The EventPacket registration is vestigial in this snapshot; no packet handler body exists in the class.

Prediction model (getBowAngles)

The aim math lives in RotationUtils.getBowAngles. It reads the target's per-tick velocity from posX minus lastTickPosX and posZ minus lastTickPosZ, scales it by 0.4, quantizes the distance to the target down to the nearest 0.8-block step, and multiplies the velocity by d over 0.8 and by 1.25 when the target is sprinting, producing an extrapolated aim point ahead of the moving target. Yaw comes from atan2 of the aim offset, and pitch from atan2 of the vertical difference, with the eye height of both entities, plus a dist times 0.11 gravity arc correction. The returned array is yaw then the negated pitch, which the module applies directly.

Target selection and firing path

getTarg scans the loaded entity list for EntityLivingBase players that are not the local player, visible via canEntityBeSeen, within 65 blocks, and not friends, with Killaura.vip short-circuiting the selection, then sorts the survivors by summed yaw and pitch angular distance to the current rotation. shouldAim requires a bow in the current slot and either the FastBow module enabled with the use key held, or the player already using the item. The release itself is the vanilla C07 RELEASE_USE_ITEM, timed by the player or FastBow; the aimbot only guarantees the look carried by the preceding C03 points at the predicted position, so the arrow's server-side trajectory starts on target.

source BowAimbot.java (module)

BowAimbot.java104 lines · JavaOriginal ↗
1
/**
2
 * Time: 10:13:34 PM
3
 * Date: Jan 5, 2017
4
 * Creator: cool1
5
 */
6
package info.sigmaclient.module.impl.combat;
7
8
import java.util.ArrayList;
9
import java.util.List;
10
11
import info.sigmaclient.Client;
12
import info.sigmaclient.event.Event;
13
import info.sigmaclient.event.impl.EventPacket;
14
import info.sigmaclient.module.data.ModuleData;
15
import info.sigmaclient.module.data.Setting;
16
import info.sigmaclient.event.RegisterEvent;
17
import info.sigmaclient.event.impl.EventUpdate;
18
import info.sigmaclient.management.friend.FriendManager;
19
import info.sigmaclient.module.Module;
20
import info.sigmaclient.util.RotationUtils;
21
import net.minecraft.entity.EntityLivingBase;
22
import net.minecraft.entity.player.EntityPlayer;
23
import net.minecraft.item.ItemBow;
24
25
/**
26
 * @author cool1
27
 */
28
public class BowAimbot extends Module {
29
30
    boolean send, isFiring;
31
    public static final String SILENT = "SILENT";
32
    public static EntityLivingBase target;
33
    public BowAimbot(ModuleData data) {
34
        super(data);
35
36
		settings.put(SILENT, new Setting<>(SILENT, true, "Server-sided rotations."));
37
   
38
    }
39
40
    @Override
41
    public void onDisable(){
42
    	target = null;
43
    }
44
    @Override
45
    @RegisterEvent(events = {EventUpdate.class, EventPacket.class})
46
    public void onEvent(Event event) {
47
        if (event instanceof EventUpdate) {
48
            EventUpdate em = (EventUpdate) event;
49
            if (em.isPre()) {
50
               target = getTarg();
51
                if(shouldAim()){
52
                    if (target != null) {
53
                        float[] rotations = RotationUtils.getBowAngles(target);
54
                        boolean silent = (Boolean) settings.get(SILENT).getValue();
55
                        if(silent){
56
                        	em.setYaw(rotations[0]);
57
                        	em.setPitch(rotations[1]);
58
                        }else{
59
                        	mc.thePlayer.rotationYaw = rotations[0];
60
                        	mc.thePlayer.rotationPitch = rotations[1];
61
                        }
62
                    }
63
                }
64
            }
65
        }
66
    }
67
    public static boolean shouldAim(){
68
    	if(mc.thePlayer.inventory.getCurrentItem() == null || !(mc.thePlayer.inventory.getCurrentItem().getItem() instanceof ItemBow))
69
    		return false;
70
    	if(Client.getModuleManager().get(FastBow.class).isEnabled() && mc.gameSettings.keyBindUseItem.pressed)
71
    		return true;
72
    	if(mc.thePlayer.isUsingItem())
73
            return true;
74
    	return false;
75
    }
76
    private EntityLivingBase getTarg() {
77
        List<EntityLivingBase> loaded = new ArrayList();
78
        for (Object o : mc.theWorld.getLoadedEntityList()) {
79
            if (o instanceof EntityLivingBase) {
80
                EntityLivingBase ent = (EntityLivingBase) o;
81
                if (ent instanceof EntityPlayer && ent != mc.thePlayer && mc.thePlayer.canEntityBeSeen(ent) && mc.thePlayer.getDistanceToEntity(ent) < 65 && !FriendManager.isFriend(ent.getName())) {
82
                    if (ent == Killaura.vip) {
83
                        return ent;
84
                    }
85
                    loaded.add(ent);
86
                }
87
            }
88
        }
89
        if (loaded.isEmpty()) {
90
            return null;
91
        }
92
        loaded.sort((o1, o2) -> {
93
            float[] rot1 = RotationUtils.getRotations(o1);
94
            float[] rot2 = RotationUtils.getRotations(o2);
95
            return (int) ((RotationUtils.getDistanceBetweenAngles(mc.thePlayer.rotationYaw, rot1[0])
96
                    + RotationUtils.getDistanceBetweenAngles(mc.thePlayer.rotationPitch, rot1[1]))
97
                    - (RotationUtils.getDistanceBetweenAngles(mc.thePlayer.rotationYaw, rot2[0])
98
                    + RotationUtils.getDistanceBetweenAngles(mc.thePlayer.rotationPitch, rot2[1])));
99
        });
100
        EntityLivingBase target = loaded.get(0);
101
        return target;
102
    }
103
104
}

What this file does

The module is a single EventUpdate pre handler plus the selection helper. onEvent refreshes the target and applies the rotation, either into the event's yaw and pitch for silent server-sided rotation or directly onto the player for the visible mode. getTarg implements the distance, visibility, friend and Killaura.vip filters and the angular sort; shouldAim gates on the bow item, the FastBow combination, and the using-item state. The class shows the module's limits: no release packet is sent by the aimbot itself, and the bow shot depends on the vanilla release flow, so the module's only output is the rotation carried by the movement stream.

source RotationUtils.java (prediction math)

RotationUtils.java197 lines · JavaOriginal ↗
1
package info.sigmaclient.util;
2
3
import info.sigmaclient.util.misc.ChatUtil;
4
5
import java.util.List;
6
import java.util.Objects;
7
8
import net.minecraft.client.Minecraft;
9
import net.minecraft.entity.Entity;
10
import net.minecraft.entity.EntityLivingBase;
11
import net.minecraft.entity.player.EntityPlayer;
12
import net.minecraft.util.AxisAlignedBB;
13
import net.minecraft.util.MathHelper;
14
import net.minecraft.util.Vec3;
15
16
public class RotationUtils {
17
	static Minecraft mc = Minecraft.getMinecraft();
18
    public static float[] getRotations(EntityLivingBase ent) {
19
        double x = ent.posX;
20
        double z = ent.posZ;
21
        double y = ent.posY + ent.getEyeHeight() / 2.0F;
22
        return getRotationFromPosition(x, z, y);
23
    }
24
    public static float[] getPredictedRotations(EntityLivingBase ent) {
25
        double x = ent.posX + (ent.posX - ent.lastTickPosX);
26
        double z = ent.posZ + (ent.posZ - ent.lastTickPosZ);
27
        double y = ent.posY + ent.getEyeHeight() / 2.0F;
28
        return getRotationFromPosition(x, z, y);
29
    }
30
    public static float[] getAverageRotations(List<EntityLivingBase> targetList) {
31
        double posX = 0.0D;
32
        double posY = 0.0D;
33
        double posZ = 0.0D;
34
        for (Entity ent : targetList) {
35
            posX += ent.posX;
36
            posY += ent.boundingBox.maxY - 2.0D;
37
            posZ += ent.posZ;
38
        }
39
        posX /= targetList.size();
40
        posY /= targetList.size();
41
        posZ /= targetList.size();
42
43
        return new float[]{getRotationFromPosition(posX, posZ, posY)[0], getRotationFromPosition(posX, posZ, posY)[1]};
44
    }
45
    public static float getStraitYaw(){
46
    	float YAW = MathHelper.wrapAngleTo180_float(mc.thePlayer.rotationYaw);
47
    	if(YAW < 45 && YAW > -45){
48
			YAW = 0;
49
		}else if(YAW > 45 && YAW < 135){
50
			YAW = 90f;
51
		}else if(YAW > 135 || YAW < -135){
52
			YAW = 180;
53
		}else{
54
			YAW = -90f;
55
		}	 
56
    	return YAW;
57
    }
58
    public static float[] getBowAngles(final Entity entity) {
59
        final double xDelta = (entity.posX - entity.lastTickPosX) * 0.4;
60
        final double zDelta = (entity.posZ - entity.lastTickPosZ) * 0.4;
61
        double d = Minecraft.getMinecraft().thePlayer.getDistanceToEntity(entity);
62
        d -= d % 0.8;
63
        double xMulti = 1.0;
64
        double zMulti = 1.0;
65
        final boolean sprint = entity.isSprinting();
66
        xMulti = d / 0.8 * xDelta * (sprint ? 1.25 : 1.0);
67
        zMulti = d / 0.8 * zDelta * (sprint ? 1.25 : 1.0);
68
        final double x = entity.posX + xMulti - Minecraft.getMinecraft().thePlayer.posX;
69
        final double z = entity.posZ + zMulti - Minecraft.getMinecraft().thePlayer.posZ;
70
        final double y = Minecraft.getMinecraft().thePlayer.posY + Minecraft.getMinecraft().thePlayer.getEyeHeight() - (entity.posY + entity.getEyeHeight());
71
        final double dist = Minecraft.getMinecraft().thePlayer.getDistanceToEntity(entity);
72
        final float yaw = (float) Math.toDegrees(Math.atan2(z, x)) - 90.0f;
73
		double d1 = MathHelper.sqrt_double(x * x + z * z);
74
        final float pitch =  (float) - (Math.atan2(y, d1) * 180.0D / Math.PI) + (float)dist*0.11f;
75
        
76
        return new float[]{yaw, -pitch};
77
    }
78
79
    public static float[] getRotationFromPosition(double x, double z, double y) {
80
        double xDiff = x - Minecraft.getMinecraft().thePlayer.posX;
81
        double zDiff = z - Minecraft.getMinecraft().thePlayer.posZ;
82
        double yDiff = y - Minecraft.getMinecraft().thePlayer.posY - 1.2;
83
84
        double dist = MathHelper.sqrt_double(xDiff * xDiff + zDiff * zDiff);
85
        float yaw = (float) (Math.atan2(zDiff, xDiff) * 180.0D / 3.141592653589793D) - 90.0F;
86
        float pitch = (float) -(Math.atan2(yDiff, dist) * 180.0D / 3.141592653589793D);
87
        return new float[]{yaw, pitch};
88
    }
89
90
    public static float getTrajAngleSolutionLow(float d3, float d1, float velocity) {
91
        float g = 0.006F;
92
        float sqrt = velocity * velocity * velocity * velocity - g * (g * (d3 * d3) + 2.0F * d1 * (velocity * velocity));
93
        return (float) Math.toDegrees(Math.atan((velocity * velocity - Math.sqrt(sqrt)) / (g * d3)));
94
    }
95
96
    public static float getYawChange(float yaw, double posX, double posZ) {
97
        double deltaX = posX - Minecraft.getMinecraft().thePlayer.posX;
98
        double deltaZ = posZ - Minecraft.getMinecraft().thePlayer.posZ;
99
        double yawToEntity = 0;
100
        if ((deltaZ < 0.0D) && (deltaX < 0.0D)) {
101
        	if(deltaX != 0)
102
            yawToEntity = 90.0D + Math.toDegrees(Math.atan(deltaZ / deltaX));
103
        } else if ((deltaZ < 0.0D) && (deltaX > 0.0D)) {
104
        	if(deltaX != 0)
105
            yawToEntity = -90.0D + Math.toDegrees(Math.atan(deltaZ / deltaX));
106
        } else {
107
        	if(deltaZ != 0)
108
            yawToEntity = Math.toDegrees(-Math.atan(deltaX / deltaZ));
109
        }
110
111
        return MathHelper.wrapAngleTo180_float(-(yaw- (float) yawToEntity));
112
    }
113
114
    public static float getPitchChange(float pitch, Entity entity, double posY) {
115
        double deltaX = entity.posX - Minecraft.getMinecraft().thePlayer.posX;
116
        double deltaZ = entity.posZ - Minecraft.getMinecraft().thePlayer.posZ;
117
        double deltaY = posY - 2.2D + entity.getEyeHeight() - Minecraft.getMinecraft().thePlayer.posY;
118
        double distanceXZ = MathHelper.sqrt_double(deltaX * deltaX + deltaZ * deltaZ);
119
        double pitchToEntity = -Math.toDegrees(Math.atan(deltaY / distanceXZ));
120
        return -MathHelper.wrapAngleTo180_float(pitch - (float) pitchToEntity) - 2.5F;
121
    }
122
123
124
    public static float getNewAngle(float angle) {
125
        angle %= 360.0F;
126
        if (angle >= 180.0F) {
127
            angle -= 360.0F;
128
        }
129
        if (angle < -180.0F) {
130
            angle += 360.0F;
131
        }
132
        return angle;
133
    }
134
135
    public static boolean canEntityBeSeen(Entity e){
136
    	Vec3 vec1 = new Vec3(mc.thePlayer.posX, mc.thePlayer.posY + mc.thePlayer.getEyeHeight(),mc.thePlayer.posZ);
137
138
    	AxisAlignedBB box = e.getEntityBoundingBox();
139
        Vec3 vec2 = new Vec3(e.posX, e.posY + (e.getEyeHeight()/1.32F),e.posZ);	
140
        double minx = e.posX - 0.25;
141
        double maxx = e.posX + 0.25;
142
        double miny = e.posY;
143
        double maxy = e.posY + Math.abs(e.posY - box.maxY) ;
144
        double minz = e.posZ - 0.25;
145
        double maxz = e.posZ + 0.25;
146
        boolean see =  mc.theWorld.rayTraceBlocks(vec1, vec2) == null? true:false;
147
	    if(see)
148
	    	return true;
149
	    vec2 = new Vec3(maxx,miny,minz);	
150
	    see = mc.theWorld.rayTraceBlocks(vec1, vec2) == null? true:false;
151
	    if(see)
152
	    	return true;
153
	    vec2 = new Vec3(minx,miny,minz);	
154
	    see = mc.theWorld.rayTraceBlocks(vec1, vec2) == null? true:false;
155
	  
156
	    if(see)
157
	    	return true;
158
	    vec2 = new Vec3(minx,miny,maxz);	
159
	    see = mc.theWorld.rayTraceBlocks(vec1, vec2) == null? true:false;
160
	    if(see)
161
	    	return true;
162
	    vec2 = new Vec3(maxx,miny,maxz);	
163
	    see = mc.theWorld.rayTraceBlocks(vec1, vec2) == null? true:false;
164
	    if(see)
165
	    	return true;
166
	    
167
	    vec2 = new Vec3(maxx, maxy,minz);	
168
	    see = mc.theWorld.rayTraceBlocks(vec1, vec2) == null? true:false;
169
	  
170
	    if(see)
171
	    	return true;
172
	    vec2 = new Vec3(minx, maxy,minz);	
173
	
174
	    see = mc.theWorld.rayTraceBlocks(vec1, vec2) == null? true:false;
175
	    if(see)
176
	    	return true;
177
	    vec2 = new Vec3(minx, maxy,maxz - 0.1);	
178
	    see = mc.theWorld.rayTraceBlocks(vec1, vec2) == null? true:false;
179
	    if(see)
180
	    	return true;
181
	    vec2 = new Vec3(maxx, maxy,maxz);	
182
	    see = mc.theWorld.rayTraceBlocks(vec1, vec2) == null? true:false;
183
	    if(see)
184
	    	return true;
185
	    
186
	
187
    	return false;
188
    }
189
    public static float getDistanceBetweenAngles(float angle1, float angle2) {
190
        float angle = Math.abs(angle1 - angle2) % 360.0F;
191
        if (angle > 180.0F) {
192
            angle = 360.0F - angle;
193
        }
194
        return angle;
195
    }
196
}

What this file does

getBowAngles is the prediction core the module depends on. It implements the velocity extrapolation with the 0.4 scale, the 0.8-block distance quantization, the 1.25 sprint multiplier, the atan2 yaw, and the pitch arc offset of dist times 0.11, returning the angle pair the module writes into the event. The same file provides getRotations and getDistanceBetweenAngles used by getTarg's sort. The pitch output is a continuous float derived from entity positions rather than a sensitivity-quantized mouse step, which is the observable signature the rotation checks below key on.

anticheat Countering Checks

The anticheat code that detects or counters the techniques this module uses. Full source, with the detection mechanism explained below each box.

anticheat AimbotConvergence (fixed convergence point)

AimbotConvergence.java84 lines · Java
1
/*
2
 * This file is part of Hawk Anticheat.
3
 * Copyright (C) 2018 Hawk Development Team
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
 */
18
19
package me.islandscout.hawk.check.movement.look;
20
21
import me.islandscout.hawk.HawkPlayer;
22
import me.islandscout.hawk.check.CustomCheck;
23
import me.islandscout.hawk.event.Event;
24
import me.islandscout.hawk.event.MoveEvent;
25
import me.islandscout.hawk.util.*;
26
import org.bukkit.entity.Player;
27
import org.bukkit.util.Vector;
28
29
import java.util.*;
30
31
public class AimbotConvergence extends CustomCheck {
32
33
    //You better turn off your aimbot when your opponent is standing still!
34
    //Flags basic aimbots that update rotation before motion updates
35
36
    private Map<UUID, Vector> lastConvergencePointMap;
37
38
    public AimbotConvergence() {
39
        super("aimbotconvergence", true, -1, 5, 0.999, 5000, "%player% failed aimbot (convergence), VL: %vl%", null);
40
        this.lastConvergencePointMap = new HashMap<>();
41
    }
42
43
    @Override
44
    protected void check(Event event) {
45
        if(event instanceof MoveEvent) {
46
            MoveEvent e = (MoveEvent) event;
47
            HawkPlayer pp = e.getHawkPlayer();
48
            if(!e.hasDeltaPos())
49
                return;
50
            UUID uuid = pp.getUuid();
51
            Vector prePos = e.getFrom().toVector().clone().subtract(pp.getVelocity()).add(new Vector(0, 1.62, 0));
52
            Vector postPos = e.getFrom().toVector().add(new Vector(0, 1.62, 0));
53
            Vector preDir = e.getFrom().getDirection();
54
            Vector postDir = e.getTo().getDirection();
55
            Pair<Vector, Vector> points = new Ray(prePos, preDir).closestPointsBetweenLines(new Ray(postPos, postDir));
56
57
            Vector lastConvergence = lastConvergencePointMap.get(uuid);
58
            Vector convergence = points.getKey().add(points.getValue()).multiply(0.5);
59
60
            if(lastConvergence != null &&
61
                    //make sure TPs don't false this check
62
                    pp.getCurrentTick() - pp.getLastTeleportAcceptTick() > ServerUtils.getPing(e.getPlayer()) / 50 + 10 &&
63
                    pp.getCurrentTick() > 100) {
64
65
                double distance = lastConvergence.distanceSquared(convergence);
66
                if(!Double.isNaN(distance)) {
67
68
                    if(distance < 0.00000001) //TODO convergence point should be some distance away from head position to filter some falses
69
                        punish(pp, false, e);
70
                    else
71
                        reward(pp);
72
73
                }
74
            }
75
76
            lastConvergencePointMap.put(uuid, convergence);
77
        }
78
    }
79
80
    @Override
81
    public void removeData(Player p) {
82
        lastConvergencePointMap.remove(p.getUniqueId());
83
    }
84
}

How it counteracts this module

Hawk's AimbotConvergence intersects the pre-move and post-move sight lines on every MoveEvent with a position delta, taking the midpoint of closestPointsBetweenLines as the convergence point, and punishes when that point moves less than 1e-8 squared between consecutive moves, once the player is past 100 ticks and beyond ping-based teleport grace. Sigma's BowAimbot aims at a single predicted world point each tick, so against a standing target the convergence point is fixed and the check flags, exactly as its comment warns: turn off the aimbot when the opponent stands still. The bypass surface is the prediction itself: while the target moves, the velocity extrapolation keeps the aim point moving and the convergence point jumps between ticks, so the check needs a fairly static target to fire at all.

anticheat AimbotHeuristic (click-window motion analysis)

AimbotHeuristic.java164 lines · Java
1
/*
2
 * This file is part of Hawk Anticheat.
3
 * Copyright (C) 2018 Hawk Development Team
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
 */
18
19
package me.islandscout.hawk.check.movement.look;
20
21
import me.islandscout.hawk.HawkPlayer;
22
import me.islandscout.hawk.check.CustomCheck;
23
import me.islandscout.hawk.check.Cancelless;
24
import me.islandscout.hawk.event.*;
25
import me.islandscout.hawk.util.Debug;
26
import me.islandscout.hawk.util.MathPlus;
27
import org.bukkit.entity.Player;
28
import org.bukkit.util.Vector;
29
30
import java.util.*;
31
32
/**
33
 * AimbotHeuristic exploits flaws in aim-bot cheats by
34
 * analyzing mouse movement patterns during interaction. Although
35
 * easily bypassed, it catches a significant number of cheaters.
36
 * Caution is advised since this check may false flag during
37
 * certain circumstances. This check should only be used as a
38
 * hint that the player might be cheating.
39
 */
40
public class AimbotHeuristic extends CustomCheck implements Cancelless {
41
42
    private final Map<UUID, List<Vector>> mouseMoves;
43
    private final Map<UUID, List<Long>> clickTimes;
44
45
    private static final int MOVES_PER_SAMPLE = 4; //must be greater than 0
46
    private final int MOVES_AFTER_HIT;
47
    private final boolean DEBUG;
48
49
    public AimbotHeuristic() {
50
        super("aimbotheuristic", false, -1, 5, 0.99, 5000, "&7%player% failed aimbot (heuristic), VL %vl%", null);
51
        mouseMoves = new HashMap<>();
52
        clickTimes = new HashMap<>();
53
54
        MOVES_AFTER_HIT = MOVES_PER_SAMPLE - MOVES_PER_SAMPLE / 2;
55
56
        DEBUG = (boolean) customSetting("debug", "", false);
57
    }
58
59
    public void check(Event e) {
60
        if (e instanceof MoveEvent) {
61
            processMove((MoveEvent) e);
62
        } else if (e instanceof InteractEntityEvent || e instanceof InteractWorldEvent) {
63
            processClick(e);
64
        }
65
    }
66
67
    private void processMove(MoveEvent e) {
68
        Player p = e.getPlayer();
69
        HawkPlayer pp = e.getHawkPlayer();
70
        UUID uuid = p.getUniqueId();
71
72
        List<Vector> lastMoves = mouseMoves.getOrDefault(uuid, new ArrayList<>());
73
        Vector mouseMove = new Vector(e.getTo().getYaw() - e.getFrom().getYaw(), e.getTo().getPitch() - e.getFrom().getPitch(), 0);
74
75
        lastMoves.add(mouseMove);
76
        //make size 1 bigger so that we can get the move before
77
        //the first move that we check
78
        if(lastMoves.size() > MOVES_PER_SAMPLE + 1) {
79
            lastMoves.remove(0);
80
        }
81
        mouseMoves.put(uuid, lastMoves);
82
83
        if(clickedXMovesBefore(MOVES_AFTER_HIT, pp)) {
84
            double minSpeed = Double.MAX_VALUE;
85
            double maxSpeed = 0D;
86
            double maxAngle = 0D;
87
            for(int i = 1; i < lastMoves.size(); i++) {
88
                Vector lastMouseMove = lastMoves.get(i - 1);
89
                Vector currMouseMove = lastMoves.get(i);
90
                double speed = currMouseMove.length();
91
                double lastSpeed = lastMouseMove.length();
92
                double angle = (lastSpeed != 0 && lastSpeed != 0) ? MathPlus.angle(lastMouseMove, currMouseMove) : 0D;
93
                if(Double.isNaN(angle))
94
                    angle = 0D;
95
                maxSpeed = Math.max(speed, maxSpeed);
96
                minSpeed = Math.min(speed, minSpeed);
97
                maxAngle = Math.max(angle, maxAngle);
98
99
                //stutter
100
                if(maxSpeed - minSpeed > 4 && minSpeed < 0.01 && maxAngle < 0.1 && lastSpeed > 1) { //this lastSpeed check eliminates a false positive
101
                    if(DEBUG) {
102
                        p.sendMessage("AimbotHeuristic: A");
103
                    }
104
                    punishEm(pp, e);
105
                }
106
                //twitching or zig zags
107
                else if(speed > 20 && lastSpeed > 20 && angle > 2.86) {
108
                    if(DEBUG) {
109
                        p.sendMessage("AimbotHeuristic: B");
110
                    }
111
                    punishEm(pp, e);
112
                }
113
                //jump discontinuity
114
                else if(speed - lastSpeed < -30 && angle > 0.8) {
115
                    if(DEBUG) {
116
                        p.sendMessage("AimbotHeuristic: C");
117
                    }
118
                    punishEm(pp, e);
119
                }
120
                else {
121
                    reward(pp);
122
                }
123
            }
124
        }
125
    }
126
127
    private boolean clickedXMovesBefore(long x, HawkPlayer pp) {
128
        List<Long> clickTimess = clickTimes.getOrDefault(pp.getUuid(), new ArrayList<>());
129
        long time = pp.getCurrentTick() - x;
130
        for(int i = 0; i < clickTimess.size(); i++) {
131
            if(time == clickTimess.get(i)) {
132
                clickTimess.remove(i);
133
                return true;
134
            }
135
        }
136
        return false;
137
    }
138
139
    private void processClick(Event e) {
140
        UUID uuid = e.getPlayer().getUniqueId();
141
        List<Long> clickTimess = clickTimes.getOrDefault(uuid, new ArrayList<>());
142
        long currTick = e.getHawkPlayer().getCurrentTick();
143
        if(!clickTimess.contains(currTick))
144
            clickTimess.add(e.getHawkPlayer().getCurrentTick());
145
146
        //memory leak fail-safe, if necessary?
147
        for(int i = clickTimess.size() - 1; i >= 0; i--) {
148
            if(currTick - clickTimess.get(i) > MOVES_PER_SAMPLE + 1)
149
                clickTimess.remove(i);
150
        }
151
152
        clickTimes.put(uuid, clickTimess);
153
    }
154
155
    private void punishEm(HawkPlayer pp, MoveEvent e) {
156
        punish(pp, false, e);
157
    }
158
159
    @Override
160
    public void removeData(Player p) {
161
        mouseMoves.remove(p.getUniqueId());
162
        clickTimes.remove(p.getUniqueId());
163
    }
164
}

How it counteracts this module

AimbotHeuristic analyzes the last four move vectors only when a click landed two ticks earlier, testing for a stutter (fixed-speed run then a stall under 0.01 speed on one bearing), a twitch (two moves above 20 degrees per tick), or a jump discontinuity (a speed drop over 30 with a bearing change over 0.8 radians). The honest limitation for this module: the window opens on interaction clicks, and a pure bow release sends C07, which Hawk does not record as a click, so a bow-only aimbot never enters the window. The check bites when the same session also melee-attacks with C02 or interacts while the aimbot is running, because the aimbot's per-tick rotation toward the predicted point then feeds the sampled moves and the stutter pattern appears on convergence.

anticheat AimbotPrecision (pitch-delta GCD)

AimbotPrecision.java132 lines · Java
1
/*
2
 * This file is part of Hawk Anticheat.
3
 * Copyright (C) 2018 Hawk Development Team
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
 */
18
19
package me.islandscout.hawk.check.movement.look;
20
21
import me.islandscout.hawk.HawkPlayer;
22
import me.islandscout.hawk.check.Cancelless;
23
import me.islandscout.hawk.check.MovementCheck;
24
import me.islandscout.hawk.event.MoveEvent;
25
import me.islandscout.hawk.util.Debug;
26
import me.islandscout.hawk.util.MathPlus;
27
import org.bukkit.ChatColor;
28
import org.bukkit.entity.Player;
29
30
import java.util.*;
31
32
/**
33
 * The AimbotPrecision check detects aim-bots by
34
 * checking for variation in head pitch precision.
35
 * It does this by solving the greatest common divisor
36
 * of the samples. All pitch changes should be divisible
37
 * by a constant, which is determined by the in-game
38
 * mouse sensitivity. Not compatible with cinematic
39
 * camera mode.
40
 *
41
 * The main issue with this approach to detecting aimbots
42
 * (besides cinematic camera mode) is its unreliability
43
 * at high client framerates. Because rotation is updated
44
 * per frame, there can be multiple rotation updates per
45
 * tick. Every time a new delta yaw/pitch is added to the
46
 * current rotation, there is precision loss due to the
47
 * arithmetic involved. These errors can add up very quickly,
48
 * ultimately causing the GCD algorithm to fail and
49
 * produce false-positives.
50
 */
51
public class AimbotPrecision extends MovementCheck implements Cancelless {
52
53
    //This concept could be used to determine someone's in-game sensitivity.
54
    //That's pretty spoopy if you ask me.
55
56
    //Inspired by https://www.spigotmc.org/threads/killaura-detection.143226/page-17#post-2821779
57
58
    private final Map<UUID, List<Float>> deltaPitches;
59
    private final Map<UUID, Float> lastDeltaPitchGCDs;
60
61
    private final int SAMPLES;
62
    private final float PITCHRATE_LIMIT;
63
64
    public AimbotPrecision() {
65
        super("aimbotprecision", false, -1, 5, 0.9, 5000, "%player% failed aimbot (precision), VL: %vl%", null);
66
        SAMPLES = (int)customSetting("samples", "", 10);
67
        PITCHRATE_LIMIT = (float)((double)customSetting("ignorePitchrateHigherThan", "", 0.96D));
68
        this.deltaPitches = new HashMap<>();
69
        this.lastDeltaPitchGCDs = new HashMap<>();
70
    }
71
72
    @Override
73
    protected void check(MoveEvent e) {
74
        HawkPlayer pp = e.getHawkPlayer();
75
        UUID uuid = pp.getUuid();
76
        float deltaPitch = e.getTo().getPitch() - e.getFrom().getPitch();
77
        List<Float> lastDeltaPitches = deltaPitches.getOrDefault(uuid, new ArrayList<>());
78
79
        //ignore if deltaPitch is 0 or >= 10 or if pitch is +/-90.
80
        if(deltaPitch != 0 && Math.abs(deltaPitch) <= PITCHRATE_LIMIT && Math.abs(e.getTo().getPitch()) != 90) {
81
            lastDeltaPitches.add(Math.abs(deltaPitch));
82
        }
83
84
        //Only check for pitch
85
        //For some reason when you spin your head around too much,
86
        //yaw checking becomes unreliable. Precision errors?
87
        //Still, this check is pretty impressive.
88
        if(lastDeltaPitches.size() >= SAMPLES) {
89
90
            float deltaPitchGCD = MathPlus.gcdRational(lastDeltaPitches);
91
            float gcdDiff = Math.abs(deltaPitchGCD - lastDeltaPitchGCDs.getOrDefault(uuid, deltaPitchGCD));
92
93
            if(gcdDiff > 0.001) {
94
95
                //Assuming sens didn't change, add last GCD in our delta pitches
96
                //just in case we didn't collect enough samples to compute the same GCD.
97
                //Try again. Mathematically, the GCD should remain the same.
98
                if(lastDeltaPitchGCDs.containsKey(uuid)) {
99
                    float lastDeltaPitchGCD = lastDeltaPitchGCDs.get(uuid);
100
                    if(lastDeltaPitchGCD > 0.001) {
101
                        lastDeltaPitches.add(lastDeltaPitchGCD);
102
                        deltaPitchGCD = MathPlus.gcdRational(lastDeltaPitches);
103
                        gcdDiff = Math.abs(deltaPitchGCD - lastDeltaPitchGCDs.getOrDefault(uuid, deltaPitchGCD));
104
                    }
105
                }
106
            }
107
108
            //if GCD is practically unsolvable
109
            if(deltaPitchGCD < 0.00001) {
110
                fail(pp, e);
111
            }
112
            else
113
                reward(pp);
114
115
            lastDeltaPitches.clear();
116
            lastDeltaPitchGCDs.put(uuid, deltaPitchGCD);
117
        }
118
119
        deltaPitches.put(uuid, lastDeltaPitches);
120
    }
121
122
    private void fail(HawkPlayer pp, MoveEvent e) {
123
        punish(pp, false, e);
124
    }
125
126
    @Override
127
    public void removeData(Player p) {
128
        UUID uuid = p.getUniqueId();
129
        deltaPitches.remove(uuid);
130
        lastDeltaPitchGCDs.remove(uuid);
131
    }
132
}

How it counteracts this module

AimbotPrecision collects nonzero pitch deltas at or below the 0.96 degree sampling cap and solves their rational GCD; when the GCD is practically unsolvable, below 1e-5, it fails, on the model that every legit pitch change is divisible by the mouse sensitivity constant. BowAimbot's pitch is an atan2 float plus the dist times 0.11 arc offset, effectively continuous precision with no common divisor, so the first such delta that falls under the 0.96 cap joins the ten-sample window and collapses the GCD, and the check fails on the batch. The detection lands on convergence episodes: while the target keeps moving, every tick feeds a fresh remainder and the window keeps failing. The module's yaw is never sampled, which is why the check is pitch-specific.

anticheat SensitivityProcessor (sensitivity grid validation)

SensitivityProcessor.java168 lines · Java
1
package kireiko.dev.millennium.math;
2
3
import ai.idealistic.spartan.abstraction.protocol.PlayerProtocol;
4
import lombok.Getter;
5
import lombok.Setter;
6
7
import java.util.*;
8
9
public final class SensitivityProcessor {
10
11
    @Getter
12
    private static final double[] SENSITIVITY_MCP_VALUES;
13
14
    static {
15
        SENSITIVITY_MCP_VALUES = new double[]{
16
                0.0, 0.00704225, 0.01408451, 0.01760563, 0.02112676,
17
                0.02816901, 0.02816902, 0.03521127, 0.04225352, 0.04929578,
18
                0.04929577, 0.05633803, 0.06338028, 0.06690141, 0.07042254,
19
                0.07746479, 0.08450704, 0.08802817, 0.09154929, 0.09859155,
20
                0.10211267, 0.1056338, 0.11267605, 0.11971831, 0.12323943,
21
                0.12676056, 0.13380282, 0.13732395, 0.14084508, 0.14788732,
22
                0.15492958, 0.15845071, 0.16197184, 0.16901408, 0.17253521,
23
                0.17605634, 0.18309858, 0.18661971, 0.19014084, 0.1971831,
24
                0.20422535, 0.20774647, 0.2112676, 0.21830986, 0.22183098,
25
                0.22535211, 0.23239437, 0.23943663, 0.24295775, 0.24647887,
26
                0.2535211, 0.25704224, 0.26056337, 0.26760563, 0.2746479,
27
                0.27816902, 0.28169015, 0.28873238, 0.29225351, 0.29577464,
28
                0.3028169, 0.30985916, 0.31338029, 0.31690142, 0.32394367,
29
                0.32746478, 0.3309859, 0.33802816, 0.34507042, 0.34859155,
30
                0.35211268, 0.35915494, 0.36267605, 0.36619717, 0.37323943,
31
                0.37676056, 0.3802817, 0.38732395, 0.3943662, 0.39788733,
32
                0.40140846, 0.4084507, 0.41197183, 0.41549295, 0.4225352,
33
                0.42957747, 0.4330986, 0.43661973, 0.44366196, 0.44718309,
34
                0.45070422, 0.45774648, 0.46478873, 0.46830986, 0.471831,
35
                0.47887325, 0.48239436, 0.48591548, 0.49295774, 0.5,
36
                0.5, 0.5070422, 0.5140845, 0.51760563, 0.52112675,
37
                0.52816904, 0.53169015, 0.53521127, 0.5422535, 0.5492958,
38
                0.5528169, 0.556338, 0.5633803, 0.56690142, 0.57042253,
39
                0.57746476, 0.58450705, 0.58802818, 0.5915493, 0.59859157,
40
                0.60211269, 0.6056338, 0.6126761, 0.6197183, 0.62323942,
41
                0.62676054, 0.63380283, 0.63732395, 0.64084506, 0.64788735,
42
                0.6549296, 0.6584507, 0.6619718, 0.6690141, 0.6725352,
43
                0.6760563, 0.6830986, 0.68661972, 0.69014084, 0.6971831,
44
                0.70422536, 0.70774648, 0.7112676, 0.7183099, 0.7253521,
45
                0.7253521, 0.73239434, 0.7394366, 0.74295773, 0.74647886,
46
                0.75352114, 0.75704227, 0.7605634, 0.76760566, 0.7746479,
47
                0.778169, 0.7816901, 0.7887324, 0.79225352, 0.79577464,
48
                0.8028169, 0.80985916, 0.81338028, 0.8169014, 0.8239437,
49
                0.8274648, 0.8309859, 0.8380282, 0.8415493, 0.8450704,
50
                0.85211265, 0.85915494, 0.86267605, 0.86619717, 0.87323946,
51
                0.87676058, 0.8802817, 0.8873239, 0.8943662, 0.89788731,
52
                0.90140843, 0.9084507, 0.91197182, 0.91549295, 0.92253524,
53
                0.92957747, 0.93309858, 0.9366197, 0.943662, 0.9471831,
54
                0.9507042, 0.9577465, 0.96478873, 0.96830985, 0.97183096,
55
                0.97887325, 0.98239437, 0.9859155, 0.9929578, 1.0,
56
                1.0
57
        };
58
    }
59
60
    private final List<Integer>
61
                    sensitivitySamples = new ArrayList<>(),
62
                    sensitivityStrictSamples = new ArrayList<>();
63
    private final PlayerProtocol playerProfile;
64
    public double totalSensitivity = 0;
65
    public int totalSensitivityClient = 0;
66
    @Setter
67
    private float deltaPitch = 0;
68
    @Setter
69
    @Getter
70
    private float lastDeltaPitch = 0;
71
    @Getter
72
    private double finalSensitivity;
73
    @Getter
74
    private int sensitivity;
75
    private int lastStrictSensitivity = 0;
76
77
    public SensitivityProcessor(PlayerProtocol playerProfile) {
78
        this.playerProfile = playerProfile;
79
    }
80
81
    public static double getGcd(final double a, final double b) {
82
        if (Math.abs(b) < 0.001 || a == b) {
83
            return a;
84
        }
85
        if (a < b) {
86
            return getGcd(b, a);
87
        }
88
        return getGcd(b, a - Math.floor(a / b) * b);
89
    }
90
91
    public static int getMode(final Collection<? extends Number> array) {
92
        int mode = (int) array.toArray()[0];
93
        int maxCount = 0;
94
        for (final Number value : array) {
95
            int count = 1;
96
            for (final Number i : array) {
97
                if (i.equals(value)) {
98
                    ++count;
99
                }
100
                if (count > maxCount) {
101
                    mode = (int) value;
102
                    maxCount = count;
103
                }
104
            }
105
        }
106
        return mode;
107
    }
108
109
    public void processSensitivity() {
110
        if (Math.abs(this.deltaPitch) < 0.31) {
111
            for (int i = 0; i < 200; i++) {
112
                final double gcdValue = Statistics.getGCDValue(SENSITIVITY_MCP_VALUES[i]);
113
                final double diff = Math.abs(gcdValue - Math.abs(this.deltaPitch));
114
                if (diff < 1e-3) {
115
                    sensitivityStrictSamples.add(i);
116
                    if (sensitivityStrictSamples.size() >= 10) {
117
                        final int finalSens = (int) Statistics.getMin(sensitivityStrictSamples);
118
                        if (finalSens == lastStrictSensitivity) {
119
                            playerProfile.getSensitivity().clear();
120
                            for (int r = 0; r < 5; r++) playerProfile.getSensitivity().add(finalSens);
121
                        } else playerProfile.getSensitivity().add(finalSens);
122
                        sensitivityStrictSamples.clear();
123
                        lastStrictSensitivity = finalSens;
124
                    }
125
                    break;
126
                }
127
            }
128
        }
129
        final float gcd = (float) getGcd(this.deltaPitch, this.lastDeltaPitch);
130
        final double sensitivityModifier = Math.cbrt(0.8333 * gcd);
131
        final double sensitivityStepTwo = 1.666 * sensitivityModifier - 0.3333;
132
        final double finalSensitivity = sensitivityStepTwo * 200.0;
133
        this.finalSensitivity = finalSensitivity;
134
        this.sensitivitySamples.add((int) finalSensitivity);
135
        if (this.sensitivitySamples.size() >= 40) {
136
            this.sensitivity = getMode(this.sensitivitySamples);
137
            if (this.hasValidSensitivity()) {
138
                this.totalSensitivityClient = this.sensitivity;
139
                this.totalSensitivity = SENSITIVITY_MCP_VALUES[this.sensitivity];
140
                playerProfile.getSensitivity().add(this.totalSensitivityClient);
141
            }
142
            this.sensitivitySamples.clear();
143
        }
144
    }
145
146
    public double getWrappedSensitivity() {
147
        return (this.totalSensitivity == 0.0
148
                ? SENSITIVITY_MCP_VALUES[100]
149
                : this.totalSensitivity);
150
    }
151
152
    private int calculateMode(List<Integer> samples) {
153
        Map<Integer, Integer> frequencyMap = new HashMap<>();
154
        for (int sample : samples) {
155
            frequencyMap.put(sample, frequencyMap.getOrDefault(sample, 0) + 1);
156
        }
157
158
        return frequencyMap.entrySet().stream()
159
                .max(Map.Entry.comparingByValue())
160
                .map(Map.Entry::getKey)
161
                .orElse(0);
162
    }
163
164
    private boolean hasValidSensitivity() {
165
        return sensitivity >= 0 && sensitivity <= 200;
166
    }
167
168
}

How it counteracts this module

Spartan embeds Millennium's SensitivityProcessor as the rotation layer its aim checks read. processSensitivity takes the GCD of consecutive pitch deltas, maps it through the Minecraft sensitivity formula to a 0 to 200 scale, and for small deltas scans the 200-entry sensitivity table for a match within 1e-3; the mode of the last 40 samples becomes the player's sensitivity. BowAimbot's deltas cannot be attributed to any sensitivity: the continuous atan2 remainders have an unsolvable GCD that lands near index zero, and any sustained portion maps outside the table, so the processor reports an invalid or unstable sensitivity, the exact signal the consuming aim checks treat as non-human. Only sub-half-degree-per-tick steps map into the table, and the bow aimbot never produces them.

← Back to Analysis Hub