Sigma 4.11 AimAssist module 2 files, 344 lines

Sigma 4.11 AimAssist: Full Source Analysis

Sigma 4.11's AimAssist is a rotation-only aim smoothing module that never sends an attack itself.

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

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

Packets This Module Uses

Analysis

Overview

Sigma 4.11's AimAssist is a rotation-only aim smoothing module that never sends an attack itself. It picks a target in the pre phase of EventUpdate, caches it, and in the post phase (only when no GUI screen is open and the player holds a sword, per the WEAPON toggle) steps the local yaw and pitch toward that target with a hard per-tick cap: the rotation moves by exactly SPEED-H (default 20) degrees of yaw and SPEED-V (default 15) degrees of pitch per tick, and when the remaining angle is within the cap it snaps the exact remainder, so the view converges on the target and parks. The aim point is jittered by randomNumber() (an integer -1, 0 or 1) times the RANDOM-XZ and RANDOM-Y settings around the target's position, the pitch target carries a hardcoded 2.5-degree undershoot bias from RotationUtils.getPitchChange, and target selection is gated by RANGE (default 4.5) plus a distance-scaled FOV check (FOVYAW/FOVPITCH default 45/25, widened as the target gets closer). There is no click gating and no attack packet: the module rotates every post-update tick a sword is held, so its rotations ride the player's normal C03 movement stream while the player's own clicks (or Killaura) provide the C02 attacks the assist lines up.

Because the rotation is written straight into mc.thePlayer.rotationYaw/rotationPitch after the pre-update, it lands in the next tick's movement packet, which is what makes the module's pattern visible to rotation analysis: fixed-magnitude per-tick deltas, exact-remainder snaps, and a view that converges on a single world point.

Architecture

The module hooks EventUpdate with pre and post phases split across two responsibilities. onEvent caches the target in pre via getBestEntity() so the selection runs on the server-facing update, then in post, guarded by mc.currentScreen == null, it runs the weapon gate (if WEAPON is on, the held item must be an ItemSword), the friend check and the alive check, and calls stepAngle(). The two-phase split means the target list is fresh for the tick while the actual rotation is applied after the movement update, so the assist's output shows up in the following packet rather than the current one.

State is a single target field; all parameters live in the settings map (WEAPON, RANGE, SPEED-H, SPEED-V, FOVYAW, FOVPITCH, RANDOM-XZ, RANDOM-Y). A quirk worth noting: the SPEED-H and SPEED-V defaults (20 and 15) sit above their declared slider maximum of 10, so a stock install rotates at the out-of-range values until the user moves the slider.

Rotation model (stepAngle)

stepAngle computes the signed yaw and pitch differences to the aim point through RotationUtils.getYawChange and getPitchChange, then applies a clamp-or-snap policy per axis. If the target yaw change is positive and larger than yawFactor the view advances exactly yawFactor; if negative and below -yawFactor it retreats exactly yawFactor; otherwise it adds the full remainder, which snaps the view precisely onto the target line. The pitch axis repeats the same policy with pitchFactor. The result is a piecewise-linear rotation: constant-magnitude steps while far off target, one exact-remainder snap on arrival, then zero movement while aligned.

The aim point itself is jittered: yaw aims at (target.posX + randomNumber()*xz, target.posZ + randomNumber()*xz) and pitch at target.posY + randomNumber()*y, where randomNumber() returns -1, 0 or 1, so the RANDOM-XZ and RANDOM-Y settings (default 0) define a +/-one-block box the aim point hops inside every tick. getPitchChange also bakes in a constant -2.5F offset, so the assist settles 2.5 degrees below the exact pitch line rather than on it.

Target selection (getBestEntity + fovCheck)

getBestEntity walks the loaded entity list and keeps EntityLivingBase entries that are alive EntityPlayers within RANGE and pass fovCheck. The FOV check is distance-scaled: the effective window is FOVYAW*3/dist and FOVPITCH*3/dist, so a nearby target is allowed a wider angular offset than a distant one. Killaura.vip short-circuits the entire selection: if the Killaura module's current VIP target is in range and inside the FOV, it is returned immediately. Otherwise the candidates are sorted by the summed yaw and pitch angular distance to the player's current rotation and the closest-to-crosshair entity wins, which biases the assist toward whatever the player is already facing.

There is no attack path anywhere in the module: no C02 packet is ever produced, no swing is faked, and no click requirement exists. The module's only output is the rotation mutation, which is precisely what makes it detectable by rotation-pattern checks rather than by attack-pattern checks.

source AimAssist.java (module)

AimAssist.java147 lines · JavaOriginal ↗
1
package info.sigmaclient.module.impl.combat;
2
3
import java.util.List;
4
import java.util.concurrent.CopyOnWriteArrayList;
5
6
import info.sigmaclient.event.Event;
7
import info.sigmaclient.module.data.ModuleData;
8
import info.sigmaclient.event.RegisterEvent;
9
import info.sigmaclient.event.impl.EventUpdate;
10
import info.sigmaclient.management.friend.FriendManager;
11
import info.sigmaclient.module.Module;
12
import info.sigmaclient.module.data.Setting;
13
import info.sigmaclient.util.RotationUtils;
14
import info.sigmaclient.util.misc.ChatUtil;
15
import net.minecraft.entity.EntityLivingBase;
16
import net.minecraft.entity.player.EntityPlayer;
17
import net.minecraft.item.Item;
18
import net.minecraft.item.ItemSword;
19
20
public class AimAssist extends Module {
21
22
    private EntityLivingBase target;
23
24
    public AimAssist(ModuleData data) {
25
        super(data);
26
        settings.put(WEAPON, new Setting<>(WEAPON, true, "Checks if you have a sword in hand."));
27
        settings.put(X, new Setting<>(X, 0, "Randomization on XZ axis.", 0.01, 0, 1));
28
        settings.put(Y, new Setting<>(Y, 0, "Randomization on Y axis.", 0.01, 0, 1));
29
        settings.put(RANGE, new Setting<>(RANGE, 4.5, "The distance in which an entity is valid to attack.", 0.1D, 1.0D, 10.0D));
30
        settings.put(HORIZONTAL, new Setting<>(HORIZONTAL, 20, "Horizontal speed.", 0.25, 0, 10));
31
        settings.put(VERTICAL, new Setting<>(VERTICAL, 15, "Vertical speed.", 0.25, 0, 10));
32
        settings.put(FOVYAW, new Setting<>(FOVYAW, 45, "Yaw FOV check.", 1, 5D, 50));
33
        settings.put(FOVPITCH, new Setting<>(FOVPITCH, 25, "Vertical FOV check.", 1, 5D, 50));
34
    }
35
36
    private String WEAPON = "WEAPON";
37
    private String RANGE = "RANGE";
38
    private String HORIZONTAL = "SPEED-H";
39
    private String VERTICAL = "SPEED-V";
40
    private String FOVYAW = "FOVYAW";
41
    private String FOVPITCH = "FOVPITCH";
42
    private String X = "RANDOM-XZ";
43
    private String Y = "RANDOM-Y";
44
45
    private int randomNumber() {
46
        return -1 + (int) (Math.random() * ((1 - (-1)) + 1));
47
    }
48
49
    @Override
50
    @RegisterEvent(events = {EventUpdate.class})
51
    public void onEvent(Event event) {
52
        if (event instanceof EventUpdate) {
53
            EventUpdate em = (EventUpdate) event;
54
            if (em.isPre()) {
55
                target = getBestEntity();
56
            } else if (em.isPost() && mc.currentScreen == null) {
57
                if (mc.thePlayer.getHeldItem() == null || mc.thePlayer.getHeldItem().getItem() == null) {
58
                    return;
59
                }
60
                final Item heldItem = mc.thePlayer.getHeldItem().getItem();
61
                if ((Boolean) settings.get(WEAPON).getValue() && heldItem != null) {
62
                    if (!(heldItem instanceof ItemSword)) {
63
                        return;
64
                    }
65
                }
66
                if (target != null && !FriendManager.isFriend(target.getName()) && mc.thePlayer.isEntityAlive()) {
67
                    stepAngle();
68
                }
69
            }
70
        }
71
    }
72
73
74
    private void stepAngle() {
75
        float yawFactor = ((Number) settings.get(HORIZONTAL).getValue()).floatValue();
76
        float pitchFactor = ((Number) settings.get(VERTICAL).getValue()).floatValue();
77
        double xz = ((Number) settings.get(X).getValue()).doubleValue();
78
        double y = ((Number) settings.get(Y).getValue()).doubleValue();
79
        float targetYaw = RotationUtils.getYawChange(mc.thePlayer.rotationYaw, target.posX + randomNumber() * xz, target.posZ + randomNumber() * xz);
80
81
        if (targetYaw > 0 && targetYaw > yawFactor) {
82
            mc.thePlayer.rotationYaw += yawFactor;
83
        } else if (targetYaw < 0 && targetYaw < -yawFactor) {
84
            mc.thePlayer.rotationYaw -= yawFactor;
85
        } else {
86
            mc.thePlayer.rotationYaw += targetYaw;
87
        }
88
89
        float targetPitch = RotationUtils.getPitchChange(mc.thePlayer.rotationPitch, target, target.posY + randomNumber() * y);
90
91
        if (targetPitch > 0 && targetPitch > pitchFactor) {
92
            mc.thePlayer.rotationPitch += pitchFactor;
93
        } else if (targetPitch < 0 && targetPitch < -pitchFactor) {
94
            mc.thePlayer.rotationPitch -= pitchFactor;
95
        } else {
96
            mc.thePlayer.rotationPitch += targetPitch;
97
        }
98
99
    }
100
101
    private EntityLivingBase getBestEntity() {
102
        List<EntityLivingBase> loaded = new CopyOnWriteArrayList<>();
103
        for (Object o : mc.theWorld.getLoadedEntityList()) {
104
            if (o instanceof EntityLivingBase) {
105
                EntityLivingBase ent = (EntityLivingBase) o;
106
                if (ent.isEntityAlive() && ent instanceof EntityPlayer && ent
107
                        .getDistanceToEntity(mc.thePlayer) < ((Number) settings.get(RANGE).getValue()).floatValue()
108
                        && fovCheck(ent)) {
109
                    if (ent == Killaura.vip) {
110
                        return ent;
111
                    }
112
                    loaded.add(ent);
113
                }
114
            }
115
        }
116
        if (loaded.isEmpty()) {
117
            return null;
118
        }
119
        try {
120
            loaded.sort((o1, o2) -> {
121
                float[] rot1 = RotationUtils.getRotations(o1);
122
                float[] rot2 = RotationUtils.getRotations(o2);
123
                return (int) ((RotationUtils.getDistanceBetweenAngles(mc.thePlayer.rotationYaw, rot1[0])
124
                        + RotationUtils.getDistanceBetweenAngles(mc.thePlayer.rotationPitch, rot1[1]))
125
                        - (RotationUtils.getDistanceBetweenAngles(mc.thePlayer.rotationYaw, rot2[0])
126
                        + RotationUtils.getDistanceBetweenAngles(mc.thePlayer.rotationPitch, rot2[1])));
127
            });
128
        } catch (Exception e) {
129
            ChatUtil.printChat("Exception with TM: " + e.getMessage());
130
        }
131
        return loaded.get(0);
132
    }
133
134
    private boolean fovCheck(EntityLivingBase ent) {
135
        float[] rotations = RotationUtils.getRotations(ent);
136
        float dist = mc.thePlayer.getDistanceToEntity(ent);
137
        if (dist == 0) {
138
            dist = 1;
139
        }
140
        float yawDist = RotationUtils.getDistanceBetweenAngles(mc.thePlayer.rotationYaw, rotations[0]);
141
        float pitchDist = RotationUtils.getDistanceBetweenAngles(mc.thePlayer.rotationPitch, rotations[1]);
142
        float fovYaw = ((Number) settings.get(FOVYAW).getValue()).floatValue() * 3 / dist;
143
        float fovPitch = (((Number) settings.get(FOVPITCH).getValue()).floatValue() * 3) / dist;
144
        return yawDist < fovYaw && pitchDist < fovPitch;
145
    }
146
147
}

What this file does

The whole module lives in this file. onEvent implements the pre/post EventUpdate split: pre caches the target, post (screen null, weapon check passed, target alive and not a friend) calls stepAngle. stepAngle implements the clamp-or-snap policy with the SPEED-H/SPEED-V factors and the RANDOM-XZ/RANDOM-Y jittered aim point. getBestEntity applies the RANGE gate, the fovCheck distance-scaled window, the Killaura.vip shortcut and the angular-distance sort. fovCheck computes yawDist and pitchDist with RotationUtils.getDistanceBetweenAngles against the distance-scaled FOV.

The file also shows what the module does not do: it never sends packets, never checks clicks, and mutates the player's rotation directly instead of writing into the EventUpdate's yaw/pitch fields, which is why its rotations appear one tick late (they are picked up by the next movement packet) and are not correlated with any outgoing C02. The settings block documents the defaults and ranges, including the SPEED-H/SPEED-V defaults (20/15) that exceed the slider max (10).

source RotationUtils.java (aim 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

RotationUtils is the aim math the module depends on. getYawChange computes the signed, wrapped yaw delta from the player to the aim point using quadrant-aware atan math and MathHelper.wrapAngleTo180_float. getPitchChange computes the pitch delta with a -2.2 eye-offset adjustment and a hardcoded -2.5F undershoot, which is why the assist always settles slightly below the exact aim line. getRotations (used by getBestEntity's sort) aims at posY + eyeHeight/2, and getDistanceBetweenAngles returns the wrapped angular distance used by both fovCheck and the candidate sort.

These helpers define the module's observable signature: per-tick deltas that are either exactly the configured factors or the exact float remainder of an atan2 computation, wrapped into [-180, 180). A real mouse at a fixed sensitivity produces deltas quantized to sensitivity steps; this stream produces fixed factors plus continuous remainders, which is the pattern the countering 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 detects rotation that is aimed at a fixed point in space by intersecting sight lines. On every MoveEvent with a position delta it builds two rays: a pre-move ray from (from - velocity) plus the 1.62 eye height along the pre-move direction, and a post-move ray from (from) plus 1.62 along the post-move direction, computes closestPointsBetweenLines between them and takes the midpoint as the convergence point. If the convergence point moved less than 1e-8 (squared distance) between consecutive moves - and the player is older than 100 ticks and more than ping/50 + 10 ticks past the last accepted teleport - it punishes with 'failed aimbot (convergence)' at VL 5, otherwise it rewards. The class comment states the model outright: 'You better turn off your aimbot when your opponent is standing still!'

Sigma's AimAssist is a direct hit when RANDOM-XZ/RANDOM-Y are at their defaults (0): the aim point is exactly the target's posX/posZ/posY, so the pre-move and post-move sight lines intersect at the target and the convergence point is the target's position, which stays fixed while the target stands still (or moves smoothly), tripping the 1e-8 stability test on the following move. The weapon gate means the pattern only exists while a sword is held, and the module's rotations lag one tick behind motion, which is exactly the rotation-versus-motion relationship the check was built to expose.

Bypass surface: the RANDOM-XZ/RANDOM-Y jitter. randomNumber() is -1, 0 or 1, so each tick the aim point hops by up to +/-xz (and +/-y) blocks; the convergence point jumps with it and never satisfies the 1e-8 stability window. A target strafing at speed also moves the convergence point between ticks, which is why 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 mouse movement only inside a window around interactions. It records each move's yaw/pitch delta as a vector, records click ticks from InteractEntityEvent/InteractWorldEvent, and on every move where a click happened MOVES_AFTER_HIT (2) ticks ago it inspects the last 4 moves for three patterns. Branch A (stutter): maxSpeed - minSpeed > 4 with minSpeed < 0.01 and maxAngle < 0.1 radians and lastSpeed > 1 - a rotation that alternates between a near-total stall and a fast move while staying within ~5.7 degrees of the same bearing. Branch B (twitch): two consecutive moves faster than 20 degrees per tick with an angle over 2.86 radians between them. Branch C (jump discontinuity): speed drops by more than 30 between consecutive moves with an angle over 0.8 radians. It is a cancelless hint check (VL 5, 'failed aimbot (heuristic)').

Sigma's stepAngle produces exactly the branch A shape inside the click window: while far from the target the view advances at the constant SPEED-H/SPEED-V factor, then the exact-remainder snap parks it, so the sampled moves are a fixed-speed run followed by a stall (minSpeed < 0.01), all along the bearing to the target (maxAngle stays under 0.1 rad), with maxSpeed - minSpeed equal to the step factor (default 20 > 4). The module never clicks itself, but the WEAPON gate guarantees it runs while the player is attacking with the sword, so clicks are present in the window. Branch C can also fire when the target crosses the view line and the required delta reverses sign between ticks.

Bypass surface: the check only fires when a click lands in the 2-tick window, and branch A needs the speed spread. Lowering SPEED-H/SPEED-V to a few degrees per tick shrinks maxSpeed - minSpeed below 4 and keeps lastSpeed at or under 1, which defeats branch A; the module still assists, but the sample statistics fall inside human range.

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 detects aim-bots by solving the greatest common divisor of pitch deltas. It collects |deltaPitch| values that are nonzero, at most PITCHRATE_LIMIT (config 'ignorePitchrateHigherThan', default 0.96 degrees) and not at +/-90 pitch; once 10 samples accumulate it computes the rational GCD, and if the new GCD differs from the previous batch by more than 0.001 it folds the previous GCD into the sample and recomputes. It then fails when the GCD is 'practically unsolvable' (below 1e-5) and rewards otherwise, keeping the GCD as the rolling baseline. The class comment explains the model: every legit pitch change is divisible by the constant determined by the in-game mouse sensitivity, so a stream of real deltas must share a GCD, while a stream of arbitrary deltas has none.

Sigma's default rotation is caught on its snap ticks, not its steps. The 15-degree pitch steps are above the 0.96 sampling cap, so the sustained rotation never enters the window. What does enter is the exact-remainder snap: when the pitch remainder falls below the cap, stepAngle adds the remainder - a float derived from atan2 of entity positions, effectively continuous precision. Once one such remainder joins the 10-sample window, the rational GCD of the batch collapses below 1e-5 and the check fails. Detection therefore lands on convergence episodes; a target that keeps moving keeps feeding fresh remainders and keeps the window failing.

Bypass surface: the check samples nothing while deltas are zero or above 0.96, so a stock module is invisible during the constant-speed phase and only exposed at the snap. Configuring SPEED-V to a value at or below 0.96 puts every step into the window, but then the stream is exact fixed factors plus exact remainders, and the GCD still collapses once a remainder joins; the only clean pass is a target that stays aligned long enough that no nonzero sub-0.96 delta is ever produced.

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 and maps it through the Minecraft sensitivity formula (modifier = cbrt(0.8333 * gcd), finalSensitivity = (1.666 * modifier - 0.3333) * 200). A strict path handles small deltas: for |deltaPitch| below 0.31 it scans the 200-entry SENSITIVITY_MCP_VALUES table (each entry is the per-pixel rotation of a sensitivity setting) and records an index when the table's gcdValue matches the delta within 1e-3. The mode of the last 40 samples becomes the player's sensitivity and is pushed into playerProfile.getSensitivity() for the rotation checks to consume; the same model appears in Spartan's utils/math/Sensitivity.calculateSensitivity (deltaYaw / gcdValue).

Sigma's rotation stream cannot be attributed to any sensitivity. At the default SPEED-V 15, consecutive pitch deltas have a GCD of 15, which the formula converts to roughly 706 - far beyond the 0-200 table, so no valid sensitivity is derived. The snap-phase remainders are position-derived continuous floats whose GCD is unsolvable, landing near index 0. Either way the processor reports an invalid or wildly unstable sensitivity, which is the exact signal the aim checks treat as non-human. Only a SPEED-V low enough that the gcd maps inside the table (steps below roughly half a degree per tick) produces a valid sensitivity, and then the whole stream collapses to one fixed value - the signature of a single mouse setting, which the strict path treats as normal, making that the one configuration that survives the grid.

← Back to Analysis Hub