Rise 6.2.4 Velocity module 6 files, 441 lines

Rise 6.2.4 Velocity: Full Source Analysis

Rise 6.2.4's Velocity is a mode selector: the module class only declares a ModeValue with twenty Mode instances and an onSwing BooleanValue, and every mode is a separate class in the combat.velocity package.

Client-release2/Client/src/main/java/com/alan/clients/module/impl/combat/Velocity.java · GitHub source ↗

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

Analysis

Overview

Rise 6.2.4's Velocity is a mode selector: the module class only declares a ModeValue with twenty Mode instances and an onSwing BooleanValue, and every mode is a separate class in the combat.velocity package. Standard scales or cancels S12 and S27 with horizontal and vertical percentages plus an explosion-ignore flag; Grim waits for an S19 hurt status before cancelling the following S12 and sending a C07 digging action; Vulcan cancels the knockback and replaces the transaction stream with forged C0F confirmations while hurtTime is 10; Intave and AAC damp the motion directly without touching packets; and the Legit modes (Legit/Jump Reset and Polar) force a jump on the knockback tick at a configurable chance. The mode set maps to named anticheats (Grim, Vulcan, Intave, AAC, Matrix, Karhu, MMC, UniversoCraft, Redesky, Watchdog) plus generic behaviours (Buffer Abuse, Delay, Ground, Tick, Bounce, Grim Reduce, Watchdog Prediction), with Standard as the default.

Architecture

The parent module is a thin composition root. mode is a ModeValue whose add calls instantiate each mode class with its display name and the parent, and setDefault selects Standard. The onSwing value is read by every mode through getParent().onSwing.getValue() and, when true, gates the packet handler on mc.thePlayer.isSwingInProgress, so the module only acts when the client is actually swinging. Each mode is an EventLink-wired class: the event bus scans declared Listener fields annotated with @EventLink and invokes them at the declared priority, and Standard and Grim register at Priorities.VERY_LOW so other modules see the packet first.

The modes share the client's component system: BadPacketsComponent for stream sanity, TargetComponent for nearby-entity checks, PacketUtil for sending and MoveUtil for motion helpers. The mode classes hold their own values (NumberValue percentages, BooleanValue toggles) so the GUI presents each mode's settings inside the parent module's screen. Enabling a mode registers its listeners; switching modes swaps the whole listener set.

Key techniques

StandardVelocity is the baseline. With horizontal zero it applies the packet's vertical motion to the player and cancels the packet; with nonzero percentages it scales motionX and motionZ by horizontal over 100, motionY by vertical over 100, and replaces the packet; the Explosion Ignore flag cancels S27 outright, otherwise the explosion offsets are scaled the same way. GrimVelocity keys on S19PacketEntityStatus: only an opcode-2 hurt status for the self entity arms realVelocity, and only the next S12 for the self entity is cancelled, after which a C07 digging packet is sent from the player's position on the next PreUpdate, using START_DESTROY_BLOCK while looking at a block and swinging and STOP_DESTROY_BLOCK otherwise.

VulcanVelocity cancels S12 at zero/zero unless the Vulcan Speed mode is active and moving, in which case it amplifies the vector by 1.9 instead; it also intercepts S32 confirmations while hurtTime is 10, cancels them and emits a forged C0F with alternating window ids (1 and -1) and uids (-1 and 1) and a toggled accepted flag, keeping the server's transaction ledger busy with garbage confirmations around the hit. IntaveVelocity and AACVelocity never touch the packet stream: they multiply the live motion by 0.6 on a hit and, for Intave, cancel sprint, reproducing the vanilla hit-slowdown the server expects without any packet at all.

No-packet and jump-reset modes

IntaveVelocity runs on PreUpdate: if an attack landed, no hit-slowdown was applied and the player is sprinting, it multiplies motionX and motionZ by 0.6 and calls setSprinting(false). The HitSlowDownEvent listener sets slowDown so the damping is skipped when the client's own hit-slowdown already ran, and the attack flag is cleared every tick. AACVelocity applies the same 0.6 damping on PreMotion when onGround and hurtTime are both positive and BadPacketsComponent reports a clean stream; its jump field is never set, so the MoveInputEvent listener that consumes it is dead code in this build.

LegitVelocity (aliased Legit/Jump Reset and Polar) arms a jump flag on the S12 when the player is on the ground and the vertical component is positive, with the Legit Timing gate restricting it to the knockback window (ticksSinceVelocity at most 14 or onGroundTicks at most 1 when enabled), then forces the jump in MoveInputEvent with the Chance setting as the probability. This converts the knockback into a jump arc, which prediction-based velocity checks read as taken. The onSwing gate applies to every mode, so all of them can be restricted to swing-active moments.

source Velocity.java (mode selector)

Velocity.java40 lines · JavaOriginal ↗
1
package com.alan.clients.module.impl.combat;
2
3
import com.alan.clients.module.Module;
4
import com.alan.clients.module.api.Category;
5
import com.alan.clients.module.api.ModuleInfo;
6
import com.alan.clients.module.impl.combat.velocity.*;
7
import com.alan.clients.value.impl.BooleanValue;
8
import com.alan.clients.value.impl.ModeValue;
9
10
@ModuleInfo(aliases = {"module.combat.velocity.name"}, description = "module.combat.velocity.description" /* Sorry, Tecnio. */ /* Sorry Hazsi. */, category = Category.COMBAT)
11
public final class Velocity extends Module {
12
13
14
15
    public final ModeValue mode = new ModeValue("Mode", this)
16
            .add(new StandardVelocity("Standard", this))
17
            .add(new BufferAbuseVelocity("Buffer Abuse", this))
18
            .add(new WatchdogVelocity("Delay", this))
19
            .add(new LegitVelocity("Legit/Jump Reset", this))
20
            .add(new LegitVelocity("Polar", this))
21
            .add(new GroundVelocity("Ground", this))
22
            .add(new IntaveVelocity("Intave", this))
23
            .add(new MatrixVelocity("Matrix", this))
24
            .add(new AACVelocity("AAC", this))
25
            .add(new VulcanVelocity("Vulcan", this))
26
            .add(new RedeskyVelocity("Redesky", this))
27
            .add(new TickVelocity("Tick", this))
28
            .add(new BounceVelocity("Bounce", this))
29
            .add(new KarhuVelocity("Karhu", this))
30
            .add(new MMCVelocity("MMC", this))
31
            .add(new UniversoCraftVelocity("Universocraft", this))
32
            .add(new GrimReduceVelocity("Grim Reduce", this))
33
            .add(new GrimVelocity("Grim", this))
34
            .add(new WatchdogVelocity("Watchdog", this))
35
            .add(new WatchdogPredictionVelocity("Watchdog Prediction", this))
36
            .setDefault("Standard");
37
38
39
    public final BooleanValue onSwing = new BooleanValue("On Swing", this, false);
40
}

What this file does

The module class contains no packet logic. Its only fields are the ModeValue named mode, built by chaining add calls for all twenty mode classes (Standard, Buffer Abuse, Delay via WatchdogVelocity, Legit/Jump Reset and Polar via LegitVelocity, Ground, Intave, Matrix, AAC, Vulcan, Redesky, Tick, Bounce, Karhu, MMC, Universocraft, Grim Reduce, Grim, Watchdog and Watchdog Prediction), and the onSwing BooleanValue defaulting to false. setDefault pins Standard as the mode active on first enable.

Each mode class is instantiated with its display name and the parent module, so the ModeValue owns the instances and switching modes swaps the registered listeners. The module is annotated with aliases and description translation keys (module.combat.velocity.name and module.combat.velocity.description) and category Category.COMBAT, with the developer comments apologizing to Tecnio and Hazsi left in the source. The onSwing value is the module's single shared control: every mode reads it through getParent().onSwing.getValue() to gate its own handler.

source StandardVelocity.java (default mode)

StandardVelocity.java164 lines · JavaOriginal ↗
1
package com.alan.clients.module.impl.combat.velocity;
2
3
import com.alan.clients.Client;
4
import com.alan.clients.event.Listener;
5
import com.alan.clients.event.Priorities;
6
import com.alan.clients.event.annotations.EventLink;
7
import com.alan.clients.event.impl.motion.PreMotionEvent;
8
import com.alan.clients.event.impl.other.TeleportEvent;
9
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
10
import com.alan.clients.module.impl.combat.Criticals;
11
import com.alan.clients.module.impl.combat.Velocity;
12
import com.alan.clients.module.impl.movement.Speed;
13
import com.alan.clients.util.packet.PacketUtil;
14
import com.alan.clients.util.player.MoveUtil;
15
import com.alan.clients.value.Mode;
16
import com.alan.clients.value.impl.BooleanValue;
17
import com.alan.clients.value.impl.NumberValue;
18
import net.minecraft.network.Packet;
19
import net.minecraft.network.play.client.C07PacketPlayerDigging;
20
import net.minecraft.network.play.server.S12PacketEntityVelocity;
21
import net.minecraft.network.play.server.S27PacketExplosion;
22
import net.minecraft.util.BlockPos;
23
import net.minecraft.util.EnumFacing;
24
25
public final class StandardVelocity extends Mode<Velocity> {
26
    public Boolean disable2 = false;
27
28
    private Integer time = 0;
29
    private Speed speed = null;
30
31
    private String mode = null;
32
33
    private int amount;
34
35
    private final NumberValue horizontal = new NumberValue("Horizontal", this, 0, 0, 100, 1);
36
    private final NumberValue vertical = new NumberValue("Vertical", this, 0, 0, 100, 1);
37
38
    private final BooleanValue onExplode = new BooleanValue("Explosion Ignore", this, false);
39
40
41
    @Override
42
    public void onEnable() {
43
      time = 0;
44
    setDisable2(false);
45
    }
46
47
    public StandardVelocity(String name, Velocity parent) {
48
        super(name, parent);
49
    }
50
51
    @EventLink(value = Priorities.VERY_LOW)
52
    public final Listener<PacketReceiveEvent> onPacketReceiveEvent = event -> {
53
        if ((getParent().onSwing.getValue() && !mc.thePlayer.isSwingInProgress) || event.isCancelled()) {
54
            return;
55
        }
56
57
        final Packet<?> p = event.getPacket();
58
59
        final double horizontal = this.horizontal.getValue().doubleValue();
60
        final double vertical = this.vertical.getValue().doubleValue();
61
        final boolean onExplode = this.onExplode.getValue();
62
63
        if (p instanceof S12PacketEntityVelocity) {
64
65
            final S12PacketEntityVelocity wrapper = (S12PacketEntityVelocity) p;
66
67
            if (wrapper.getEntityID() == mc.thePlayer.getEntityId()) {
68
69
70
    if (horizontal == 0) {
71
        if (vertical != 0 && !event.isCancelled()) {
72
73
            mc.thePlayer.motionY = wrapper.getMotionY() / 8000.0D;
74
        }
75
76
77
        event.setCancelled();
78
        return;
79
    }
80
81
    wrapper.motionX *= horizontal / 100;
82
    wrapper.motionY *= vertical / 100;
83
    wrapper.motionZ *= horizontal / 100;
84
85
    event.setPacket(wrapper);
86
87
88
            }
89
        } else if (p instanceof S27PacketExplosion) {
90
            final S27PacketExplosion wrapper = (S27PacketExplosion) p;
91
92
            if (onExplode) {
93
                event.setCancelled();
94
                return;
95
            }
96
97
            wrapper.posX *= horizontal / 100;
98
            wrapper.posY *= vertical / 100;
99
            wrapper.posZ *= horizontal / 100;
100
101
            event.setPacket(wrapper);
102
        }
103
    };
104
105
    @EventLink
106
    public final Listener<PreMotionEvent> onPreMotionEvent = event -> {
107
        if (speed == null) {
108
            speed = getModule(Speed.class);
109
110
        }
111
112
113
/*
114
if(speed.isEnabled() && Client.INSTANCE.getModuleManager().get(Speed.class).mode.getValue().getName().equals("Watchdog")) {
115
116
        if (mc.thePlayer.hurtTime > 9) {
117
            mc.thePlayer.motionZ *= 0;
118
            mc.thePlayer.motionX *= 0;
119
            time++;
120
121
            if (!MoveUtil.isMoving()) {
122
                mc.thePlayer.motionZ *= 0;
123
                mc.thePlayer.motionX *= 0;
124
            }
125
        }
126
127
        if (mc.thePlayer.hurtTime == 9) {
128
            if (MoveUtil.isMoving() && !mc.thePlayer.onGround && !( mc.thePlayer.offGroundTicks == 1)) {
129
               // MoveUtil.partialStrafePercent(99);
130
                double speed =1;
131
                speed = Math.random()/50;
132
                MoveUtil.strafe(.3);
133
                  // mc.thePlayer.motionZ *= .95;
134
                 //  mc.thePlayer.motionX *= .95;
135
            } else {
136
                mc.thePlayer.motionZ *= -.2;
137
                mc.thePlayer.motionX *= -.2;
138
            }
139
140
141
        }
142
    }
143
144
 */
145
146
    };
147
148
    @EventLink
149
    public final Listener<TeleportEvent> onTeleport = event -> {
150
        if (event.getPosY() < mc.thePlayer.posY - 2);
151
152
153
    };
154
155
    public Boolean getDisable2() {
156
        return disable2;
157
    }
158
159
    public void setDisable2(Boolean disable2) {
160
        this.disable2 = disable2;
161
    }
162
}

What this file does

StandardVelocity is the default and the only mode that scales S27 as well as S12. The receive listener runs at Priorities.VERY_LOW and first checks the onSwing gate and the event's cancelled state. For S12 with the entity id matching the player, a zero horizontal slider applies the packet's vertical motion to the player (motionY equals the fixed-point Y divided by 8000.0) and then cancels the packet, which preserves the vertical launch while removing the horizontal push; nonzero percentages scale motionX and motionZ by horizontal over 100, motionY by vertical over 100, and replace the packet with the scaled copy. The Explosion Ignore toggle cancels S27 outright; without it the explosion offsets are scaled with the same percentages.

The file also carries a PreMotion listener whose body is entirely commented out (a Watchdog-speed interaction with a 0.3 strafe and random-jitter damping), and a Teleport listener with a vacuous if statement comparing the teleport Y against the player position. Those are dead code in this build; the live behavior is the receive listener alone. The horizontal and vertical NumberValues default to 0, which is the full-cancel configuration users start from.

source GrimVelocity.java (S19-gated cancel)

GrimVelocity.java62 lines · JavaOriginal ↗
1
package com.alan.clients.module.impl.combat.velocity;
2
3
import com.alan.clients.event.Listener;
4
import com.alan.clients.event.Priorities;
5
import com.alan.clients.event.annotations.EventLink;
6
import com.alan.clients.event.impl.motion.PreUpdateEvent;
7
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
8
import com.alan.clients.module.impl.combat.Velocity;
9
import com.alan.clients.util.packet.PacketUtil;
10
import com.alan.clients.value.Mode;
11
import net.minecraft.network.Packet;
12
import net.minecraft.network.play.client.C07PacketPlayerDigging;
13
import net.minecraft.network.play.server.S12PacketEntityVelocity;
14
import net.minecraft.network.play.server.S19PacketEntityStatus;
15
import net.minecraft.util.BlockPos;
16
import net.minecraft.util.EnumFacing;
17
import net.minecraft.util.MovingObjectPosition;
18
19
public final class GrimVelocity extends Mode<Velocity> {
20
21
    public GrimVelocity(String name, Velocity parent) {
22
        super(name, parent);
23
    }
24
25
    private boolean realVelocity, velocity;
26
27
    @EventLink(value = Priorities.VERY_LOW)
28
    public final Listener<PreUpdateEvent> onPreUpdate = event -> {
29
        if (velocity) {
30
            PacketUtil.send(new C07PacketPlayerDigging((mc.objectMouseOver != null && mc.thePlayer.isSwingInProgress && mc.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK ? C07PacketPlayerDigging.Action.START_DESTROY_BLOCK : C07PacketPlayerDigging.Action.STOP_DESTROY_BLOCK),
31
                    new BlockPos(mc.thePlayer), EnumFacing.UP));
32
33
            velocity = false;
34
        }
35
    };
36
    @EventLink(value = Priorities.VERY_LOW)
37
    public final Listener<PacketReceiveEvent> onReceiveLow = event -> {
38
        final Packet<?> packet = event.getPacket();
39
        if (event.isCancelled()) return;
40
41
        if(packet instanceof S19PacketEntityStatus) {
42
            final S19PacketEntityStatus wrapper = (S19PacketEntityStatus) event.getPacket();
43
44
            if(wrapper.getEntity(mc.theWorld) != mc.thePlayer || wrapper.getOpCode() != 2) {
45
                return;
46
            }
47
48
            realVelocity = true;
49
        }
50
51
        if (packet instanceof S12PacketEntityVelocity && realVelocity) {
52
            final S12PacketEntityVelocity wrapper = (S12PacketEntityVelocity) packet;
53
54
            if (wrapper.getEntityID() == mc.thePlayer.getEntityId()) {
55
                event.setCancelled();
56
57
                realVelocity = false;
58
                velocity = true;
59
            }
60
        }
61
    };
62
}

What this file does

GrimVelocity is built around the hurt-status packet rather than the velocity packet itself. The receive listener only arms realVelocity when S19PacketEntityStatus arrives with an entity resolving to the player and opcode 2, the hurt animation; it then cancels the next S12 for the self entity, clears the flag and sets velocity, so only knockback that follows an actual hurt status is removed. On the next PreUpdate the mode sends a C07PacketPlayerDigging from the player's own position, choosing START_DESTROY_BLOCK when the mouse is over a block and the player is swinging, and STOP_DESTROY_BLOCK otherwise, with EnumFacing.UP.

The digging action is the mode's cover traffic: it replaces the cancelled knockback with a block-interaction packet timed to the hurt, so the server sees activity around the hit even though the velocity never arrived. The S19 gate is what makes the mode selective, it only cancels knockback that follows a genuine hurt status, so non-hurt velocity (explosion knockback, for example) passes through untouched. The listener runs at Priorities.VERY_LOW so other modules can observe the S19 and S12 first.

source VulcanVelocity.java (transaction forging)

VulcanVelocity.java88 lines · JavaOriginal ↗
1
package com.alan.clients.module.impl.combat.velocity;
2
3
import com.alan.clients.event.Listener;
4
import com.alan.clients.event.annotations.EventLink;
5
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
6
import com.alan.clients.module.impl.combat.Velocity;
7
import com.alan.clients.module.impl.movement.Speed;
8
import com.alan.clients.module.impl.movement.Sprint;
9
import com.alan.clients.util.packet.PacketUtil;
10
import com.alan.clients.util.player.MoveUtil;
11
import com.alan.clients.value.Mode;
12
import com.alan.clients.value.impl.NumberValue;
13
import net.minecraft.network.Packet;
14
import net.minecraft.network.play.client.C0FPacketConfirmTransaction;
15
import net.minecraft.network.play.server.S12PacketEntityVelocity;
16
import net.minecraft.network.play.server.S27PacketExplosion;
17
import net.minecraft.network.play.server.S32PacketConfirmTransaction;
18
19
public final class VulcanVelocity extends Mode<Velocity> {
20
21
    private final NumberValue horizontal = new NumberValue("Horizontal", this, 0, 0, 100, 1);
22
    private final NumberValue vertical = new NumberValue("Vertical", this, 0, 0, 100, 1);
23
    private boolean transaction = false;
24
25
    public VulcanVelocity(String name, Velocity parent) {
26
        super(name, parent);
27
    }
28
29
    @EventLink
30
    public final Listener<PacketReceiveEvent> onPacketReceiveEvent = event -> {
31
        if (getParent().onSwing.getValue() && !mc.thePlayer.isSwingInProgress || event.isCancelled()) return;
32
33
        final Packet<?> p = event.getPacket();
34
        final double horizontal = this.horizontal.getValue().doubleValue();
35
        final double vertical = this.vertical.getValue().doubleValue();
36
37
38
        if (p instanceof S12PacketEntityVelocity) {
39
            final S12PacketEntityVelocity wrapper = (S12PacketEntityVelocity) p;
40
41
            if (wrapper.getEntityID() == mc.thePlayer.getEntityId()) {
42
                if (horizontal == 0 && vertical == 0) {
43
if(!(getModule(Speed.class).mode.getValue().getName()=="Vulcan") || !getModule(Speed.class).isEnabled() || !MoveUtil.isMoving()){
44
    event.setCancelled();
45
                    } else {
46
47
    wrapper.motionX *= 1.9;
48
    wrapper.motionY *= 1;
49
    wrapper.motionZ *=1.9;
50
}
51
52
                    return;
53
                }
54
55
                wrapper.motionX *= 1;
56
                wrapper.motionY *= 1;
57
                wrapper.motionZ *=1;
58
59
                event.setPacket(wrapper);
60
            }
61
        }
62
63
64
        if (p instanceof S27PacketExplosion) {
65
            final S27PacketExplosion wrapper = (S27PacketExplosion) p;
66
67
            if (horizontal == 0 && vertical == 0) {
68
                event.setCancelled();
69
                return;
70
            }
71
72
            wrapper.posX *= horizontal / 100;
73
            wrapper.posY *= vertical / 100;
74
            wrapper.posZ *= horizontal / 100;
75
76
            event.setPacket(wrapper);
77
        }
78
79
80
        if (p instanceof S32PacketConfirmTransaction && mc.thePlayer.hurtTime == 10) {
81
            event.setCancelled(true);
82
            PacketUtil.send(new C0FPacketConfirmTransaction((short) (transaction ? 1 : -1), (short) (transaction ? -1 : 1), transaction));
83
            transaction = !transaction;
84
85
86
        }
87
    };
88
}

What this file does

VulcanVelocity combines S12 handling with transaction forgery. With both sliders at zero it cancels the S12 unless the Vulcan Speed mode is active and the player is moving, in which case it amplifies the vector instead (motionX and motionZ by 1.9, motionY unchanged); nonzero percentages pass the packet through with a 1.0 multiplier. S27 explosion knockback is cancelled at zero/zero and scaled with the percentages otherwise.

The distinctive part is the S32 branch: while hurtTime is exactly 10, every incoming S32PacketConfirmTransaction is cancelled and a forged C0FPacketConfirmTransaction is sent with alternating window ids (1 then -1) and uids (-1 then 1) and a toggled accepted flag. The server receives confirmations that never match its own transaction records, which desyncs the transaction ledger around the hit and masks the missing knockback confirmation. The transaction flag alternates every call, so the forged stream never repeats an identical pair.

The mode also depends on the Vulcan Speed mode's configuration at runtime: the amplification path reads getModule(Speed.class).mode.getValue().getName() and compares it to the string 'Vulcan', an object-identity comparison against a string literal that never matches, so the amplification branch is effectively unreachable and the S12 is always cancelled at zero/zero in practice.

source IntaveVelocity.java (no-packet damping)

IntaveVelocity.java42 lines · JavaOriginal ↗
1
package com.alan.clients.module.impl.combat.velocity;
2
3
import com.alan.clients.event.Listener;
4
import com.alan.clients.event.annotations.EventLink;
5
import com.alan.clients.event.impl.motion.HitSlowDownEvent;
6
import com.alan.clients.event.impl.motion.PreUpdateEvent;
7
import com.alan.clients.event.impl.other.AttackEvent;
8
import com.alan.clients.module.impl.combat.Velocity;
9
import com.alan.clients.value.Mode;
10
11
public final class IntaveVelocity extends Mode<Velocity> {
12
13
    private boolean attacked, slowDown;
14
15
    public IntaveVelocity(String name, Velocity parent) {
16
        super(name, parent);
17
    }
18
19
    @EventLink
20
    public final Listener<PreUpdateEvent> onPreUpdate = event -> {
21
        if (getParent().onSwing.getValue() && !mc.thePlayer.isSwingInProgress) return;
22
23
        if (attacked && !slowDown && mc.thePlayer.isSprinting()) {
24
            mc.thePlayer.motionX *= 0.6D;
25
            mc.thePlayer.motionZ *= 0.6D;
26
            mc.thePlayer.setSprinting(false);
27
        }
28
29
        attacked = false;
30
        slowDown = false;
31
    };
32
33
    @EventLink
34
    public final Listener<HitSlowDownEvent> onHitSlowDown = event -> {
35
        slowDown = true;
36
    };
37
38
    @EventLink
39
    public final Listener<AttackEvent> onAttack = event -> {
40
        attacked = true;
41
    };
42
}

What this file does

IntaveVelocity is a no-packet mode: it never cancels or rewrites an S12, it modifies the player's motion directly. The PreUpdate listener checks the onSwing gate, and when an attack landed (attacked is true), no hit-slowdown ran (slowDown is false) and the player is sprinting, it multiplies motionX and motionZ by 0.6 and calls setSprinting(false). The attacked and slowDown flags are cleared every tick, and the HitSlowDownEvent listener sets slowDown so the damping is skipped when the client's own hit-slowdown already produced the 0.6 factor.

The effect is the vanilla hit-slowdown reproduced without any packet: the server sees the player stop sprinting and move at the slowed speed, which is what a legitimately hit player does, while the knockback vector itself is never acknowledged. Because the movement arrives through normal C03 packets, prediction-based checks see a player moving exactly as a slowed, hit player should. The mode is 42 lines and holds no settings of its own; everything is driven by the attack, hit-slowdown and sprint state.

source AACVelocity.java (ground damping)

AACVelocity.java45 lines · JavaOriginal ↗
1
package com.alan.clients.module.impl.combat.velocity;
2
3
import com.alan.clients.component.impl.player.BadPacketsComponent;
4
import com.alan.clients.component.impl.player.TargetComponent;
5
import com.alan.clients.event.Listener;
6
import com.alan.clients.event.annotations.EventLink;
7
import com.alan.clients.event.impl.input.MoveInputEvent;
8
import com.alan.clients.event.impl.motion.PreMotionEvent;
9
import com.alan.clients.module.impl.combat.Velocity;
10
import com.alan.clients.util.packet.PacketUtil;
11
import com.alan.clients.value.Mode;
12
import net.minecraft.entity.EntityLivingBase;
13
import net.minecraft.network.play.client.C0APacketAnimation;
14
15
import java.util.List;
16
17
public final class AACVelocity extends Mode<Velocity> {
18
19
    private boolean jump;
20
21
    public AACVelocity(String name, Velocity parent) {
22
        super(name, parent);
23
    }
24
25
    @EventLink
26
    public final Listener<PreMotionEvent> onPreMotionEvent = event -> {
27
        if (getParent().onSwing.getValue() && !mc.thePlayer.isSwingInProgress) return;
28
        List<EntityLivingBase> targets = TargetComponent.getTargets(7);
29
        if (mc.thePlayer.onGround && mc.thePlayer.hurtTime > 0 && !BadPacketsComponent.bad(false, true, false, false, false)) {
30
            mc.thePlayer.motionX *= 0.6D;
31
            mc.thePlayer.motionZ *= 0.6D;
32
        }
33
34
        jump = false;
35
    };
36
37
    @EventLink
38
    public final Listener<MoveInputEvent> onMove = event -> {
39
        if (getParent().onSwing.getValue() && !mc.thePlayer.isSwingInProgress) return;
40
41
        if (jump) {
42
            event.setJump(true);
43
        }
44
    };
45
}

What this file does

AACVelocity damps the motion on the ground after a hit. The PreMotion listener checks the onSwing gate, collects targets within 7 blocks through TargetComponent, and when the player is on the ground, hurtTime is positive and BadPacketsComponent reports a clean stream, multiplies motionX and motionZ by 0.6. The jump field is reset to false every tick, and the MoveInputEvent listener forces a jump when that field is set, but nothing in the file ever sets jump to true, so the jump listener is dead code in this build.

The ground gate makes the mode act only on hits taken while grounded, which is the common case for melee trades, and the BadPacketsComponent check skips the damping when the outbound stream is polluted. The 0.6 factor mirrors vanilla hit-slowdown, so the movement the server sees matches what a slowed player should produce. Like IntaveVelocity it is a no-packet mode: the S12 is never touched, the damping is purely client-side motion editing that surfaces through the normal C03 stream.

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 KnockbackHandler (AntiKB, prediction offset)

KnockbackHandler.java262 lines · Java
1
package ac.grim.grimac.checks.impl.velocity;
2
3
import ac.grim.grimac.api.config.ConfigManager;
4
import ac.grim.grimac.api.storage.verbose.Verbose;
5
import ac.grim.grimac.checks.Check;
6
import ac.grim.grimac.checks.CheckData;
7
import ac.grim.grimac.checks.type.PacketSendListener;
8
import ac.grim.grimac.checks.type.PostPredictionListener;
9
import ac.grim.grimac.player.GrimPlayer;
10
import ac.grim.grimac.utils.anticheat.update.PredictionComplete;
11
import ac.grim.grimac.utils.data.Pair;
12
import ac.grim.grimac.utils.data.VectorData;
13
import ac.grim.grimac.utils.data.VelocityData;
14
import ac.grim.grimac.utils.math.Vector3dm;
15
import com.github.retrooper.packetevents.event.PacketSendEvent;
16
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
17
import com.github.retrooper.packetevents.util.Vector3d;
18
import com.github.retrooper.packetevents.wrapper.play.server.WrapperPlayServerEntityVelocity;
19
import lombok.Getter;
20
import org.jetbrains.annotations.NotNull;
21
22
import java.util.Deque;
23
import java.util.LinkedList;
24
25
// We are making a velocity sandwich between two pieces of transaction packets (bread)
26
@CheckData(name = "AntiKB", stableKey = "grim.velocity.anti_knockback", alternativeName = "AntiKnockback", configName = "Knockback", description = "Did not take the expected entity knockback", setback = 10, decay = 0.025)
27
public class KnockbackHandler extends Check implements PacketSendListener, PostPredictionListener {
28
    private static final Verbose V = Verbose.of("[ignored knockback|o: {offset}]");
29
30
    private final Deque<VelocityData> firstBreadMap = new LinkedList<>();
31
32
    private final Deque<VelocityData> lastKnockbackKnownTaken = new LinkedList<>();
33
    private VelocityData firstBreadOnlyKnockback = null;
34
    @Getter
35
    private boolean knockbackPointThree = false;
36
37
    private double offsetToFlag;
38
    private double maxAdv, immediate, ceiling, multiplier;
39
40
    private double threshold;
41
42
    public KnockbackHandler(GrimPlayer player) {
43
        super(player);
44
    }
45
46
    @Override
47
    public void onPacketSend(final PacketSendEvent event) {
48
        if (event.getPacketType() == PacketType.Play.Server.ENTITY_VELOCITY) {
49
            WrapperPlayServerEntityVelocity velocity = new WrapperPlayServerEntityVelocity(event);
50
            int entityId = velocity.getEntityId();
51
52
            // Detect whether this knockback packet affects the player or if it is useless
53
            // Mojang sends extra useless knockback packets for no apparent reason
54
            if (player.compensatedEntities.serverPlayerVehicle != null && entityId != player.compensatedEntities.serverPlayerVehicle) {
55
                return;
56
            }
57
            if (player.compensatedEntities.serverPlayerVehicle == null && entityId != player.entityID) {
58
                return;
59
            }
60
61
            // If the player isn't in a vehicle and the ID is for the player, the player will take kb
62
            // If the player is in a vehicle and the ID is for the player's vehicle, the player will take kb
63
            Vector3d playerVelocity = velocity.getVelocity();
64
65
            // Blacklist problemated vector until mojang fixes a client-sided bug
66
            if (playerVelocity.getY() == -0.04) {
67
                velocity.setVelocity(playerVelocity.add(new Vector3d(0, 1 / 8000D, 0)));
68
                playerVelocity = velocity.getVelocity();
69
                event.markForReEncode(true);
70
            }
71
72
            playerVelocity = VectorPrecisionConverter.convert(player.getClientVersion(), playerVelocity);
73
74
            // Wrap velocity between two transactions
75
            player.sendTransaction();
76
            addPlayerKnockback(entityId, player.lastTransactionSent.get(), new Vector3dm(playerVelocity.getX(), playerVelocity.getY(), playerVelocity.getZ()));
77
            event.getTasksAfterSend().add(player::sendTransaction);
78
        }
79
    }
80
81
    @NotNull
82
    public Pair<VelocityData, Vector3dm> getFutureKnockback() {
83
        // Chronologically in the future
84
        if (!firstBreadMap.isEmpty()) {
85
            VelocityData data = firstBreadMap.peek();
86
            return new Pair<>(data, data != null ? data.vector : null);
87
        }
88
89
        // Less in the future
90
        if (!lastKnockbackKnownTaken.isEmpty()) {
91
            VelocityData data = lastKnockbackKnownTaken.peek();
92
            return new Pair<>(data, data != null ? data.vector : null);
93
        }
94
95
        // Uncertain, might be in the future
96
        if (player.firstBreadKB != null && player.likelyKB == null) {
97
            VelocityData data = player.firstBreadKB;
98
            return new Pair<>(data, data.vector.clone());
99
        } else if (player.likelyKB != null) { // Known to be in the present
100
            VelocityData data = player.likelyKB;
101
            return new Pair<>(data, data.vector.clone());
102
        }
103
        return new Pair<>(null, null);
104
    }
105
106
    private void addPlayerKnockback(int entityID, int breadOne, @NotNull Vector3dm knockback) {
107
        firstBreadMap.add(new VelocityData(entityID, breadOne, player.getSetbackTeleportUtil().isSendingSetback, knockback));
108
    }
109
110
    public VelocityData calculateRequiredKB(int entityID, int transaction, boolean isJustTesting) {
111
        tickKnockback(transaction);
112
113
        VelocityData returnLastKB = null;
114
        for (VelocityData data : lastKnockbackKnownTaken) {
115
            if (data.entityID == entityID)
116
                returnLastKB = data;
117
        }
118
119
        if (!isJustTesting) {
120
            lastKnockbackKnownTaken.clear();
121
        }
122
        return returnLastKB;
123
    }
124
125
    private void tickKnockback(int transactionID) {
126
        firstBreadOnlyKnockback = null;
127
        if (firstBreadMap.isEmpty()) return;
128
        VelocityData data = firstBreadMap.peek();
129
        while (data != null) {
130
            if (data.transaction == transactionID) { // First bread knockback
131
                firstBreadOnlyKnockback = new VelocityData(data.entityID, data.transaction, data.isSetback, data.vector);
132
                //firstBreadMap.poll();
133
                break; // All knockback after this will have not been applied
134
            } else if (data.transaction < transactionID) { // This kb has 100% arrived to the player
135
                VelocityData velocityData = new VelocityData(data.entityID, data.transaction, data.isSetback, data.vector);
136
137
                if (firstBreadOnlyKnockback != null) { // Don't require kb twice
138
                    velocityData.offset = data.offset;
139
                }
140
141
                lastKnockbackKnownTaken.add(velocityData);
142
143
                // Knockback has been applied and is now required, remove it from first bread
144
                firstBreadOnlyKnockback = null;
145
                firstBreadMap.poll();
146
                data = firstBreadMap.peek();
147
            } else { // We are too far ahead in the future
148
                break;
149
            }
150
        }
151
    }
152
153
    public void forceExempt() {
154
        // Unsure knockback was taken
155
        if (player.firstBreadKB != null) {
156
            player.firstBreadKB.offset = 0;
157
        }
158
159
        if (player.likelyKB != null) {
160
            player.likelyKB.offset = 0;
161
        }
162
    }
163
164
    public void setPointThree(boolean isPointThree) {
165
        knockbackPointThree = knockbackPointThree || isPointThree;
166
    }
167
168
    public void handlePredictionAnalysis(double offset) {
169
        if (player.firstBreadKB != null) {
170
            player.firstBreadKB.offset = Math.min(player.firstBreadKB.offset, offset);
171
        }
172
173
        if (player.likelyKB != null) {
174
            player.likelyKB.offset = Math.min(player.likelyKB.offset, offset);
175
        }
176
    }
177
178
    @Override
179
    public void onPredictionComplete(final PredictionComplete predictionComplete) {
180
        double offset = predictionComplete.getOffset();
181
        if (!predictionComplete.isChecked() || predictionComplete.getData().isTeleport()) {
182
            forceExempt();
183
            return;
184
        }
185
186
        boolean wasZero = knockbackPointThree;
187
        knockbackPointThree = false;
188
189
        if (player.likelyKB == null && player.firstBreadKB == null) {
190
            return;
191
        }
192
193
        if (player.predictedVelocity.isFirstBreadKb()) {
194
            firstBreadOnlyKnockback = null;
195
            firstBreadMap.poll(); // Remove from map so we don't pull it again
196
        }
197
198
        if (wasZero || player.predictedVelocity.isKnockback()) {
199
            // Unsure knockback was taken
200
            if (player.firstBreadKB != null) {
201
                player.firstBreadKB.offset = Math.min(player.firstBreadKB.offset, offset);
202
            }
203
204
            // 100% known kb was taken
205
            if (player.likelyKB != null) {
206
                player.likelyKB.offset = Math.min(player.likelyKB.offset, offset);
207
            }
208
        }
209
210
        if (player.likelyKB != null) {
211
            if (player.likelyKB.offset > offsetToFlag) {
212
                threshold = Math.min(threshold + player.likelyKB.offset, ceiling);
213
                if (player.likelyKB.isSetback) { // Don't increase violations if this velocity was setback, just teleport and resend them velocity.
214
                    if (!isNoSetbackPermission()) {
215
                        player.getSetbackTeleportUtil().executeViolationSetback();
216
                    }
217
                } else {
218
                    boolean ignored = player.likelyKB.offset == Integer.MAX_VALUE;
219
                    if (flag(V.write(verbose()).bool(ignored).f64(player.likelyKB.offset))) { // This velocity was sent by the server.
220
                        if (player.likelyKB.offset >= immediate || threshold >= maxAdv) {
221
                            setbackIfAboveSetbackVL();
222
                        }
223
                    } else {
224
                        reward();
225
                    }
226
                }
227
            } else if (threshold > 0.05) {
228
                threshold *= multiplier;
229
            }
230
        }
231
    }
232
233
    public boolean shouldIgnoreForPrediction(VectorData data) {
234
        if (data.isKnockback() && data.isFirstBreadKb()) {
235
            return player.firstBreadKB.offset > offsetToFlag;
236
        }
237
        return false;
238
    }
239
240
    public boolean wouldFlag() {
241
        return (player.likelyKB != null && player.likelyKB.offset > offsetToFlag) || (player.firstBreadKB != null && player.firstBreadKB.offset > offsetToFlag);
242
    }
243
244
    public VelocityData calculateFirstBreadKnockback(int entityID, int transaction) {
245
        tickKnockback(transaction);
246
        if (firstBreadOnlyKnockback != null && firstBreadOnlyKnockback.entityID == entityID)
247
            return firstBreadOnlyKnockback;
248
        return null;
249
    }
250
251
    @Override
252
    public void onReload(@NotNull ConfigManager config) {
253
        offsetToFlag = config.getDoubleElse("Knockback.threshold", 0.001);
254
        maxAdv = config.getDoubleElse("Knockback.max-advantage", 1);
255
        immediate = config.getDoubleElse("Knockback.immediate-setback-threshold", 0.1);
256
        multiplier = config.getDoubleElse("Knockback.setback-decay-multiplier", 0.999);
257
        ceiling = config.getDoubleElse("Knockback.max-ceiling", 4);
258
        if (maxAdv < 0) maxAdv = Double.MAX_VALUE;
259
        if (immediate < 0) immediate = Double.MAX_VALUE;
260
    }
261
262
}

How it counteracts this module

Grim's KnockbackHandler sandwiches the ENTITY_VELOCITY packet between two server transactions and treats the echo of the second as proof the knockback arrived. tickKnockback promotes the velocity from firstBreadMap into lastKnockbackKnownTaken on that transaction, and from then on the prediction engine requires the vector in the player's motion. onPredictionComplete flags when the prediction offset exceeds offsetToFlag (default 0.001) and sets the player back once the offset reaches 0.1 or the accumulated threshold (decay 0.999, ceiling 4) hits maxAdvantage 1.

Rise 6.2.4's Standard mode at zero/zero is a direct hit: the vector is required and absent, so the offset is the full knockback. GrimVelocity's S19 gate and C07 digging do not help, because Grim's requirement is driven by its own transaction sandwich, not by the client's hurt status or digging actions; the cancelled S12 still leaves the required vector missing. The amplification branch in VulcanVelocity (1.9 multiplier) would make the offset worse, not better, and the forged C0F stream does not satisfy Grim's sandwich, which validates its own negative transaction ids.

The bypass surface is the same as for every Grim-facing velocity module: eat the second transaction receipt and its echo so the velocity never leaves the uncertain firstBreadMap bucket and is never required. The forged confirmations VulcanVelocity emits actually work against this, because Grim tracks its own ids and a confirmation that matches nothing is a stream anomaly. On the server side Grim also applies a client-version precision conversion to the vector before it is required, which absorbs small fixed-point rounding but not a cancelled or scaled knockback.

anticheat AntiVelocityJump (sprint-jump ratio)

AntiVelocityJump.java95 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.position;
20
21
import me.islandscout.hawk.HawkPlayer;
22
import me.islandscout.hawk.check.Cancelless;
23
import me.islandscout.hawk.check.MovementCheck;
24
import me.islandscout.hawk.event.MoveEvent;
25
import me.islandscout.hawk.util.Direction;
26
import me.islandscout.hawk.util.Pair;
27
import org.bukkit.entity.Player;
28
29
import java.util.HashMap;
30
import java.util.Map;
31
import java.util.UUID;
32
33
/**
34
 * The AntiVelocityJump check monitors the abuse of an exploit
35
 * in the client which alters received knockback significantly.
36
 * The exploit is as follows: sprint-jump on the same tick that you
37
 * receive knockback. This is difficult to achieve consistently
38
 * without external assistance; those that can do it consistently
39
 * are most likely cheating.
40
 */
41
public class AntiVelocityJump extends MovementCheck implements Cancelless {
42
43
    private int SAMPLES;
44
    private double RATIO_THRESHOLD;
45
46
    private Map<UUID, Pair<Integer, Integer>> ratioMap;
47
    private Map<UUID, Long> landingTickMap;
48
49
    public AntiVelocityJump() {
50
        super("antivelocityjump", true, -1, 1, 0.9, 5000, "%player% may be using anti-velocity (jump), VL: %vl%", null);
51
        SAMPLES = (int)customSetting("samples", "", 10);
52
        RATIO_THRESHOLD = (double)customSetting("ratioThreshold", "", 0.85);
53
        ratioMap = new HashMap<>();
54
        landingTickMap = new HashMap<>();
55
    }
56
57
    @Override
58
    protected void check(MoveEvent event) {
59
        HawkPlayer pp = event.getHawkPlayer();
60
        long ticksOnGround = landingTickMap.getOrDefault(pp.getUuid(), 0L);
61
        if(event.hasAcceptedKnockback() && pp.isOnGround() && pp.isSprinting() && ticksOnGround > 1 && !event.getBoxSidesTouchingBlocks().contains(Direction.TOP)) {
62
63
            Pair<Integer, Integer> ratio = ratioMap.getOrDefault(pp.getUuid(), new Pair<>(0, 0));
64
65
            if(event.isJump()) {
66
                ratio.setKey(ratio.getKey() + 1);
67
            }
68
            ratio.setValue(ratio.getValue() + 1);
69
70
            if(ratio.getValue() >= SAMPLES) {
71
                double ratioValue = (double)ratio.getKey() / ratio.getValue();
72
                if(ratioValue > RATIO_THRESHOLD) {
73
                    punish(pp, false, event);
74
                }
75
                else {
76
                    reward(pp);
77
                }
78
                ratio.setKey(0);
79
                ratio.setValue(0);
80
            }
81
82
            ratioMap.put(pp.getUuid(), ratio);
83
        }
84
85
        if(!pp.isOnGround() && event.isOnGround()) {
86
            landingTickMap.put(pp.getUuid(), pp.getCurrentTick());
87
        }
88
    }
89
90
    @Override
91
    public void removeData(Player p) {
92
        ratioMap.remove(p.getUniqueId());
93
        landingTickMap.remove(p.getUniqueId());
94
    }
95
}

How it counteracts this module

Hawk's AntiVelocityJump targets the sprint-jump-on-knockback exploit: taking knockback while doing a sprint jump in the same tick, which resets the knockback's vertical component to a jump arc. The check samples the moves that follow accepted knockback: when the player is on the ground, sprinting, has been grounded for more than one tick, is not colliding with a block above, and the move is a jump, the jump count increments; every accepted-knockback move increments the total. Once the sample reaches the samples setting (default 10), a jump ratio above ratioThreshold (default 0.85) triggers the 'may be using anti-velocity (jump)' violation at 1 VL, and both counters reset.

Rise 6.2.4's Legit modes are the direct target: LegitVelocity (Legit/Jump Reset and Polar) arms a jump on the S12 and forces it through MoveInputEvent with the Chance setting as the probability. With Chance at 100 the player jumps on essentially every knockback, so the ratio of jump moves to accepted-knockback moves approaches 1.0, well above 0.85, and the check flags after ten samples. Lower Chance values dilute the ratio; at 50 the ratio sits around 0.5 and passes, which is the honest bypass: keep the jump probability below the threshold and the check rewards.

The check only samples while the player is on the ground, sprinting and not colliding above, so jumps taken from air or without sprint never enter the sample, and landingTickMap resets the ground timer whenever the player leaves the ground. Among the other modes, IntaveVelocity's sprint cancellation actually helps here, because the check requires sprinting to sample at all, so a player whose sprint was cancelled is never measured. The 0.85 threshold with 10 samples means occasional legit sprint-jumps pass; only the sustained pattern flags.

anticheat VelocityA (sent vector vs reported rise)

VelocityA.java70 lines · Java
1
package us.skidrevenant.azure.check.checks.combat.velocity;
2
3
import net.minecraft.server.v1_8_R3.Packet;
4
import net.minecraft.server.v1_8_R3.PacketPlayOutEntityVelocity;
5
import org.bukkit.Location;
6
import org.bukkit.event.player.PlayerMoveEvent;
7
import us.skidrevenant.azure.check.Check;
8
import us.skidrevenant.azure.stats.PlayerStats;
9
import us.skidrevenant.azure.util.reflection.ReflectionUtil;
10
11
/**
12
 * @author SkidRevenant
13
 * at 30/05/2018
14
 */
15
public class VelocityA extends Check {
16
17
    private double verticalVelocity;
18
19
    public VelocityA(PlayerStats player) {
20
        super(player);
21
    }
22
23
    @Override
24
    public void onMove(Location from, Location to, PlayerMoveEvent event) {
25
        if (from.getY() >= to.getY()) {
26
            return;
27
        }
28
29
        double deltaY = to.getY() - from.getY();
30
31
        if (deltaY > 0 && deltaY < 0.42 && deltaY < verticalVelocity * 0.77) {
32
            long velocity = Math.round(100.0 * deltaY / verticalVelocity);
33
            verticalVelocity = 0;
34
35
            onViolation(String.format("Velocity Type A (%d%%)", velocity), 10000L, 4);
36
        }
37
    }
38
39
    @Override
40
    public void onPacketSend(Class<? extends Packet> type, Packet packet) {
41
        if (type == PacketPlayOutEntityVelocity.class) {
42
            PacketPlayOutEntityVelocity entityVelocity = (PacketPlayOutEntityVelocity) packet;
43
44
            int entityId = ReflectionUtil.getFieldValue(ReflectionUtil.getField(PacketPlayOutEntityVelocity.class, "a", int.class), entityVelocity);
45
46
            if (entityId == player.getBukkitPlayer().getEntityId()) {
47
48
                if (player.getBukkitPlayer().getLastDamageCause() != null) {
49
                    switch (player.getBukkitPlayer().getLastDamageCause().getCause()) {
50
                        case STARVATION:
51
                        case FIRE_TICK:
52
                        case DROWNING:
53
                        case POISON:
54
                        case WITHER:
55
                        case THORNS:
56
                        case FALL:
57
                        case LAVA:
58
                        case FIRE:
59
60
                            verticalVelocity = 0;
61
                            return;
62
                    }
63
                }
64
65
                verticalVelocity = (int) ReflectionUtil.getFieldValue(ReflectionUtil.getField(PacketPlayOutEntityVelocity.class, "c", int.class), entityVelocity) / 8000.0;
66
            }
67
68
        }
69
    }
70
}

How it counteracts this module

Azure's VelocityA records the vertical component of the S12 the server sent (field c divided by 8000.0, with damage-cause exclusions) and compares it against the rise the player reports. onMove only proceeds when the player rose, and flags when deltaY is positive, below the 0.42 jump height and below 77% of the recorded vertical velocity, printing the percentage and applying a 10000ms cooldown with 4 VL. Because the denominator comes from the server's own packet, client-side scaling cannot change it.

Standard mode's vertical slider is the direct knob: 50% vertical produces a rise around half the sent vector, ratio 0.5, which flags as Velocity Type A (50%); any vertical percentage from 1 through 76 flags, while 80% and above passes. The delayed vertical damping in the More Options equivalent and the attack-time damping in other clients reduce the rise on the tick after the hit, which lands in the same flagged band. Horizontal-only changes (Standard horizontal 0 with vertical 100, and the horizontal sliders generally) are invisible, since the check only inspects the vertical axis.

The check's blind spot is full cancellation and the no-packet modes: Standard at 0/0 never rises, so the early return fires and nothing is flagged, and IntaveVelocity and AACVelocity keep the vertical movement intact while damping only the horizontal plane, so the rise still matches the sent vector. GrimVelocity, which removes the whole S12, is likewise invisible because the player never rises. The 0.42 cap is the safeguard against jumping, and the damage-cause exclusions prevent false flags on fall, fire and drowning damage.

anticheat UnusedVelocity (unused knockback ledger)

UnusedVelocity.java87 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.moving.player;
16
17
import org.bukkit.entity.Player;
18
19
import fr.neatmonster.nocheatplus.checks.CheckType;
20
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
21
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
22
import fr.neatmonster.nocheatplus.checks.moving.velocity.SimpleAxisVelocity;
23
import fr.neatmonster.nocheatplus.checks.moving.velocity.UnusedTracker;
24
import fr.neatmonster.nocheatplus.logging.debug.DebugUtil;
25
import fr.neatmonster.nocheatplus.players.IPlayerData;
26
import fr.neatmonster.nocheatplus.utilities.CheckUtils;
27
28
public class UnusedVelocity {
29
    
30
    // TODO: Currently is debug only (!). Only call if some debug flag is set. Needs checks.moving.debug to work at all.
31
32
    /**
33
     * Test if any unused velocity has been tracked and what that means. (Convenience.)
34
     * 
35
     * @param player
36
     * @return If the player has failed the check, whatever that means.
37
     */
38
    public static boolean checkUnusedVelocity(final Player player, 
39
            final CheckType checkType, final IPlayerData pData) {
40
        return checkUnusedVelocity(
41
                player, checkType, 
42
                pData.getGenericInstance(MovingData.class), 
43
                pData.getGenericInstance(MovingConfig.class)
44
                );
45
    }
46
47
48
    /**
49
     * Test if any unused velocity has been tracked and what that means.
50
     * 
51
     * @param player
52
     * @param data
53
     * @param cc
54
     * @return If the player has failed the check, whatever that means.
55
     */
56
    public static boolean checkUnusedVelocity(final Player player, 
57
            final CheckType checkType, final MovingData data, final MovingConfig cc) {
58
        boolean violation = false;
59
        final SimpleAxisVelocity verVel = data.getVerticalVelocityTracker();
60
        violation |= quickCheckDirection(player, verVel.unusedTrackerPos, checkType, "vert/pos", data, cc);
61
        violation |= quickCheckDirection(player, verVel.unusedTrackerNeg, checkType, "vert/neg", data, cc);
62
        return violation;
63
    }
64
65
    /**
66
     * Quick check tracker for one direction.
67
     * @param player
68
     * @param checkType 
69
     * @param unusedTrackerPos
70
     * @param string
71
     * @param data
72
     * @param cc
73
     */
74
    private static boolean quickCheckDirection(final Player player, 
75
            final UnusedTracker tracker, final CheckType checkType, final String trackerId ,
76
            MovingData data, MovingConfig cc) {
77
        final int countV = tracker.getResultViolationCount();
78
        if (countV > 0) {
79
            String msg = "Unused velocity " + trackerId + ": c_v: " + countV + " , a_v: " + tracker.getResultViolationAmount() + " , c_u: " + tracker.getResultUpdateCount();
80
            DebugUtil.debug(CheckUtils.getLogMessagePrefix(player, checkType) + msg);
81
        }
82
        tracker.resetResults(); // Reset for now.
83
        // TODO: A real check, e.g. track frequency and/or average amount of violation per so and so time.
84
        return false; // Player can't possibly fail this yet.
85
    }
86
87
}

How it counteracts this module

NCP queues the vertical velocity it applies and consumes it to explain the player's movement: SurvivalFly calls checkUnusedVelocity every move, and the method reads the pos and neg UnusedTracker instances of the SimpleAxisVelocity tracker. UnusedTracker.addValue records a violation amount only when the direction has been blocked since the entry was added, meaning the server pushed the player in a direction they never moved. quickCheckDirection reports the violation count, amount and update count, then resets the results.

In this build the check is a debug ledger that logs through DebugUtil and returns false with a TODO for a real frequency or amount check, so it cannot flag yet. The mechanism it would enforce is the queue model: getOrUseVerticalVelocity consumes queued velocity to explain a vertical move, and a cancelled knockback leaves the velocity unused, which is exactly the violation the tracker accumulates. Standard at 0/0, GrimVelocity's S12 cancel, VulcanVelocity's cancel and every other mode that removes the vertical push would trip the ledger once it is enabled.

The no-packet modes (IntaveVelocity and AACVelocity) would trip it as well, because the queued vertical velocity is never consumed by a matching rise; only modes that preserve the vertical movement keep the ledger clean. The honest status is that NCP's velocity enforcement is unfinished here: the tracker is real and fed on every move, but the verdict path is a TODO, so today the effective NCP counter is the SurvivalFly envelope, not this check.

anticheat VelocityListener (claimed velocity feed)

VelocityListener.java63 lines · Java
1
package ai.idealistic.spartan.listeners.protocol;
2
3
import ai.idealistic.spartan.Register;
4
import ai.idealistic.spartan.abstraction.event.CPlayerVelocityEvent;
5
import ai.idealistic.spartan.abstraction.protocol.PlayerProtocol;
6
import ai.idealistic.spartan.compatibility.necessary.protocollib.BackPlib;
7
import ai.idealistic.spartan.functionality.concurrent.CheckThread;
8
import ai.idealistic.spartan.functionality.server.Config;
9
import ai.idealistic.spartan.functionality.server.PluginBase;
10
import ai.idealistic.spartan.listeners.bukkit.VelocityEvent;
11
import com.comphenix.protocol.PacketType;
12
import com.comphenix.protocol.events.ListenerPriority;
13
import com.comphenix.protocol.events.PacketAdapter;
14
import com.comphenix.protocol.events.PacketContainer;
15
import com.comphenix.protocol.events.PacketEvent;
16
import org.bukkit.entity.Player;
17
import org.bukkit.util.Vector;
18
19
public class VelocityListener extends PacketAdapter {
20
21
22
    public VelocityListener() {
23
        super(
24
                Register.plugin,
25
                ListenerPriority.MONITOR,
26
                PacketType.Play.Server.ENTITY_VELOCITY
27
        );
28
    }
29
30
    @Override
31
    public void onPacketSending(PacketEvent event) {
32
        Player player = event.getPlayer();
33
        PlayerProtocol protocol = PluginBase.getProtocol(player);
34
35
        if (!Config.settings.getBoolean("Important.bedrock_on_protocollib")
36
                && protocol.isBedrockPlayer()) {
37
            return;
38
        }
39
        PacketContainer packet = event.getPacket();
40
41
        if (!packet.getType().equals(PacketType.Play.Server.ENTITY_VELOCITY)) {
42
            return;
43
        }
44
        if (packet.getIntegers().size() >= 4) {
45
            int id = BackPlib.getSafeInt(packet, 0);
46
47
            if (protocol.getEntityId() == id) {
48
                final double x = ((double) BackPlib.getSafeInt(packet, 1)) / 8000.0D;
49
                final double y = ((double) BackPlib.getSafeInt(packet, 2)) / 8000.0D;
50
                final double z = ((double) BackPlib.getSafeInt(packet, 3)) / 8000.0D;
51
                final boolean isCancelled = event.isCancelled();
52
53
                CheckThread.run(protocol, () -> {
54
                    // Now it's safe to use these variables asynchronously
55
                    CPlayerVelocityEvent velocityEvent = new CPlayerVelocityEvent(player, new Vector(x, y, z));
56
                    velocityEvent.setCancelled(isCancelled);
57
                    VelocityEvent.event(velocityEvent, true);
58
                });
59
            }
60
        }
61
    }
62
63
}

How it counteracts this module

Spartan's VelocityListener claims every ENTITY_VELOCITY for the self entity: it reads the three fixed-point components divided by 8000.0 through BackPlib.getSafeInt, builds a CPlayerVelocityEvent, forwards the packet's cancellation state, and dispatches it on the CheckThread through VelocityEvent.event. VelocityEvent stores the claim in claimedVelocity, pushes it onto the claimedVeloGravity and claimedVeloSpeed queues (each capped at two entries) and calls executeRunners, which feeds Spartan's movement checks.

The movement checks compare the reported movement against the claimed vector, with gravity applied on the gravity queue, so a client that cancels the S12 receive-side is still measured against the vector the server sent. The listener records the original packet contents, so client-side scaling (Standard percentages) does not change what Spartan expects; a 50% vertical reduction shows up as a movement deficit against the full claim. GrimVelocity's S12 cancel and VulcanVelocity's cancel produce the same deficit.

The bypass surface is the queue shape and the ground profile: the last two claims only, and no-packet modes that preserve the vertical movement (IntaveVelocity and AACVelocity damping only the horizontal plane) present movement close to the claimed gravity profile, which keeps them under the checks' tolerances. The bukkit-side twin of this listener, VelocityEvent, claims PlayerVelocityEvent the same way, so the two feeds are kept consistent through the packetsEnabled flag in PlayerProtocol.

← Back to Analysis Hub