Spicy CS:GO Spinbot module 2 files, 264 lines

Spicy CS:GO Spinbot: Full Source Analysis

Spicy's CS:GO Spinbot is a meme look-spin that runs an unbounded yaw random walk of 45 plus a random value up to 1000 degrees per pre-update, renders the player model with the spun yaw…

info/spicyclient/modules/memes/CsgoSpinbot.java · GitHub source ↗

Published 2026-08-13 · Updated 2026-08-13

Packets This Module Uses

Analysis

Overview

Spicy's CS:GO Spinbot is a meme look-spin that runs an unbounded yaw random walk of 45 plus a random value up to 1000 degrees per pre-update, renders the player model with the spun yaw and a 90-degree pitch through RenderUtils static flags consumed by RendererLivingEntity, and rewrites outbound C05 and C06 look packets with the spun rotation. Every C08, C02, C0A or C07 packet arms a 500ms timer and injects a fresh C05 with the real rotation before the action packet, so the server sees an honest look at the moment of each interaction, then up to half a second of honest rotation, then the spin resumes. The mode setting selects nothing: all three modes run the same random walk, and the whole module is inert while the client's killaura is enabled.

The accumulator

EventUpdate pre, gated on the killaura being off, adds 45 plus a random float scaled by 1000 to the lastYaw field every tick and never wraps the value, so the yaw drifts over thousands of degrees in a few seconds. The render side mirrors it: setCustomYaw(lastYaw) and, when lookDown is enabled, setCustomPitch(90) flip static flags that RendererLivingEntity reads for the player's own model, applying the custom pitch and writing the spun yaw into renderYawOffset, which is what makes the visible body spin.

The interaction window

EventSendPacket pre handles the timing split. When the outgoing packet is a C08 placement, C02 use-entity, C0A swing or C07 digging, the handler resets the timer, sets skipRender, and pushes a C05PacketPlayerLook with the player's real yaw, real pitch and onGround through sendPacketNoEvent, so an honest look lands immediately before the action packet. While the timer reports less than 500ms since that arm, the render flags are reset and the handler returns without rewriting anything; past 500ms, C05 and C06 packets get their yaw overwritten with lastYaw and their pitch with 90 when lookDown is on. The C04 branch builds a C05 replacement whose send call is commented out, leaving the original position packet untouched, which is dead code: C04 carries no look fields anyway.

What the server sees

The look stream alternates between two regimes. In the idle regime every C03 look packet carries a yaw step between 45 and roughly 1045 degrees and a pitch pinned to 90, which is a rotation signature no human produces. In the action regime, each C08, C02, C0A or C07 is preceded by a real-look C05, and the following half second of C03s carries honest rotation before the spin resumes. Position packets never carry the spoof. The mode setting is decorative: the handler never reads it, so Slow Smooth, Fast Smooth and Random are the same behavior.

source CsgoSpinbot.java (module)

CsgoSpinbot.java137 lines · JavaOriginal ↗
1
package info.spicyclient.modules.memes;
2
3
import java.util.Random;
4
5
import org.lwjgl.input.Keyboard;
6
7
import info.spicyclient.SpicyClient;
8
import info.spicyclient.chatCommands.Command;
9
import info.spicyclient.events.Event;
10
import info.spicyclient.events.listeners.EventMotion;
11
import info.spicyclient.events.listeners.EventPacket;
12
import info.spicyclient.events.listeners.EventSendPacket;
13
import info.spicyclient.events.listeners.EventUpdate;
14
import info.spicyclient.modules.Module;
15
import info.spicyclient.settings.BooleanSetting;
16
import info.spicyclient.settings.ModeSetting;
17
import info.spicyclient.settings.NumberSetting;
18
import info.spicyclient.util.RenderUtils;
19
import info.spicyclient.util.Timer;
20
import net.minecraft.network.play.client.C02PacketUseEntity;
21
import net.minecraft.network.play.client.C03PacketPlayer;
22
import net.minecraft.network.play.client.C07PacketPlayerDigging;
23
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;
24
import net.minecraft.network.play.client.C0APacketAnimation;
25
import net.minecraft.network.play.client.C0EPacketClickWindow;
26
import net.minecraft.network.play.client.C03PacketPlayer.C05PacketPlayerLook;
27
28
public class CsgoSpinbot extends Module {
29
	
30
	private float yaw = 0;
31
	private float lastYaw = 0;
32
	
33
	ModeSetting mode = new ModeSetting("Mode", "Slow Smooth", "Slow Smooth", "Fast Smooth", "Random");
34
	BooleanSetting lookDown = new BooleanSetting("Look Down", true);
35
	
36
	public CsgoSpinbot() {
37
		super("CS:GO Spinbot", Keyboard.KEY_NONE, Category.BETA);
38
		resetSettings();
39
	}
40
	
41
	@Override
42
	public void resetSettings() {
43
		this.settings.clear();
44
		this.addSettings(mode, lookDown);
45
	}
46
	
47
	@Override
48
	public void onEnable() {
49
		
50
		yaw = mc.thePlayer.rotationYaw;
51
		lastYaw = mc.thePlayer.rotationYaw;
52
		
53
	}
54
	
55
	@Override
56
	public void onDisable() {
57
		RenderUtils.resetPlayerYaw();
58
		RenderUtils.resetPlayerPitch();
59
	}
60
	
61
	private static Timer timer = new Timer();
62
	
63
	public transient boolean skipRender = false;
64
	
65
	@Override
66
	public void onEvent(Event e) {
67
		
68
		if (e instanceof EventUpdate && !SpicyClient.config.killaura.isEnabled()) {
69
			
70
			if (e.isPre()) {
71
				
72
				lastYaw += 45 + (new Random().nextFloat() * 1000);
73
				
74
				if (skipRender) {
75
					RenderUtils.resetPlayerPitch();
76
					RenderUtils.resetPlayerYaw();
77
					skipRender = false;
78
					return;
79
				}
80
				
81
				RenderUtils.setCustomYaw(lastYaw);
82
				if (lookDown.isEnabled()) {
83
					RenderUtils.setCustomPitch(90);
84
				}else {
85
					RenderUtils.resetPlayerPitch();
86
				}
87
				
88
			}
89
			
90
		}
91
		else if (SpicyClient.config.killaura.isEnabled()) {
92
			
93
		}
94
		
95
		if (e instanceof EventSendPacket && !SpicyClient.config.killaura.isEnabled()) {
96
			
97
			if (e.isPre()) {
98
				EventSendPacket event = (EventSendPacket) e;
99
				if (event.packet instanceof C08PacketPlayerBlockPlacement || event.packet instanceof C02PacketUseEntity || event.packet instanceof C0APacketAnimation || event.packet instanceof C07PacketPlayerDigging) {
100
					timer.reset();
101
					skipRender = true;
102
					mc.thePlayer.sendQueue.getNetworkManager().sendPacketNoEvent(new C03PacketPlayer.C05PacketPlayerLook(mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch, mc.thePlayer.onGround));
103
				}
104
				
105
				if (!timer.hasTimeElapsed(500, false)) {
106
					RenderUtils.resetPlayerYaw();
107
					RenderUtils.resetPlayerPitch();
108
					return;
109
				}
110
				
111
				if (((EventSendPacket) e).packet instanceof C03PacketPlayer.C05PacketPlayerLook || ((EventSendPacket) e).packet instanceof C03PacketPlayer.C06PacketPlayerPosLook){
112
					((C03PacketPlayer)((EventSendPacket) e).packet).setYaw(lastYaw);
113
					
114
					if (lookDown.enabled) {
115
						((C03PacketPlayer)((EventSendPacket) e).packet).setPitch(90f);
116
					}
117
					
118
				}
119
				else if (((EventSendPacket) e).packet instanceof C03PacketPlayer.C04PacketPlayerPosition){
120
					C03PacketPlayer.C04PacketPlayerPosition oldPosPacket = (C03PacketPlayer.C04PacketPlayerPosition) event.packet;
121
					C03PacketPlayer.C05PacketPlayerLook newPosLookPacket = new C03PacketPlayer.C05PacketPlayerLook(lastYaw, mc.thePlayer.rotationPitch, mc.thePlayer.onGround);
122
					
123
					if (lookDown.enabled) {
124
						newPosLookPacket.setPitch(90f);
125
					}
126
					
127
					//mc.getNetHandler().getNetworkManager().sendPacket(newPosLookPacket);
128
					
129
				}
130
				
131
			}
132
			
133
		}
134
		
135
	}
136
	
137
}

What this file does

The module is two handlers. EventUpdate pre runs the accumulator: lastYaw plus 45 plus a random value up to 1000 per tick, then the render writes through setCustomYaw and setCustomPitch, with a skipRender latch that suppresses the spin for one tick after an action. EventSendPacket pre runs the interaction window: action packets arm the timer and inject the real-look C05, packets inside the 500ms window pass untouched, and C05 or C06 packets outside the window get the spun yaw and the optional 90-degree pitch.

The mode setting is declared but never read by either handler, so the three advertised modes collapse into one behavior, and the killaura gate makes the module fully inert while the client's own killaura holds a target. onDisable resets both render flags, so the model returns to the real rotation the moment the module turns off.

source RenderUtils.java (model spin carrier)

RenderUtils.java127 lines · JavaOriginal ↗
1
package info.spicyclient.util;
2
3
import org.lwjgl.opengl.GL11;
4
5
import info.spicyclient.chatCommands.Command;
6
import net.minecraft.client.Minecraft;
7
import net.minecraft.client.entity.AbstractClientPlayer;
8
import net.minecraft.client.entity.EntityPlayerSP;
9
import net.minecraft.client.renderer.RenderGlobal;
10
import net.minecraft.client.renderer.Tessellator;
11
import net.minecraft.client.renderer.WorldRenderer;
12
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
13
import net.minecraft.util.AxisAlignedBB;
14
import net.minecraft.util.BlockPos;
15
import net.minecraft.util.Vec3;
16
17
public class RenderUtils {
18
	
19
	// Made by lavaflowglow 11/19/2020 3:39 AM
20
	
21
	public static boolean SetCustomYaw = false;
22
	public static float CustomYaw = 0;
23
	
24
	public static void setCustomYaw(float customYaw) {
25
		CustomYaw = customYaw;
26
		SetCustomYaw = true;
27
	}
28
	
29
	public static void resetPlayerYaw() {
30
		SetCustomYaw = false;
31
	}
32
	
33
	public static float getCustomYaw() {
34
		
35
		return CustomYaw;
36
		
37
	}
38
	public static boolean SetCustomPitch = false;
39
	public static float CustomPitch = 0;
40
	
41
	public static void setCustomPitch(float customPitch) {
42
		CustomPitch = customPitch;
43
		SetCustomPitch = true;
44
	}
45
	
46
	public static void resetPlayerPitch() {
47
		SetCustomPitch = false;
48
	}
49
	
50
	public static float getCustomPitch() {
51
		
52
		return CustomPitch;
53
		
54
	}
55
	
56
	// Made by lavaflowglow 11/19/2020 3:39 AM
57
	
58
	public static Minecraft mc = Minecraft.getMinecraft();
59
	public static WorldRenderer worldRenderer = Tessellator.getInstance().getWorldRenderer();
60
	public static Tessellator tessellator = Tessellator.getInstance();
61
	
62
	// Someone gave me this code
63
	public static void drawPlayerBox(Double posX, Double posY, Double posZ, AbstractClientPlayer player){
64
		double x =
65
			posX - 0.5
66
				- Minecraft.getMinecraft().getRenderManager().renderPosX;
67
		double y =
68
			posY
69
				- Minecraft.getMinecraft().getRenderManager().renderPosY;
70
		double z =
71
			posZ - 0.5
72
				- Minecraft.getMinecraft().getRenderManager().renderPosZ;
73
		GL11.glBlendFunc(770, 771);
74
		GL11.glEnable(GL11.GL_BLEND);
75
		GL11.glLineWidth(2.0F);
76
		GL11.glColor4d(0, 1, 0, 0.15F);
77
		GL11.glDisable(GL11.GL_TEXTURE_2D);
78
		GL11.glDisable(GL11.GL_DEPTH_TEST);
79
		GL11.glDepthMask(false);
80
		//drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
81
		GL11.glColor4d(1, 1, 1, 0.5F);
82
		RenderGlobal.func_181561_a(new AxisAlignedBB(x, y, z,
83
			x + 1.0, y + 2.0, z + 1.0));
84
		GL11.glEnable(GL11.GL_TEXTURE_2D);
85
		GL11.glEnable(GL11.GL_DEPTH_TEST);
86
		GL11.glDepthMask(true);
87
		GL11.glDisable(GL11.GL_BLEND);
88
		GL11.glColor4f(1, 1, 1, 1);
89
	}
90
	
91
	public static void drawLine(double minX, double minY, double minZ, double maxX, double maxY, double maxZ) {
92
		
93
        Tessellator tessellator = Tessellator.getInstance();
94
        WorldRenderer worldrenderer = tessellator.getWorldRenderer();
95
        
96
        minX -= Minecraft.getMinecraft().getRenderManager().renderPosX;
97
        minY -= Minecraft.getMinecraft().getRenderManager().renderPosY;
98
        minZ -= Minecraft.getMinecraft().getRenderManager().renderPosZ;
99
        
100
        maxX -= Minecraft.getMinecraft().getRenderManager().renderPosX;
101
        maxY -= Minecraft.getMinecraft().getRenderManager().renderPosY;
102
        maxZ -= Minecraft.getMinecraft().getRenderManager().renderPosZ;
103
        
104
		GL11.glBlendFunc(770, 771);
105
		GL11.glEnable(GL11.GL_BLEND);
106
		GL11.glLineWidth(3.0F);
107
		GL11.glColor4d(0, 1, 0, 0.15F);
108
		GL11.glDisable(GL11.GL_TEXTURE_2D);
109
		GL11.glDisable(GL11.GL_DEPTH_TEST);
110
		GL11.glDepthMask(false);
111
		//drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
112
		GL11.glColor4d(1, 1, 1, 0.5F);
113
        
114
        worldrenderer.begin(1, DefaultVertexFormats.POSITION);
115
        worldrenderer.pos(minX, minY, minZ).endVertex();
116
        worldrenderer.pos(maxX, maxY, maxZ).endVertex();
117
        tessellator.draw();
118
        
119
		GL11.glEnable(GL11.GL_TEXTURE_2D);
120
		GL11.glEnable(GL11.GL_DEPTH_TEST);
121
		GL11.glDepthMask(true);
122
		GL11.glDisable(GL11.GL_BLEND);
123
		GL11.glColor4f(1, 1, 1, 1);
124
        
125
	}
126
	
127
}

What this file does

This class carries the spin from the module to the renderer through static state: setCustomYaw and setCustomPitch store the value and set a flag, resetPlayerYaw and resetPlayerPitch clear them, and the getters feed the consumer. The consumer is RendererLivingEntity, which substitutes the custom pitch into the player's render pitch and writes the custom yaw into renderYawOffset, so the spinning body the player sees is the same static flag pair the module drives.

The class is the right supporting file because it separates the two surfaces of the module: the wire surface is the C05 and C06 rewrite in the module file, and the cosmetic surface is this flag pair. The reset calls on disable and in the interaction window are what keep the model honest during combat, which is the behavior the countering checks below measure against.

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 PacketAnalysisAimStep (frozen-axis rotation)

PacketAnalysisAimStep.java59 lines · Java
1
package de.photon.anticheataddition.modules.checks.packetanalysis;
2
3
import de.photon.anticheataddition.modules.ViolationModule;
4
import de.photon.anticheataddition.user.User;
5
import de.photon.anticheataddition.util.mathematics.MathUtil;
6
import de.photon.anticheataddition.util.minecraft.world.entity.EntityUtil;
7
import de.photon.anticheataddition.util.violationlevels.Flag;
8
import de.photon.anticheataddition.util.violationlevels.ViolationLevelManagement;
9
import de.photon.anticheataddition.util.violationlevels.ViolationManagement;
10
import org.bukkit.event.EventHandler;
11
import org.bukkit.event.Listener;
12
import org.bukkit.event.player.PlayerMoveEvent;
13
14
public final class PacketAnalysisAimStep extends ViolationModule implements Listener
15
{
16
    public static final PacketAnalysisAimStep INSTANCE = new PacketAnalysisAimStep();
17
    private static final double NO_MOVE_DELTA_THRESHOLD = 0.00001D;
18
    private static final double STEP_MOVE_DELTA_THRESHOLD = 1D;
19
20
    private PacketAnalysisAimStep()
21
    {
22
        super("PacketAnalysis.parts.AimStep");
23
    }
24
25
    @EventHandler(ignoreCancelled = true)
26
    public void onMove(PlayerMoveEvent event)
27
    {
28
        final var user = User.getUser(event.getPlayer());
29
        if (User.isUserInvalid(user, this)
30
            || event.getTo() == null
31
            || user.getPlayer().isInsideVehicle()
32
            // Not flying (vanilla or elytra) as it may trigger some fps
33
            || user.getPlayer().isFlying()
34
            || EntityUtil.INSTANCE.isFlyingWithElytra(user.getPlayer())) return;
35
36
        final double yawDelta = MathUtil.yawDistance(event.getTo().getYaw(), event.getFrom().getYaw());
37
        final double pitchDelta = MathUtil.absDiff(event.getTo().getPitch(), event.getFrom().getPitch());
38
39
        // False positives as the pitch is capped if a player looks straight up or down.
40
        if (pitchDelta < NO_MOVE_DELTA_THRESHOLD && (event.getTo().getPitch() == 90 || event.getTo().getPitch() == -90)) return;
41
42
        if (user.getData().counter.packetAnalysisAimStepFails.conditionallyIncDec(isAimStep(yawDelta, pitchDelta) || isAimStep(pitchDelta, yawDelta))) {
43
            getManagement().flag(Flag.of(user).setAddedVl(20).setDebug(() -> "PacketAnalysisData-Debug | Player: " + user.getPlayer().getName() + " sent step-like aim movements (d_yaw: " + yawDelta + ", d_pitch: " + pitchDelta + ")"));
44
        }
45
    }
46
47
    private static boolean isAimStep(double deltaOne, double deltaTwo)
48
    {
49
        return deltaOne < NO_MOVE_DELTA_THRESHOLD && deltaTwo > STEP_MOVE_DELTA_THRESHOLD;
50
    }
51
52
    @Override
53
    protected ViolationManagement createViolationManagement()
54
    {
55
        return ViolationLevelManagement.builder(this)
56
                                       .emptyThresholdManagement()
57
                                       .withDecay(200, 2).build();
58
    }
59
}

How it counteracts this module

Photon's PacketAnalysisAimStep flags rotation ticks where one axis moves by less than 0.00001 while the other moves by more than 1, the signature of a machine holding one axis still, with 20 VL per flag and a 200ms decay. The module's pitch pin makes the pitch delta exactly zero on every spun tick while the yaw steps between 45 and roughly 1045 degrees, so every idle rotation tick satisfies the frozen-axis test and the check accumulates VL as long as the spin runs.

The honest 500ms windows after each action break the pattern for a few ticks, since both axes then move with the mouse, but the spin resumes and the flags resume with it. This is the definitive counter for the module: no amount of randomization in the yaw step matters, because the pitch pin is what trips the frozen-axis test on every tick.

anticheat PacketAnalysisPerfectRotation (exact-grid deltas)

PacketAnalysisPerfectRotation.java108 lines · Java
1
package de.photon.anticheataddition.modules.checks.packetanalysis;
2
3
import de.photon.anticheataddition.modules.ViolationModule;
4
import de.photon.anticheataddition.user.User;
5
import de.photon.anticheataddition.user.data.ViolationCounter;
6
import de.photon.anticheataddition.util.mathematics.MathUtil;
7
import de.photon.anticheataddition.util.violationlevels.Flag;
8
import de.photon.anticheataddition.util.violationlevels.ViolationLevelManagement;
9
import de.photon.anticheataddition.util.violationlevels.ViolationManagement;
10
import org.bukkit.event.EventHandler;
11
import org.bukkit.event.Listener;
12
import org.bukkit.event.player.PlayerMoveEvent;
13
14
/**
15
 * Checks for suspicious packet rotation patterns that correspond to precise values like 0.25 or 0.1.
16
 */
17
public final class PacketAnalysisPerfectRotation extends ViolationModule implements Listener
18
{
19
    public static final PacketAnalysisPerfectRotation INSTANCE = new PacketAnalysisPerfectRotation();
20
21
    private PacketAnalysisPerfectRotation()
22
    {
23
        super("PacketAnalysis.parts.PerfectRotation");
24
    }
25
26
    private static final double EQUALITY_EPSILON = 0.0000000001;
27
    private static final double[] MULTIPLE_PATTERNS = {0.1, 0.25};
28
29
    private static boolean isNearlyEqual(double reference, double d)
30
    {
31
        return MathUtil.absDiff(reference, d) <= EQUALITY_EPSILON;
32
    }
33
34
    /**
35
     * Checks if the second value is an integer multiple of the first.
36
     *
37
     * @param reference The reference value.
38
     * @param d         The value to check.
39
     *
40
     * @return True if d is an integer multiple of reference, false otherwise.
41
     */
42
    private static boolean isIntegerMultiple(double reference, double d)
43
    {
44
        final double potentialMultiple = d / reference;
45
        return isNearlyEqual(potentialMultiple, Math.rint(potentialMultiple));
46
    }
47
48
    /**
49
     * Checks if the provided rotation value represents no change in rotation.
50
     * No rotation is defined as any rotation by 0 degrees or a multiple of 360 degrees.
51
     *
52
     * @param rotation The rotation value.
53
     *
54
     * @return True if there's no rotation, false otherwise.
55
     */
56
    private static boolean noRotation(double rotation)
57
    {
58
        // 0 degrees or full circles (multiple of 360 degrees)
59
        return isNearlyEqual(0, rotation) || isIntegerMultiple(360, rotation);
60
    }
61
62
    /**
63
     * Checks the pattern of rotation changes and flags suspicious rotations.
64
     *
65
     * @param user         The user under check.
66
     * @param rotationDiff The rotation difference.
67
     * @param counter      The violation counter.
68
     */
69
    private void checkPatterns(User user, double rotationDiff, ViolationCounter counter)
70
    {
71
        // Ignore 0 and 360 degrees as they represent no change in rotation.
72
        if (noRotation(rotationDiff)) return;
73
74
        // Check if the angle change is valid (not infinite or NaN).
75
        if (Double.isInfinite(rotationDiff) || Double.isNaN(rotationDiff))
76
            getManagement().flag(Flag.of(user).setAddedVl(5).setDebug(() -> "PacketAnalysisData-Debug | Player: " + user.getPlayer().getName() + " sent infinite rotation diffs."));
77
78
        for (double pattern : MULTIPLE_PATTERNS) {
79
            // Normal players sometimes have a multiple, but not consistently -> counter.
80
            if (counter.conditionallyIncDec(isIntegerMultiple(pattern, rotationDiff))) {
81
                getManagement().flag(Flag.of(user).setAddedVl(3).setDebug(() -> "PacketAnalysisData-Debug | Player: " + user.getPlayer().getName() + " sent suspicious rotation diff (" + rotationDiff + ")."));
82
            }
83
        }
84
    }
85
86
    @EventHandler(ignoreCancelled = true)
87
    public void onPlayerMove(PlayerMoveEvent event)
88
    {
89
        final var user = User.getUser(event.getPlayer());
90
        // Ignore invalid users and players in vehicles (boat false positive).
91
        if (User.isUserInvalid(user, this) || event.getTo() == null || user.getPlayer().isInsideVehicle()) return;
92
93
        final double yawDiff = MathUtil.yawDistance(event.getTo().getYaw(), event.getFrom().getYaw());
94
        final double pitchDiff = MathUtil.absDiff(event.getTo().getPitch(), event.getFrom().getPitch());
95
96
        checkPatterns(user, yawDiff, user.getData().counter.packetAnalysisPerfectRotationYawFails);
97
        checkPatterns(user, pitchDiff, user.getData().counter.packetAnalysisPerfectRotationPitchFails);
98
    }
99
100
101
    @Override
102
    protected ViolationManagement createViolationManagement()
103
    {
104
        return ViolationLevelManagement.builder(this)
105
                                       .emptyThresholdManagement()
106
                                       .withDecay(100, 2).build();
107
    }
108
}

How it counteracts this module

Photon's PacketAnalysisPerfectRotation flags rotation deltas that are exact integer multiples of 0.1 or 0.25 within an epsilon of 1e-10, using a consistency counter that increments on each match and flags once matches outpace decay. The pinned pitch of 90 degrees is exactly 900 times 0.1, so every spun tick with lookDown enabled feeds the counter, and the injected real-look C05 before an action adds a full-scale rotation jump on top.

The yaw steps themselves, 45 plus a random value up to 1000, are rarely exact multiples, so the pitch pin is the reliable contributor; the honest framing is that the check scores the constant 90-degree value rather than the random yaw. This is the second Photon check that keys on the pitch pin, which is why the pin is the module's structural weakness rather than its random yaw.

anticheat AimbotHeuristic (click-gated rotation snap)

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

Hawk's AimbotHeuristic scores raw unwrapped yaw deltas and only evaluates while the click window is open, keyed on a swing or interaction having occurred recently. The module's injection opens exactly that window: a C02 use-entity or C0A swing arms the handler, which immediately sends a C05 with the real rotation, snapping the server-side look from the spun yaw (thousands of degrees off) back to the honest value in one packet. The raw delta of that snap far exceeds the twitch branch thresholds on both the yaw and pitch axes.

The honest boundary is the gate: a player who never swings or attacks never opens the click window, so the check only fires on the injection ticks, not on the spin itself. The 500ms honest rotation after the injection also decays the score, so the check is a burst detector on the snap rather than a continuous scorer.

anticheat RotationSnapHeuristic (snap signature)

RotationSnapHeuristic.java351 lines · Java
1
/*
2
 * Copyright 2026 Intave
3
 *
4
 * This software is licensed under the PolyForm Perimeter License 1.0.0.
5
 * You may use this software for any purpose, except for providing to
6
 * others any product that competes with the software.
7
 *
8
 * A copy of the license is available at:
9
 *   https://polyformproject.org/licenses/perimeter/1.0.0/
10
 */
11
12
package de.jpx3.intave.check.combat.heuristics.combatpatterns.rotation;
13
14
import com.comphenix.protocol.events.PacketEvent;
15
import de.jpx3.intave.check.combat.Heuristics;
16
import de.jpx3.intave.check.combat.heuristics.ClassicHeuristic;
17
import de.jpx3.intave.check.combat.heuristics.HeuristicsClassicType;
18
import de.jpx3.intave.math.MathHelper;
19
import de.jpx3.intave.module.linker.bukkit.BukkitEventSubscription;
20
import de.jpx3.intave.module.linker.packet.ListenerPriority;
21
import de.jpx3.intave.module.linker.packet.PacketSubscription;
22
import de.jpx3.intave.module.tracker.entity.Entity;
23
import de.jpx3.intave.packet.reader.EntityUseReader;
24
import de.jpx3.intave.share.BoundingBox;
25
import de.jpx3.intave.share.ClientMath;
26
import de.jpx3.intave.user.User;
27
import de.jpx3.intave.user.meta.AttackMetadata;
28
import de.jpx3.intave.user.meta.CheckCustomMetadata;
29
import de.jpx3.intave.user.meta.MovementMetadata;
30
import de.jpx3.intave.world.raytrace.EntityRaytraceBlockConstraint;
31
import de.jpx3.intave.world.raytrace.Raytrace;
32
import de.jpx3.intave.world.raytrace.Raytracing;
33
import org.bukkit.entity.Player;
34
import org.bukkit.event.block.BlockPlaceEvent;
35
36
import java.util.concurrent.atomic.AtomicLong;
37
38
import static de.jpx3.intave.check.movement.physics.environment.MoveMetric.TELEPORT;
39
import static de.jpx3.intave.module.linker.packet.PacketId.Client.*;
40
41
public final class RotationSnapHeuristic extends ClassicHeuristic<RotationSnapHeuristic.RotationSnapHeuristicMeta> {
42
  // Defines how long after a block place, arm swing or attack the VL for mitigations should be increased. 
43
  private static final long VL_BOOST_MODIFIER_TIME = (1000 / 20) * 3; // Set to 3 ticks. (150ms)
44
45
  public RotationSnapHeuristic(Heuristics parentCheck) {
46
    super(parentCheck, HeuristicsClassicType.ROTATION_SNAP, RotationSnapHeuristicMeta.class);
47
  }
48
49
  @PacketSubscription(
50
    priority = ListenerPriority.HIGH,
51
    packetsIn = {
52
      ARM_ANIMATION
53
    }
54
  )
55
  public void receiveSwingPacket(PacketEvent event) {
56
    Player player = event.getPlayer();
57
    User user = userOf(player);
58
    RotationSnapHeuristicMeta meta = metaOf(user);
59
60
    meta.lastSwing = System.currentTimeMillis();
61
  }
62
63
  @BukkitEventSubscription
64
  public void on(BlockPlaceEvent place) {
65
    Player player = place.getPlayer();
66
    User user = userOf(player);
67
    RotationSnapHeuristicMeta meta = metaOf(user);
68
    meta.lastBlockPlace.set(System.currentTimeMillis());
69
  }
70
71
  @PacketSubscription(
72
    priority = ListenerPriority.HIGH,
73
    packetsIn = {
74
      ATTACK_ENTITY, USE_ENTITY
75
    }
76
  )
77
  public void receiveAttackPacket(
78
    User user, EntityUseReader reader
79
  ) {
80
    if (reader.isAttackPacket()) {
81
      metaOf(user).lastAttack = System.currentTimeMillis();
82
    }
83
  }
84
85
  @PacketSubscription(
86
    priority = ListenerPriority.HIGH,
87
    packetsIn = {
88
      POSITION_LOOK, LOOK
89
    }
90
  )
91
  public void receiveRotationPacket(PacketEvent event) {
92
    metaOf(userOf(event.getPlayer())).rotationPacketCounter++;
93
  }
94
95
  private double keysToRotation(int strafe, int forward) {
96
    return Math.toDegrees(Math.atan2(strafe, forward)) - 90;
97
  }
98
99
  static double computeYawMotion(float lastRotationYaw, float rotationYaw) {
100
    return Math.abs(lastRotationYaw - rotationYaw);
101
  }
102
103
  static boolean isRotationSnapDetected(
104
    double previousYawMotion, double lastYawMotion, double currentYawMotion,
105
    boolean recentSwingOrAttack, int rotationPacketCounter, int ticksPastTeleport
106
  ) {
107
    boolean isSuspicious = previousYawMotion < 9 && lastYawMotion > 40 && currentYawMotion < 9;
108
    return isSuspicious && recentSwingOrAttack && rotationPacketCounter > 10 && ticksPastTeleport > 7;
109
  }
110
111
  private double floorModDouble(double x, double y) {
112
    return (x - Math.floor(x / y) * y);
113
  }
114
115
  @PacketSubscription(
116
    priority = ListenerPriority.HIGH,
117
    packetsIn = {
118
      FLYING, LOOK, POSITION, POSITION_LOOK
119
    }
120
  )
121
  public void receiveMovementPacket(PacketEvent event) {
122
    Player player = event.getPlayer();
123
    User user = userOf(player);
124
    MovementMetadata movementData = user.meta().movement();
125
126
    if (movementData.ticksPast(TELEPORT) == 0) {
127
      return;
128
    }
129
    RotationSnapHeuristicMeta meta = metaOf(user);
130
131
    if (movementData.offsetMotionX() != 0 && movementData.offsetMotionZ() != 0) {
132
      meta.internalViolation -= 0.01f;
133
      if (meta.internalViolation < 0)
134
        meta.internalViolation = 0;
135
    }
136
137
    double yawMotion = computeYawMotion(movementData.lastRotationYaw, movementData.rotationYaw);
138
    AttackMetadata attackData = user.meta().attack();
139
140
    if ((yawMotion > 40 && meta.yawMotions[1] < 9) || (yawMotion > 25 && meta.yawMotions[1] == 0)) {
141
      if (meta.lastKeyStrafe != movementData.keyStrafe || meta.lastKeyForward != movementData.keyForward) {
142
        double directionLast = movementData.rotationYaw + keysToRotation(meta.lastKeyStrafe, meta.lastKeyForward);
143
        double direction = movementData.lastRotationYaw + keysToRotation(movementData.keyStrafe, movementData.keyForward);
144
145
        direction = floorModDouble(direction, 360);
146
        directionLast = floorModDouble(directionLast, 360);
147
148
//      String key = resolveKeysFromInput(movementData.keyForward, movementData.keyStrafe);
149
//      String lastKey = resolveKeysFromInput(meta.lastKeyForward, meta.lastKeyStrafe);
150
        boolean silentMovement = (int) (ClientMath.wrapAngleTo180_double(directionLast - direction) / 45d) == 0;
151
        if (movementData.keyForward != meta.lastKeyForward || movementData.keyStrafe != meta.lastKeyStrafe) {
152
          if (silentMovement && (movementData.keyForward != 0 || movementData.keyStrafe != 0) && (meta.lastKeyForward != 0 || meta.lastKeyStrafe != 0)) {
153
            meta.silentMovements[0] = KeyStates.SILENTMOVE;
154
          } else {
155
            meta.silentMovements[0] = KeyStates.CHANGED;
156
          }
157
        }
158
      }
159
160
      Tick tick = new Tick(
161
        meta.lastLastPosX, meta.lastLastPosY, meta.lastLastPosZ,
162
        movementData.lastRotationYaw, movementData.lastRotationPitch
163
      );
164
      meta.movementAtTick[0] = tick;
165
    }
166
167
    boolean isSuspicious = (meta.yawMotions[1] == 0 && meta.yawMotions[0] > 25 && yawMotion < 9);
168
    boolean liteFlag = isSuspicious && meta.silentMovements[1] == KeyStates.SILENTMOVE && meta.rotationPacketCounter > 10 && movementData.ticksPast(TELEPORT) > 7;
169
170
    boolean snapDetected = isRotationSnapDetected(
171
      meta.yawMotions[1], meta.yawMotions[0], yawMotion,
172
      wasRecent(meta.lastSwing) || wasRecent(meta.lastAttack),
173
      meta.rotationPacketCounter,
174
      movementData.ticksPast(TELEPORT)
175
    );
176
177
    if (snapDetected) {
178
      double valueOfSnap = meta.yawMotions[0];
179
      String details = "yaw: ["
180
        + MathHelper.formatDouble(meta.yawMotions[1], 2)
181
        + "/" + MathHelper.formatDouble(meta.yawMotions[0], 2)
182
        + "/" + MathHelper.formatDouble(yawMotion, 2) + "]";
183
184
      if (meta.silentMovements[1] == KeyStates.SILENTMOVE) {
185
        details += ", movement: silent";
186
      } else if (meta.silentMovements[1] == KeyStates.CHANGED) {
187
        details += ", movement: changed";
188
      }
189
190
      boolean changedLookToEntity = false;
191
      if (attackData.lastAttackedEntity() != null && attackData.lastAttackedEntity().positionHistory.size() > 2) {
192
        Entity entity = attackData.lastAttackedEntity();
193
194
        Tick tick = meta.movementAtTick[1];
195
        Entity.EntityPositionContext lastEntityPosition = entity.lastPosition;
196
197
        if (lastEntityPosition != null && tick != null) {
198
          BoundingBox lastBoundingBox = Entity.entityBoundingBoxFrom(lastEntityPosition, entity);
199
          Raytrace last = Raytracing.entityRaytrace(
200
            player,
201
            lastBoundingBox,
202
            0,
203
            tick.posX, tick.posY, tick.posZ,
204
            tick.yaw, tick.pitch,
205
            0.1f,
206
            EntityRaytraceBlockConstraint.IGNORE_BLOCKS
207
          );
208
209
          Raytrace raytrace = Raytracing.entityRaytrace(
210
            player,
211
            entity.boundingBox(),
212
            0,
213
            movementData.lastPositionX, movementData.lastPositionY, movementData.lastPositionZ,
214
            movementData.lastRotationYaw, movementData.lastRotationPitch,
215
            0.1f,
216
            EntityRaytraceBlockConstraint.IGNORE_BLOCKS
217
          );
218
219
          changedLookToEntity = (last.reach() != 10) != (raytrace.reach() != 10);
220
          if (changedLookToEntity) {
221
            details += ", look changed to entity";
222
          }
223
        }
224
      }
225
226
      double vl = calculateViolation(valueOfSnap, changedLookToEntity, user, liteFlag);
227
      liteFlag = false;
228
229
      handleConfidence(user, (int) vl, "rotation snapped suspiciously", details);
230
    }
231
232
    if (liteFlag) {
233
      String details = "yaw: " + MathHelper.formatDouble(meta.yawMotions[0], 2);
234
      int addedViolationLevel = 30;
235
      handleConfidence(user, addedViolationLevel, "rotation snapped suspiciously while scaffolding", details);
236
    }
237
238
    prepareNextTick(meta, yawMotion, user);
239
  }
240
241
  private void handleConfidence(User user, int violationToAdd, String message, String details) {
242
    RotationSnapHeuristicMeta meta = metaOf(user);
243
244
    meta.internalViolation += violationToAdd;
245
246
    if (meta.internalViolation >= 30) {
247
      meta.internalViolation -= 30;
248
249
      if (user.protocolVersion() > 47) {
250
        details += ", protocol: " + user.protocolVersion();
251
      }
252
253
      flag(user, message, details);
254
    } else if (meta.internalViolation > 5) {
255
      // flag(user, message, details + ", debug");
256
    }
257
  }
258
259
  private double calculateViolation(double valueOfSnap, boolean changedLookToEntity, User user, boolean liteFlag) {
260
    RotationSnapHeuristicMeta meta = metaOf(user);
261
    double vl = 7;
262
    if (valueOfSnap > 360) {
263
      vl = 120;
264
    } else if (valueOfSnap > 178) {
265
      vl = 50;
266
    } else if (valueOfSnap > 90) {
267
      vl = 20;
268
    } else if (valueOfSnap > 50) {
269
      vl = 10;
270
    }
271
    if (wasRecent(meta.lastBlockPlace.get())) {
272
      vl *= 1.5;
273
    }
274
    if (changedLookToEntity) {
275
      vl *= 2;
276
    }
277
    if (meta.silentMovements[1] == KeyStates.SILENTMOVE) {
278
      vl *= 3;
279
    } else if (meta.silentMovements[1] == KeyStates.CHANGED) {
280
      vl *= 1.7;
281
    }
282
    if (liteFlag) {
283
      vl += 10;
284
    }
285
    // added the division because there are false flaggs when a player has less than 20 fps
286
    vl /= 3;
287
    if (vl > 160 && valueOfSnap < 360) {
288
      vl = 160;
289
    }
290
    return vl;
291
  }
292
293
  private boolean wasRecent(long milliseconds) {
294
    return System.currentTimeMillis() - milliseconds < VL_BOOST_MODIFIER_TIME;
295
  }
296
297
  private void prepareNextTick(RotationSnapHeuristicMeta meta, double yawMotion, User user) {
298
    MovementMetadata movementData = user.meta().movement();
299
    meta.lastKeyForward = movementData.keyForward;
300
    meta.lastKeyStrafe = movementData.keyStrafe;
301
302
    meta.lastLastPosX = movementData.lastPositionX;
303
    meta.lastLastPosY = movementData.lastPositionY;
304
    meta.lastLastPosZ = movementData.lastPositionZ;
305
306
    meta.yawMotions[1] = meta.yawMotions[0];
307
    meta.yawMotions[0] = yawMotion;
308
309
    meta.silentMovements[1] = meta.silentMovements[0];
310
    meta.silentMovements[0] = KeyStates.NONE;
311
312
    meta.movementAtTick[1] = meta.movementAtTick[0];
313
    meta.movementAtTick[0] = null;
314
  }
315
316
  enum KeyStates {
317
    NONE, CHANGED, SILENTMOVE
318
  }
319
320
  public static final class RotationSnapHeuristicMeta extends CheckCustomMetadata {
321
    //    Map<Integer, Po> entityPositions = new HashMap<>();
322
    private final Tick[] movementAtTick = new Tick[2];
323
    private final double[] yawMotions = new double[2];
324
    private final KeyStates[] silentMovements = new KeyStates[2];
325
    double lastLastPosX, lastLastPosY, lastLastPosZ;
326
    private float internalViolation;
327
    private int lastKeyForward;
328
    private int lastKeyStrafe;
329
    // used to disable the check on startup
330
    private int rotationPacketCounter;
331
    private long lastSwing;
332
    private long lastAttack;
333
334
    // AtomicLong is being used because it gets set in a Bukkit thread.
335
    private AtomicLong lastBlockPlace = new AtomicLong();
336
  }
337
338
  static class Tick {
339
    double posX, posY, posZ;
340
    float yaw, pitch;
341
342
    public Tick(double posX, double posY, double posZ, float yaw, float pitch) {
343
      this.posX = posX;
344
      this.posY = posY;
345
      this.posZ = posZ;
346
347
      this.yaw = yaw;
348
      this.pitch = pitch;
349
    }
350
  }
351
}

How it counteracts this module

intave's RotationSnapHeuristic looks for the shape prev delta below 9, then a jump above 40, then current delta back below 9, gated on a swing or attack within 150ms, more than 10 rotation packets and more than 7 ticks since the last teleport. The module's spin resume after an honest window has the first two elements, prev small and a jump of at least 45, but the spin continues at 45 to roughly 1045 degrees per tick, so the current delta never drops below 9 and the third gate never completes.

This is the honest miss of the set: a uniform continuous spin fails the snap signature by construction, which is why the module's random walk is still visible to the frozen-axis and exact-grid Photon checks but invisible to intave's snap detector. The entry documents the division: intave catches one-tick snaps into stillness, and this module never snaps into stillness.

← Back to Analysis Hub