Rise 5.99 Derp module 2 files, 65 lines

Rise 5.99 Derp: Full Source Analysis

Rise 5.99's Derp is a pre-motion look spoof that overwrites the yaw the C03 stream will carry on every tick.

dev/rise/module/impl/player/Derp.java · GitHub source ↗

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

Packets This Module Uses

Analysis

Overview

Rise 5.99's Derp is a pre-motion look spoof that overwrites the yaw the C03 stream will carry on every tick. In the default mode the pitch is left at the player's real rotationPitch while a module-owned yaw field accumulates a fixed constantSpeed (default 10, configurable 10-180 in 0.1 steps) with no wrapping, and that value is written into event.setYaw, renderYawOffset and rotationYawHead so both the wire look and the visible body spin. Three modifier toggles replace parts of the default: Random draws both axes fresh from uniform distributions every tick, Down pins the pitch around 80 degrees, Headless pins it around 180 (the upside-down look), and Twerk forces the sneak key on alternating ticks, which emits C0B sneak entity-actions instead of touching the look. The spin is a constant-rate frozen-axis rotation, which is exactly the signature the C0A-mined rotation checks (Photon AimStep and PerfectRotation) were built to flag; the Random mode is the only configuration that breaks their step and multiple signatures.

Rotation rewrite

The handler runs on PreMotionEvent, which fires before the C03 variant is built and sent. The default branch keeps pitch as mc.thePlayer.rotationPitch (the player's real pitch, static while idle) and adds constantSpeed.getValue() to the module's static yaw field every tick. The value is never wrapped or normalized: yaw simply accumulates past 360, so the raw look deltas on the wire are a constant +10 degrees per tick (or whatever speed is configured, always a 0.1-step multiple). event.setYaw(yaw) and event.setPitch(pitch) rewrite the look the packet carries, and renderYawOffset plus rotationYawHead are set to the same yaw so the server-visible body and the client-side head both follow the spun value instead of the real mouse input.

Mode matrix

Random overrides both axes every tick with Math.random() draws: pitch in -90..90, yaw in 0..360, so consecutive deltas are large, arbitrary and unrelated. Down pins pitch to 80 plus a small random fraction, producing a fixed near-downward gaze with sub-0.02-degree jitter while yaw keeps the constant spin. Headless pins pitch to 180 plus an even smaller random fraction, the classic upside-down look, again with yaw untouched. Twerk is the odd one out: it does not rotate anything, it calls keyBindSneak.setKeyPressed(ticksExisted % 2 == 0), forcing the sneak key state on alternating ticks, which makes the vanilla client emit C0B sneak entity-action packets every other tick. Because the module writes the static fields directly, the look mutates before the send, and nothing in the module ever swings or attacks, so no C0A originates from Derp itself.

Detection surface

The default spin is a textbook frozen-axis pattern: pitch delta exactly 0 while yaw delta is a constant step above 1 degree, which trips Photon's AimStep every tick, and the 0.1-quantized step is an exact multiple of 0.1 and (for 10, 20, 30) of 0.25, which trips PerfectRotation's multiple detector. The Headless and Down modes do not save it: their pitch jitter is bounded well under 1 degree and AimStep only needs the moving axis above 1, and the yaw delta stays an exact multiple. Random mode is the real bypass: both axes move by large arbitrary amounts, so neither the frozen-axis nor the integer-multiple signature exists. Hawk's AimbotHeuristic and intave's RotationSnapHeuristic miss the module by construction: Rise never wraps yaw, so the -176 to +180 discontinuity AimbotHeuristic keys on never occurs, and the spin's uniform motion triple fails RotationSnap's near-static before/after gates.

source Derp.java

Derp.java50 lines · JavaOriginal ↗
1
/*
2
 Copyright Alan Wood 2021
3
 None of this code to be reused without my written permission
4
 Intellectual Rights owned by Alan Wood
5
 */
6
package dev.rise.module.impl.player;
7
8
import dev.rise.event.impl.motion.PreMotionEvent;
9
import dev.rise.module.Module;
10
import dev.rise.module.api.ModuleInfo;
11
import dev.rise.module.enums.Category;
12
import dev.rise.setting.impl.BooleanSetting;
13
import dev.rise.setting.impl.NumberSetting;
14
15
@ModuleInfo(name = "Derp", description = "Makes you look like a derp", category = Category.PLAYER)
16
public final class Derp extends Module {
17
18
    public static float yaw, pitch;
19
    private final BooleanSetting headless = new BooleanSetting("Headless", this, false);
20
    private final BooleanSetting random = new BooleanSetting("Random", this, false);
21
    private final NumberSetting constantSpeed = new NumberSetting("Constant Speed", this, 10, 10, 180, 0.1);
22
    private final BooleanSetting twerk = new BooleanSetting("Twerk", this, false);
23
    private final BooleanSetting down = new BooleanSetting("Down", this, false);
24
25
    @Override
26
    public void onPreMotion(final PreMotionEvent event) {
27
     // funni
28
        if (random.isEnabled()) {
29
            pitch = (float) (Math.random() * 180 - 90);
30
            yaw = (float) Math.random() * 360;
31
        } else {
32
            pitch = mc.thePlayer.rotationPitch;
33
            yaw += constantSpeed.getValue();
34
        }
35
        if(down.isEnabled()) {
36
            pitch = (float) (80 + Math.random() / 80);
37
        }
38
        if (headless.isEnabled())
39
            pitch = (float) (180 + Math.random() / 100);
40
41
        event.setYaw(yaw);
42
        event.setPitch(pitch);
43
        mc.thePlayer.renderYawOffset = yaw;
44
        mc.thePlayer.rotationYawHead = yaw;
45
46
        if (twerk.isEnabled()) {
47
            mc.gameSettings.keyBindSneak.setKeyPressed(mc.thePlayer.ticksExisted % 2 == 0);
48
        }
49
    }
50
}

What this file does

The module is five settings and one pre-motion handler. The default path at lines 31-34 is the core: pitch keeps the player's real rotationPitch while yaw += constantSpeed.getValue() accumulates without wrap, so the wire look steps by a constant amount every tick. The modifier toggles then override the pitch only: Down (lines 35-37) pins it near 80 with a small random fraction, Headless (lines 38-39) pins it near 180 with a smaller fraction, and Random (lines 28-30) replaces both axes with uniform draws. Lines 41-44 write the results into the event's yaw and pitch plus renderYawOffset and rotationYawHead, which is how the same value reaches both the C03 look stream and the rendered body.\n\nTwerk (lines 46-48) is a separate mechanism: forcing keyBindSneak on alternating ticks makes the vanilla sneak logic emit C0B entity-action packets every other tick, a completely different wire fingerprint from the rotation spoof. The yaw and pitch fields are static, so other Rise modules (and the C03 send path) read the spoofed values; the module never swings or attacks, so it produces no C0A of its own. The unbounded yaw accumulator is the key detection detail: raw deltas are constant and quantized, with no wrap discontinuity.

source PreMotionEvent.java (look carrier)

PreMotionEvent.java15 lines · JavaOriginal ↗
1
package dev.rise.event.impl.motion;
2
3
import dev.rise.event.api.Event;
4
import lombok.AllArgsConstructor;
5
import lombok.Getter;
6
import lombok.Setter;
7
8
@Getter
9
@Setter
10
@AllArgsConstructor
11
public final class PreMotionEvent extends Event {
12
    private float yaw, pitch;
13
    private boolean ground;
14
    private double x, y, z;
15
}

What this file does

PreMotionEvent is the pre-send carrier for the tick's look and position. Its fields yaw, pitch, ground, x, y and z are set from the player state before the event fires, and the C03 send path reads them back afterwards, so any setter call made in a handler rewrites the packet the server receives. The module only touches yaw and pitch; the position and ground fields pass through unchanged.\n\nBecause the event is fired before the C03 variant is constructed, the mutation happens at the last possible moment before serialization, which is why event.setYaw(yaw) is sufficient to spoof the wire look while renderYawOffset and rotationYawHead are set separately for the server-visible body rotation. The class itself is a plain data holder with Lombok getters, setters and an all-args constructor; all of its logic lives in the consumers that fire it.

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 stepping)

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 AimStep listens on PlayerMoveEvent and computes yawDelta via MathUtil.yawDistance (shortest-distance normalization) and pitchDelta as an absolute difference. The step signature is one axis frozen while the other moves more than 1 degree: isAimStep returns true when deltaOne is under 0.00001 and deltaTwo exceeds 1, and the check fires on either axis order, adding 20 VL per flag with a 200ms decay.\n\nThe default Rise spin matches on every tick: pitch delta is exactly 0 (the real rotationPitch is static while idle) and yaw delta is the configured constant step, at minimum 10 degrees. Headless and Down modes do not help: their pitch jitter (a fraction of a degree) stays under AimStep's moving-axis threshold of 1, so the frozen-axis signature survives. Only the Random mode defeats the check, because then both axes move by large unrelated amounts every tick. This is the module's hardest counter: the constant-rate spin is exactly the pattern the check was built to see.

anticheat PacketAnalysisPerfectRotation (integer-multiple 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 PerfectRotation flags rotation deltas that are exact integer multiples of 0.1 or 0.25 degrees, using an epsilon of 1e-10 and a conditionallyIncDec counter so isolated matches decay instead of flagging. Real mouse input almost never produces exact multiples repeatedly, which is why the consistency requirement exists.\n\nRise's constantSpeed setting is stepped at 0.1, so every allowed value is by construction an exact multiple of 0.1 (10/0.1 is 100; 10/0.25 is 40), and the spin produces the same exact delta every tick, so the counter increments every tick regardless of which speed is configured. The Headless and Down modes leave yaw untouched, so they do not disturb the multiples. Random mode breaks the pattern because its per-tick draws produce arbitrary deltas that are only rarely exact multiples. The module's use of a quantized accumulator with no jitter is precisely what feeds this check.

anticheat AimbotHeuristic (wrap discontinuity, missed)

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 samples the last four to five raw yaw and pitch deltas computed as plain subtraction without shortest-distance wrapping, and evaluates them only when a click or world interaction happened within the last two moves. The twitching and zig-zag branch flags when both the current and previous speeds exceed 20 degrees and the angle between the move vectors exceeds 2.86 radians.\n\nThe Rise spin is invisible to it for a structural reason: the module never wraps its yaw, so the wire stream is a constant +10 per tick with an angle of 0 between consecutive deltas, which matches none of the branches. The memeware-style derps that flip -180 to +180 produce the raw +356-degree delta AimbotHeuristic was written to catch, but this implementation's unbounded accumulator removes that discontinuity entirely. Random mode can occasionally trip the twitch branch (large random deltas with large angles) but only while the player is also clicking, and a pure spin with no combat stays under the check's gates. This entry documents the miss rather than a catch: the no-wrap design is a deliberate or lucky evasion of the wrap heuristic.

anticheat RotationSnapHeuristic (snap signature, spin miss)

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 snap heuristic subscribes to ARM_ANIMATION (the C0A packet, which is why the check is mined under the animation corpus), ATTACK_ENTITY and USE_ENTITY, POSITION_LOOK and LOOK, and FLYING. The snap signature is a single-tick yaw jump between two near-static rotations: previousYawMotion under 9 degrees, the jump over 40, and the following motion under 9, gated on a swing or attack within 150ms, more than 10 rotation packets, and more than 7 ticks since a teleport. A second lite path flags silent movement with key-input changes.\n\nThe uniform spin defeats it on both gates. The motion triple is constant (10, 10, 10 at default speed, or any other constant), so the before/after thresholds of under 9 degrees fail even at the value boundaries, and the combat gate is closed anyway: the module never swings or attacks, so recentSwingOrAttack stays false. The lite path needs a change in the strafe or forward keys that the module does not produce. Like Hawk's heuristic, this entry documents the miss: intave's rotation heuristics target one-tick aimbot retargets, and a constant-rate derp spin is outside their intended signature.

← Back to Analysis Hub