LiquidSense Dev Sprint module 2 files, 389 lines

LiquidSense Dev Sprint: Full Source Analysis

Sprint is a keep-sprint module written in Java inside the otherwise Kotlin client.

net/ccbluex/liquidbounce/features/module/modules/movement/Sprint.java · GitHub source ↗

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

Packets This Module Uses

Analysis

Overview

Sprint is a keep-sprint module written in Java inside the otherwise Kotlin client. One UpdateEvent handler decides the sprint flag every tick: the release branch calls setSprinting(false) when the player is stationary, sneaking, blinded, low on food, or (with CheckServerSide) when the real look diverges more than 30 degrees from the rotation target a rotation module is driving; the sprint branch calls setSprinting(true) when AllDirections is on or the forward input is at least 0.8, with one interlock: if Criticals is enabled in HYTJump mode the module stays silent, because Criticals.onUpdate force-clears the sprint flag every tick so the HYTJump launch never becomes a sprint jump. The module never constructs a packet; the C0B traffic comes from the vanilla tick machinery that mirrors the sprint flag to the server.

Flag decision chain

The release branch fires on any of: MovementUtils.isMoving false, the player sneaking, blindness active while the Blindness toggle is on, food at or below 6 without allowFlying while the Food toggle is on, or the CheckServerSide condition. The sprint branch then gates on allDirectionsValue or mc.thePlayer.movementInput.moveForward >= 0.8F, and adds the Criticals interlock: LiquidBounce.moduleManager.getModule(Criticals.class) with getState() true and mode HYTJump suppresses the sprint write entirely, because Criticals.onUpdate sets isSprinting = false every tick in HYTJump and NGJump modes to keep the launch from converting into a sprint jump.

Wire presence through the vanilla flag diff

setSprinting is a local flag write; the C0B is produced by the tick machinery that compares the flag against the last server-sprint state and emits one START_SPRINTING or STOP_SPRINTING per transition. The LiquidSense Dev snapshot ships no net/minecraft tree, so the fork's EntityPlayerSP cannot be read; the stock 1.8 contract is a per-tick diff that sends at most one C0B per flag change, meaning repeated setSprinting(true) calls with no state change emit nothing. AllDirections backward and sideways sprint only works if the fork honors multi-direction sprint server-side, which is unverifiable in this snapshot, so the honest statement is that the module asks for sprint in every direction and the server decides.

CheckServerSide rotation gate

With CheckServerSide on, the module unsprints whenever RotationUtils.targetRotation is set and RotationUtils.getRotationDifference(current yaw and pitch) exceeds 30 degrees, and CheckServerSideOnlyGround narrows that test to grounded ticks. This is the anti-interference switch: while Aura or another rotation module swings the view away from the movement direction, Sprint refuses to claim sprint, because a sprinting player whose motion disagrees with the reported look is a recognizable signature. The food gate mirrors vanilla's own starvation unsprint, so the module's defaults keep it inside the legitimate sprint envelope.

source Sprint.java

Sprint.java45 lines · JavaOriginal ↗
1
/*
2
 * LiquidBounce Hacked Client
3
 * A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
4
 * https://github.com/CCBlueX/LiquidBounce/
5
 */
6
package net.ccbluex.liquidbounce.features.module.modules.movement;
7
8
import net.ccbluex.liquidbounce.LiquidBounce;
9
import net.ccbluex.liquidbounce.event.EventTarget;
10
import net.ccbluex.liquidbounce.event.UpdateEvent;
11
import net.ccbluex.liquidbounce.features.module.Module;
12
import net.ccbluex.liquidbounce.features.module.ModuleCategory;
13
import net.ccbluex.liquidbounce.features.module.ModuleInfo;
14
import net.ccbluex.liquidbounce.features.module.modules.combat.Criticals;
15
import net.ccbluex.liquidbounce.utils.MovementUtils;
16
import net.ccbluex.liquidbounce.utils.Rotation;
17
import net.ccbluex.liquidbounce.utils.RotationUtils;
18
import net.ccbluex.liquidbounce.value.BoolValue;
19
import net.minecraft.potion.Potion;
20
21
@ModuleInfo(name = "Sprint", description = "Automatically sprints all the time.", category = ModuleCategory.MOVEMENT)
22
public class Sprint extends Module {
23
24
    public final BoolValue allDirectionsValue = new BoolValue("AllDirections", true);
25
    public final BoolValue blindnessValue = new BoolValue("Blindness", true);
26
    public final BoolValue foodValue = new BoolValue("Food", true);
27
28
    public final BoolValue checkServerSide = new BoolValue("CheckServerSide", false);
29
    public final BoolValue checkServerSideGround = new BoolValue("CheckServerSideOnlyGround", false);
30
31
    @EventTarget
32
    public void onUpdate(final UpdateEvent event) {
33
        if(!MovementUtils.isMoving() || mc.thePlayer.isSneaking() || (blindnessValue.get() && mc.thePlayer.isPotionActive(Potion.blindness))|| (foodValue.get() && !(mc.thePlayer.getFoodStats().getFoodLevel() > 6.0F || mc.thePlayer.capabilities.allowFlying)) || (checkServerSide.get() && (mc.thePlayer.onGround || !checkServerSideGround.get()) && !allDirectionsValue.get() && RotationUtils.targetRotation != null && RotationUtils.getRotationDifference(new Rotation(mc.thePlayer.rotationYaw, mc.thePlayer.rotationPitch)) > 30)) {
34
            mc.thePlayer.setSprinting(false);
35
            return;
36
        }
37
38
        if(allDirectionsValue.get() || mc.thePlayer.movementInput.moveForward >= 0.8F){
39
            Criticals criticals = (Criticals) LiquidBounce.moduleManager.getModule(Criticals.class);
40
            if(!criticals.getState() || !criticals.getModeValue().get().equals("HYTJump")){
41
                mc.thePlayer.setSprinting(true);
42
            }
43
        }
44
    }
45
}

What this file does

The entire module: the release-branch conditions, the sprint-branch write, the Criticals HYTJump interlock, and the CheckServerSide rotation-difference test. It touches only the sprint flag; every C0B on the wire is the vanilla flag-diff machinery's output, which the prose explains because the fork's EntityPlayerSP is absent from this snapshot.

source MovementUtils.java (movement gate)

MovementUtils.java344 lines · JavaOriginal ↗
1
/*
2
 * LiquidBounce Hacked Client
3
 * A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
4
 * https://github.com/CCBlueX/LiquidBounce/
5
 */
6
package net.ccbluex.liquidbounce.utils;
7
8
import net.ccbluex.liquidbounce.event.MoveEvent;
9
import net.minecraft.block.Block;
10
import net.minecraft.block.BlockAir;
11
import net.minecraft.block.BlockLiquid;
12
import net.minecraft.block.material.Material;
13
import net.minecraft.client.Minecraft;
14
import net.minecraft.client.entity.EntityPlayerSP;
15
import net.minecraft.client.multiplayer.WorldClient;
16
import net.minecraft.entity.Entity;
17
import net.minecraft.potion.Potion;
18
import net.minecraft.potion.PotionEffect;
19
import net.minecraft.util.AxisAlignedBB;
20
import net.minecraft.util.BlockPos;
21
import net.minecraft.util.MathHelper;
22
23
public final class MovementUtils extends MinecraftInstance {
24
25
    public static float getSpeed() {
26
        return (float) Math.sqrt(mc.thePlayer.motionX * mc.thePlayer.motionX + mc.thePlayer.motionZ * mc.thePlayer.motionZ);
27
    }
28
29
    public static float getMaxFallDist() {
30
        PotionEffect potioneffect = mc.thePlayer.getActivePotionEffect(Potion.jump);
31
        int f2 = potioneffect != null ? potioneffect.getAmplifier() + 1 : 0;
32
        return mc.thePlayer.getMaxFallHeight() + f2;
33
        //  int f = potioneffect != null ? potioneffect.getAmplifier() + 1 : 0;
34
        //return mc.thePlayer.getMaxFallHeight() + f;
35
    }
36
37
    public static int LongJumpEffect() {
38
        if (mc.thePlayer.isPotionActive(Potion.jump))
39
            return mc.thePlayer.getActivePotionEffect(Potion.jump).getAmplifier() + 1;
40
        else
41
            return 0;
42
    }
43
44
    public static double LongJumpMoveSpeed() {
45
        double baseSpeed = 0.2873;
46
        if (mc.thePlayer.isPotionActive(Potion.moveSpeed)) {
47
            int amplifier = mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier();
48
            baseSpeed *= 1.0 + 0.2 * (amplifier + 1);
49
        }
50
        return baseSpeed;
51
    }
52
53
    public static void setMoveSpeed(final MoveEvent event, final double speed) {
54
        double forward = mc.thePlayer.moveForward;
55
        double strafe = mc.thePlayer.moveStrafing;
56
        float yaw = mc.thePlayer.rotationYaw;
57
        if (forward == 0.0 && strafe == 0.0) {
58
            event.setX(0.0);
59
            event.setZ(0.0);
60
        } else {
61
            if (forward != 0.0) {
62
                if (strafe > 0.0) {
63
                    yaw += ((forward > 0.0) ? -45 : 45);
64
                } else if (strafe < 0.0) {
65
                    yaw += ((forward > 0.0) ? 45 : -45);
66
                }
67
                strafe = 0.0;
68
                if (forward > 0.0) {
69
                    forward = 1.0;
70
                } else if (forward < 0.0) {
71
                    forward = -1.0;
72
                }
73
            }
74
            event.setX(forward * speed * Math.cos(Math.toRadians(yaw + 90.0f))
75
                    + strafe * speed * Math.sin(Math.toRadians(yaw + 90.0f)));
76
            event.setZ(forward * speed * Math.sin(Math.toRadians(yaw + 90.0f))
77
                    - strafe * speed * Math.cos(Math.toRadians(yaw + 90.0f)));
78
        }
79
    }
80
81
    public static void setSpeed(final MoveEvent moveEvent, final double moveSpeed) {
82
        setSpeed(moveEvent, moveSpeed, mc.thePlayer.rotationYaw, mc.thePlayer.movementInput.moveStrafe, mc.thePlayer.movementInput.moveForward);
83
    }
84
    public static boolean isBlockUnder() {
85
        EntityPlayerSP player = mc.thePlayer;
86
        WorldClient world = mc.theWorld;
87
        AxisAlignedBB pBb = player.getEntityBoundingBox();
88
        double height = player.posY + (double) player.getEyeHeight();
89
        int offset = 0;
90
        while ((double) offset < height) {
91
            if (!world.getCollidingBoundingBoxes(player, pBb.offset(0.0, -offset, 0.0)).isEmpty()) {
92
                return true;
93
            }
94
            offset += 2;
95
        }
96
        return false;
97
    }
98
    public static void setSpeed(final MoveEvent moveEvent, final double moveSpeed, final float pseudoYaw, final double pseudoStrafe, final double pseudoForward) {
99
        double forward = pseudoForward;
100
        double strafe = pseudoStrafe;
101
        float yaw = pseudoYaw;
102
        if (forward != 0.0) {
103
            if (strafe > 0.0) {
104
                yaw += ((forward > 0.0) ? -45 : 45);
105
            }
106
            else if (strafe < 0.0) {
107
                yaw += ((forward > 0.0) ? 45 : -45);
108
            }
109
            strafe = 0.0;
110
            if (forward > 0.0) {
111
                forward = 1.0;
112
            }
113
            else if (forward < 0.0) {
114
                forward = -1.0;
115
            }
116
        }
117
        if (strafe > 0.0) {
118
            strafe = 1.0;
119
        }
120
        else if (strafe < 0.0) {
121
            strafe = -1.0;
122
        }
123
        final double mx = Math.cos(Math.toRadians(yaw + 90.0f));
124
        final double mz = Math.sin(Math.toRadians(yaw + 90.0f));
125
        moveEvent.setX(forward * moveSpeed * mx + strafe * moveSpeed * mz);
126
        moveEvent.setZ(forward * moveSpeed * mz - strafe * moveSpeed * mx);
127
    }
128
129
    public static float getDistanceToGround(Entity e) {
130
        if (mc.thePlayer.isCollidedVertically && mc.thePlayer.onGround) {
131
            return 0.0F;
132
        }
133
        for (float a = (float) e.posY; a > 0.0F; a -= 1.0F) {
134
            int[] stairs = { 53, 67, 108, 109, 114, 128, 134, 135, 136, 156, 163, 164, 180 };
135
            int[] exemptIds = { 6, 27, 28, 30, 31, 32, 37, 38, 39, 40, 50, 51, 55, 59, 63, 65, 66, 68, 69, 70, 72, 75,
136
                    76, 77, 83, 92, 93, 94, 104, 105, 106, 115, 119, 131, 132, 143, 147, 148, 149, 150, 157, 171, 175,
137
                    176, 177 };
138
            Block block = mc.theWorld.getBlockState(new BlockPos(e.posX, a - 1.0F, e.posZ)).getBlock();
139
            if (!(block instanceof BlockAir)) {
140
                if ((Block.getIdFromBlock(block) == 44) || (Block.getIdFromBlock(block) == 126)) {
141
                    return (float) (e.posY - a - 0.5D) < 0.0F ? 0.0F : (float) (e.posY - a - 0.5D);
142
                }
143
                int[] arrayOfInt1;
144
                int j = (arrayOfInt1 = stairs).length;
145
                for (int i = 0; i < j; i++) {
146
                    int id = arrayOfInt1[i];
147
                    if (Block.getIdFromBlock(block) == id) {
148
                        return (float) (e.posY - a - 1.0D) < 0.0F ? 0.0F : (float) (e.posY - a - 1.0D);
149
                    }
150
                }
151
                j = (arrayOfInt1 = exemptIds).length;
152
                for (int i = 0; i < j; i++) {
153
                    int id = arrayOfInt1[i];
154
                    if (Block.getIdFromBlock(block) == id) {
155
                        return (float) (e.posY - a) < 0.0F ? 0.0F : (float) (e.posY - a);
156
                    }
157
                }
158
                return (float) (e.posY - a + block.getBlockBoundsMaxY() - 1.0D);
159
            }
160
        }
161
        return 0.0F;
162
    }
163
164
    public static double getBaseMoveSpeed() {
165
        double baseSpeed = 0.2873;
166
        if (mc.thePlayer.isPotionActive(Potion.moveSpeed))
167
            baseSpeed *= 1.0 + 0.2 * (mc.thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier() + 1);
168
        return baseSpeed;
169
    }
170
171
    public static int getSpeedEffect() {
172
        return Minecraft.getMinecraft().thePlayer.isPotionActive(Potion.moveSpeed)?Minecraft.getMinecraft().thePlayer.getActivePotionEffect(Potion.moveSpeed).getAmplifier() + 1:0;
173
    }
174
175
    public static int getJumpEffect() {
176
        return Minecraft.getMinecraft().thePlayer.isPotionActive(Potion.jump)?Minecraft.getMinecraft().thePlayer.getActivePotionEffect(Potion.jump).getAmplifier() + 1:0;
177
    }
178
179
180
    public static boolean isInLiquid() {
181
        if(Minecraft.getMinecraft().thePlayer.isInWater()) {
182
            return true;
183
        } else {
184
            boolean inLiquid = false;
185
            int y = (int)Minecraft.getMinecraft().thePlayer.getEntityBoundingBox().minY;
186
187
            for(int x = MathHelper.floor_double(Minecraft.getMinecraft().thePlayer.getEntityBoundingBox().minX); x < MathHelper.floor_double(Minecraft.getMinecraft().thePlayer.getEntityBoundingBox().maxX) + 1; ++x) {
188
                for(int z = MathHelper.floor_double(Minecraft.getMinecraft().thePlayer.getEntityBoundingBox().minZ); z < MathHelper.floor_double(Minecraft.getMinecraft().thePlayer.getEntityBoundingBox().maxZ) + 1; ++z) {
189
                    Block block = Minecraft.getMinecraft().theWorld.getBlockState(new BlockPos(x, y, z)).getBlock();
190
                    if(block != null && block.getMaterial() != Material.air) {
191
                        if(!(block instanceof BlockLiquid)) {
192
                            return false;
193
                        }
194
195
                        inLiquid = true;
196
                    }
197
                }
198
            }
199
200
            return inLiquid;
201
        }
202
    }
203
204
    public static void SpeedSetMotion(double speed) {
205
        double forward = mc.thePlayer.movementInput.moveForward;
206
        double strafe = mc.thePlayer.movementInput.moveStrafe;
207
        float yaw = mc.thePlayer.rotationYaw;
208
        if ((forward == 0.0D) && (strafe == 0.0D)) {
209
            mc.thePlayer.motionX = 0;
210
            mc.thePlayer.motionZ = 0;
211
        } else {
212
            if (forward != 0.0D) {
213
                if (strafe > 0.0D) {
214
                    yaw += (forward > 0.0D ? -45 : 45);
215
                } else if (strafe < 0.0D) {
216
                    yaw += (forward > 0.0D ? 45 : -45);
217
                }
218
                strafe = 0.0D;
219
                if (forward > 0.0D) {
220
                    forward = 1;
221
                } else if (forward < 0.0D) {
222
                    forward = -1;
223
                }
224
            }
225
            mc.thePlayer.motionX = forward * speed * Math.cos(Math.toRadians(yaw + 90.0F)) + strafe * speed * Math.sin(Math.toRadians(yaw + 90.0F));
226
            mc.thePlayer.motionZ = forward * speed * Math.sin(Math.toRadians(yaw + 90.0F)) - strafe * speed * Math.cos(Math.toRadians(yaw + 90.0F));
227
        }
228
    }
229
230
    public static void setMotion(MoveEvent event, double speed, double motion) {
231
        double forward = mc.thePlayer.movementInput.moveForward;
232
        double strafe = mc.thePlayer.movementInput.moveStrafe;
233
        double yaw = mc.thePlayer.rotationYaw;
234
        if ((forward == 0.0) && (strafe == 0.0)) {
235
            event.setX(0.0);
236
            event.setZ(0.0);
237
        } else {
238
            if (forward != 0.0) {
239
                if (strafe > 0.0) {
240
                    yaw += (forward > 0.0 ? -45 : 45);
241
                } else if (strafe < 0.0) {
242
                    yaw += (forward > 0.0 ? 45 : -45);
243
                }
244
                strafe = 0.0;
245
                if (forward > 0.0) {
246
                    forward = 1.0;
247
                } else if (forward < 0.0) {
248
                    forward = -1.0;
249
                }
250
            }
251
            double cos = Math.cos(Math.toRadians(yaw + 90.0f));
252
            double sin = Math.sin(Math.toRadians(yaw + 90.0f));
253
            event.setX(( forward * speed * cos + strafe * speed * sin) * motion);
254
            event.setZ(( forward * speed * sin - strafe * speed * cos) * motion);
255
        }
256
    }
257
258
    public static double getJumpBoostModifier(double baseJumpHeight, boolean potionJumpHeight) {
259
        if (mc.thePlayer.isPotionActive(Potion.jump) && potionJumpHeight) {
260
            int amplifier = mc.thePlayer.getActivePotionEffect(Potion.jump).getAmplifier();
261
            baseJumpHeight += ((float)(amplifier + 1) * 0.1f);
262
263
        }
264
        return baseJumpHeight;
265
    }
266
267
    public static void setMotion(MoveEvent e, double speed) {
268
        double forward = mc.thePlayer.movementInput.moveForward;
269
        double strafe = mc.thePlayer.movementInput.moveStrafe;
270
        double yaw = mc.thePlayer.rotationYaw;
271
        if ((forward == 0.0D) && (strafe == 0.0D)) {
272
            mc.thePlayer.motionX = 0;
273
            mc.thePlayer.motionZ = 0;
274
        } else {
275
            if (forward != 0.0D) {
276
                if (strafe > 0.0D) {
277
                    yaw += (forward > 0.0D ? -45 : 45);
278
                } else if (strafe < 0.0D) {
279
                    yaw += (forward > 0.0D ? 45 : -45);
280
                }
281
                strafe = 0.0D;
282
                if (forward > 0.0D) {
283
                    forward = 1;
284
                } else if (forward < 0.0D) {
285
                    forward = -1;
286
                }
287
            }
288
            e.setX( forward * speed * Math.cos(Math.toRadians(yaw + 90.0F)) + strafe * speed * Math.sin(Math.toRadians(yaw + 90.0F)));
289
            e.setZ( forward * speed * Math.sin(Math.toRadians(yaw + 90.0F)) - strafe * speed * Math.cos(Math.toRadians(yaw + 90.0F)));
290
        }
291
    }
292
    public static void strafe() {
293
        strafe(getSpeed());
294
    }
295
    public static boolean isOnGround(double height) {
296
        if (!mc.theWorld.getCollidingBoundingBoxes(mc.thePlayer, mc.thePlayer.getEntityBoundingBox().offset(0.0D, -height, 0.0D)).isEmpty()) {
297
            return true;
298
        } else {
299
            return false;
300
        }
301
    }
302
    public static boolean isMoving() {
303
        return mc.thePlayer != null && (mc.thePlayer.movementInput.moveForward != 0F || mc.thePlayer.movementInput.moveStrafe != 0F);
304
    }
305
306
    public static boolean hasMotion() {
307
        return mc.thePlayer.motionX != 0D && mc.thePlayer.motionZ != 0D && mc.thePlayer.motionY != 0D;
308
    }
309
310
    public static void strafe(final float speed) {
311
        if(!isMoving())
312
            return;
313
314
        final double yaw = getDirection();
315
        mc.thePlayer.motionX = -Math.sin(yaw) * speed;
316
        mc.thePlayer.motionZ = Math.cos(yaw) * speed;
317
    }
318
319
    public static void forward(final double length) {
320
        final double yaw = Math.toRadians(mc.thePlayer.rotationYaw);
321
        mc.thePlayer.setPosition(mc.thePlayer.posX + (-Math.sin(yaw) * length), mc.thePlayer.posY, mc.thePlayer.posZ + (Math.cos(yaw) * length));
322
    }
323
324
    public static double getDirection() {
325
        float rotationYaw = mc.thePlayer.rotationYaw;
326
327
        if(mc.thePlayer.moveForward < 0F)
328
            rotationYaw += 180F;
329
330
        float forward = 1F;
331
        if(mc.thePlayer.moveForward < 0F)
332
            forward = -0.5F;
333
        else if(mc.thePlayer.moveForward > 0F)
334
            forward = 0.5F;
335
336
        if(mc.thePlayer.moveStrafing > 0F)
337
            rotationYaw -= 90F * forward;
338
339
        if(mc.thePlayer.moveStrafing < 0F)
340
            rotationYaw += 90F * forward;
341
342
        return Math.toRadians(rotationYaw);
343
    }
344
}

What this file does

isMoving is the primary gate every tick: it reads the movement input state and returns false when no direction key is held, which drives the first release-branch condition. It is the movement-domain utility the module leans on, and the same util family powers the Speed and Strafe modules the client pairs with Sprint.

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 ToggleFrequency (C0B rate window)

ToggleFrequency.java61 lines · Java
1
/*
2
 * This program is free software: you can redistribute it and/or modify
3
 *   it under the terms of the GNU General Public License as published by
4
 *   the Free Software Foundation, either version 3 of the License, or
5
 *   (at your option) any later version.
6
 *
7
 *   This program is distributed in the hope that it will be useful,
8
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10
 *   GNU General Public License for more details.
11
 *
12
 *   You should have received a copy of the GNU General Public License
13
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
14
 */
15
package fr.neatmonster.nocheatplus.checks.net;
16
17
import org.bukkit.entity.Player;
18
19
import fr.neatmonster.nocheatplus.checks.Check;
20
import fr.neatmonster.nocheatplus.checks.CheckType;
21
import fr.neatmonster.nocheatplus.players.IPlayerData;
22
import fr.neatmonster.nocheatplus.utilities.TickTask;
23
24
/**
25
 * The ToggleFrequency check is used to detect players who toggle certain actions too quickly (i.e.: sneaking).
26
 */
27
public class ToggleFrequency extends Check {
28
29
    /**
30
     * Instantiates a new toggle frequency check.
31
     */
32
    public ToggleFrequency() {
33
        super(CheckType.NET_TOGGLEFREQUENCY);
34
    }
35
36
    /**
37
     * Checks a player.
38
     * 
39
     * @param player
40
     *            the player
41
     * @param data
42
     * @param cc
43
     * @param pData
44
     * @return true, if successful
45
     */
46
    public boolean check(final Player player, final NetData data, final NetConfig cc, final IPlayerData pData) {
47
        boolean cancel = false;
48
        // (Addition to frequency is done in the listener for each toggle event)
49
        // Full time resolution
50
        final long actionFullTime = data.playerActionFreq.bucketDuration() * data.playerActionFreq.numberOfBuckets();
51
        /** Toggle action events counted */
52
        final float fullActionScore = data.playerActionFreq.score(1f) / TickTask.getLag(actionFullTime);
53
        final double violation = fullActionScore > cc.toggleActionLimit ? fullActionScore - cc.toggleActionLimit : 0.0;
54
        if (violation > 0.0) {
55
            data.toggleFrequencyVL += violation;
56
            cancel = executeActions(player, data.toggleFrequencyVL, violation, cc.toggleFrequencyActions).willCancel();
57
        }
58
        else data.toggleFrequencyVL *= 0.9;
59
        return cancel;
60
    }
61
}

How it counteracts this module

The EntityActionAdapter scores every C0B into NetData.playerActionFreq, and ToggleFrequency compares the window against cc.toggleActionLimit, default 25 actions per second, cancelling at vl > 10. The module emits one START per enable and one STOP per gate trip, a handful of C0Bs per second, so it passes by design; this is the wtap counter and auto-sprint volume is not its target. The honest baseline: sprint spam that stays under a few toggles per second is structurally invisible to the rate window.

anticheat SprintA (hunger gate)

SprintA.java35 lines · Java
1
package ac.grim.grimac.checks.impl.sprint;
2
3
import ac.grim.grimac.api.storage.verbose.Verbose;
4
import ac.grim.grimac.checks.Check;
5
import ac.grim.grimac.checks.CheckData;
6
import ac.grim.grimac.checks.type.PostPredictionListener;
7
import ac.grim.grimac.player.GrimPlayer;
8
import ac.grim.grimac.utils.anticheat.update.PredictionComplete;
9
import com.github.retrooper.packetevents.protocol.entity.type.EntityTypes;
10
11
@CheckData(name = "SprintA", stableKey = "grim.sprint.hunger", description = "Sprinting with too low hunger", setback = 0)
12
public class SprintA extends Check implements PostPredictionListener {
13
    private static final Verbose V = Verbose.of("hunger={uint}");
14
15
    public SprintA(GrimPlayer player) {
16
        super(player);
17
    }
18
19
    @Override
20
    public void onPredictionComplete(PredictionComplete predictionComplete) {
21
        if (!predictionComplete.isChecked()) return;
22
23
        // Players can sprint if they're able to fly
24
        // Players can also sprint if they are on a camel, regardless of their hunger level
25
        if (player.canFly || EntityTypes.isTypeInstanceOf(player.getVehicleType(), EntityTypes.CAMEL)) return;
26
27
        if (player.food <= 6.0F) {
28
            if (player.isSprinting) {
29
                flagWithSetback(V.write(verbose()).uint(player.food));
30
            } else {
31
                reward();
32
            }
33
        }
34
    }
35
}

How it counteracts this module

Grim flags with a setback when player.food is at or below 6.0 while the server sprint state is true, with flying players and camels exempt. The module's own food gate requires foodLevel > 6 or allowFlying before it sprints, so the player never presents a starving sprint to the check: the module and the check share the same threshold, which makes the check a designed non-event here rather than a counter.

anticheat ActionToggleSpeed (same-tick toggle burst)

ActionToggleSpeed.java80 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;
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.PlayerActionEvent;
25
import org.bukkit.entity.Player;
26
27
import java.util.HashMap;
28
import java.util.Map;
29
import java.util.UUID;
30
31
/**
32
 * This check limits clients' sprint and sneak toggle rates to
33
 * prevent exploitation of the speed check and combat mechanics.
34
 */
35
public class ActionToggleSpeed extends CustomCheck {
36
37
    private Map<UUID, Long> lastSneakToggle;
38
    private Map<UUID, Long> lastSprintToggle;
39
40
    public ActionToggleSpeed() {
41
        super("actiontogglespeed", "%player% failed action toggle speed, VL: %vl%");
42
        lastSneakToggle = new HashMap<>();
43
        lastSprintToggle = new HashMap<>();
44
    }
45
46
    @Override
47
    protected void check(Event e) {
48
        if(!(e instanceof PlayerActionEvent))
49
            return;
50
        PlayerActionEvent aE = (PlayerActionEvent)e;
51
        PlayerActionEvent.PlayerAction action = aE.getAction();
52
        HawkPlayer pp = e.getHawkPlayer();
53
        UUID uuid = e.getPlayer().getUniqueId();
54
        if(action == PlayerActionEvent.PlayerAction.SNEAK_START || action == PlayerActionEvent.PlayerAction.SNEAK_STOP) {
55
56
            if(pp.getCurrentTick() - lastSneakToggle.getOrDefault(uuid, 0L) < 1) {
57
                punish(pp, canCancel(), e);
58
            } else {
59
                reward(pp);
60
            }
61
62
            lastSneakToggle.put(uuid, pp.getCurrentTick());
63
        } else if(action == PlayerActionEvent.PlayerAction.SPRINT_START || action == PlayerActionEvent.PlayerAction.SPRINT_STOP) {
64
65
            if(pp.getCurrentTick() - lastSprintToggle.getOrDefault(uuid, 0L) < 1) {
66
                punish(pp, canCancel(), e);
67
            } else {
68
                reward(pp);
69
            }
70
71
            lastSprintToggle.put(uuid, pp.getCurrentTick());
72
        }
73
    }
74
75
    public void removeData(Player p) {
76
        UUID uuid = p.getUniqueId();
77
        lastSneakToggle.remove(uuid);
78
        lastSprintToggle.remove(uuid);
79
    }
80
}

How it counteracts this module

Hawk punishes a sprint toggle whose gap since the previous toggle is under one tick. The vanilla flag diff emits at most one C0B per tick, so the module's STOP and the following START land exactly one tick apart and pass at default; only a same-tick double toggle, the wtap pattern this module does not produce, trips it. The boundary is exact: single per-tick transitions are the check's reward path.

anticheat EntityAction wrapper (no C0B consumer)

WrapperPlayClientEntityAction.java114 lines · Java
1
/**
2
 * This file is part of PacketWrapper.
3
 * Copyright (C) 2012-2015 Kristian S. Strangeland
4
 * Copyright (C) 2015 dmulloy2
5
 *
6
 * PacketWrapper is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU Lesser General Public License as published by
8
 * the Free Software Foundation, either version 3 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * PacketWrapper is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU Lesser General Public License
17
 * along with PacketWrapper.  If not, see <http://www.gnu.org/licenses/>.
18
 */
19
package com.comphenix.packetwrapper;
20
21
import org.bukkit.World;
22
import org.bukkit.entity.Entity;
23
24
import com.comphenix.protocol.PacketType;
25
import com.comphenix.protocol.events.PacketContainer;
26
import com.comphenix.protocol.events.PacketEvent;
27
import com.comphenix.protocol.wrappers.EnumWrappers.PlayerAction;
28
29
public class WrapperPlayClientEntityAction extends AbstractPacket {
30
    public static final PacketType TYPE = PacketType.Play.Client.ENTITY_ACTION;
31
    
32
    public WrapperPlayClientEntityAction() {
33
        super(new PacketContainer(TYPE), TYPE);
34
        handle.getModifier().writeDefaults();
35
    }
36
    
37
    public WrapperPlayClientEntityAction(PacketContainer packet) {
38
        super(packet, TYPE);
39
    }
40
    
41
    /**
42
     * Retrieve Entity ID.
43
     * <p>
44
     * Notes: entity's ID
45
     * @return The current Entity ID
46
     */
47
    public int getEntityID() {
48
        return handle.getIntegers().read(0);
49
    }
50
51
    /**
52
     * Set Entity ID.
53
     * @param value - new value.
54
     */
55
    public void setEntityID(int value) {
56
        handle.getIntegers().write(0, value);
57
    }
58
59
    /**
60
     * Retrieve the entity of the painting that will be spawned.
61
     * @param world - the current world of the entity.
62
     * @return The spawned entity.
63
     */
64
    public Entity getEntity(World world) {
65
        return handle.getEntityModifier(world).read(0);
66
    }
67
68
    /**
69
     * Retrieve the entity of the painting that will be spawned.
70
     * @param event - the packet event.
71
     * @return The spawned entity.
72
     */
73
    public Entity getEntity(PacketEvent event) {
74
        return getEntity(event.getPlayer().getWorld());
75
    }
76
    
77
    /**
78
     * Retrieve Action ID.
79
     * <p>
80
     * Notes: the ID of the action, see below.
81
     * @return The current Action ID
82
     */
83
    public PlayerAction getAction() {
84
        return handle.getPlayerActions().read(0);
85
    }
86
    
87
    /**
88
     * Set Action ID.
89
     * @param value - new value.
90
     */
91
    public void setAction(PlayerAction value) {
92
        handle.getPlayerActions().write(0, value);
93
    }
94
    
95
    /**
96
     * Retrieve Jump Boost.
97
     * <p>
98
     * Notes: horse jump boost. Ranged from 0 -> 100.
99
     * @return The current Jump Boost
100
     */
101
    public int getJumpBoost() {
102
        return handle.getIntegers().read(1);
103
    }
104
    
105
    /**
106
     * Set Jump Boost.
107
     * @param value - new value.
108
     */
109
    public void setJumpBoost(int value) {
110
        handle.getIntegers().write(1, value);
111
    }
112
    
113
}

How it counteracts this module

Arc v2's PacketListener subscribes only FLYING, POSITION, USE_ENTITY, ARM_ANIMATION, HELD_ITEM_SLOT and BLOCK_PLACE, and this C0B wrapper class is never constructed by the anticheat, so the entire sprint surface is invisible to Arc v2. The resolving rel is the wrapper that would carry the packet; the honest statement is that a brief-pinned Arc v2 sprint counter can only be a gap entry.

← Back to Analysis Hub