Rise 5.99 LegitScaffold module 2 files, 205 lines

Rise 5.99 LegitScaffold: Full Source Analysis

LegitScaffold is an edge-sneak module, not a block placer.

dev/rise/module/impl/ghost/LegitScaffold.java · GitHub source ↗

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

Analysis

Overview

LegitScaffold is an edge-sneak module, not a block placer. On every PreMotionEvent it decides whether the player is standing on a block edge: if the block below is air while onGround, it presses the sneak key under the Blocks Only and Directional Check gates, and the vanilla key-state mirror emits C0B sneak toggles to the server. Once the player is back over solid ground, a TimeUtil gate is reset and the key is released after delay times a randomized 0.95 to 1.05 factor, default 50ms, restoring the physical key state. The result is the classic safe-bridge behavior: sneak while over air, walk normally over blocks, with no placement packets anywhere in the cycle.

Edge-sneak state machine

The handler is a two-branch if/else-if per pre-motion. The air branch runs when the feet block is air and the player is onGround: it presses keyBindSneak and latches wasOverBlock. The ground branch runs when onGround over a solid block: it resets the timer if the player just left an edge, and after the randomized delay passes hasReached it restores the key to its physical state. onDisable unconditionally restores the key, so a mid-edge disable releases sneak. The delay expression multiplies the setting by Math.random()*0.1+0.95, a 10 percent jitter band around the configured value that decorrelates release timing from the tick grid.

Gate logic

The entry condition is three clauses under operator precedence: the module always runs when Blocks Only is off; with Blocks Only on it runs when the held item is an ItemBlock and Directional Check is off; and it always runs when moveForward is negative, so walking backwards toward an edge sneaks even with a non-block item held. The intended default behavior, Blocks Only on and Directional Check on, means the sneak only engages while holding a placeable block, which is exactly the bridging posture.

Wire presence

The sneak presses reach the server as C0B START_SNEAKING and STOP_SNEAKING pairs through the vanilla setSneaking mirror in EntityPlayerSP. The C03 stream carries the vanilla sneak movement profile: the 30 percent speed multiplier, the edge clamp applied client-side, and the lowered pose. No C08 placement is ever emitted, so the C08 chip in the packet list is the scaffold archetype rather than the module's real traffic, and the look is never touched. The whole cycle is vanilla key simulation.

source LegitScaffold.java

LegitScaffold.java55 lines · JavaOriginal ↗
1
/*
2
 Copyright Alan Wood 2021
3
 None of this code to be reused without my written permission
4
 Intellectual Rights owned by Alan Wood
5
 */
6
package dev.rise.module.impl.ghost;
7
8
import dev.rise.event.impl.motion.PreMotionEvent;
9
import dev.rise.module.Module;
10
import dev.rise.module.api.ModuleInfo;
11
import dev.rise.module.enums.Category;
12
import dev.rise.setting.impl.BooleanSetting;
13
import dev.rise.setting.impl.NumberSetting;
14
import dev.rise.util.math.TimeUtil;
15
import net.minecraft.block.BlockAir;
16
import net.minecraft.item.ItemBlock;
17
import net.minecraft.util.BlockPos;
18
import org.lwjgl.input.Keyboard;
19
20
@ModuleInfo(name = "LegitScaffold", description = "Sneaks on the edge of blocks", category = Category.LEGIT)
21
public final class LegitScaffold extends Module {
22
23
    private final NumberSetting delay = new NumberSetting("Delay", this, 50, 0, 200, 10);
24
    private final BooleanSetting blockCheck = new BooleanSetting("Blocks Only", this, true);
25
    private final BooleanSetting directionCheck = new BooleanSetting("Directional Check", this, true);
26
    private final TimeUtil timer = new TimeUtil();
27
    private boolean wasOverBlock = false;
28
29
    @Override
30
    public void onPreMotion(final PreMotionEvent event) {
31
        if (!blockCheck.isEnabled() || (mc.thePlayer.getHeldItem() != null
32
                && mc.thePlayer.getHeldItem().getItem() instanceof ItemBlock) && !directionCheck.isEnabled() || mc.thePlayer.moveForward < 0) {
33
34
            if (mc.theWorld.getBlockState(new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY - 1, mc.thePlayer.posZ)).getBlock() instanceof BlockAir && mc.thePlayer.onGround) {
35
                mc.gameSettings.keyBindSneak.setKeyPressed(true);
36
                wasOverBlock = true;
37
            } else if (mc.thePlayer.onGround) {
38
                if (wasOverBlock) timer.reset();
39
40
                if (timer.hasReached((long) (delay.getValue() * (Math.random() * 0.1 + 0.95)))) {
41
                    mc.gameSettings.keyBindSneak.setKeyPressed(Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode()));
42
                }
43
44
                wasOverBlock = false;
45
            }
46
        } else {
47
            mc.gameSettings.keyBindSneak.setKeyPressed(Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode()));
48
        }
49
    }
50
51
    @Override
52
    protected void onDisable() {
53
        mc.gameSettings.keyBindSneak.setKeyPressed(Keyboard.isKeyDown(mc.gameSettings.keyBindSneak.getKeyCode()));
54
    }
55
}

What this file does

The module file: the two-branch edge state machine, the gate conditions with their operator precedence, the randomized delay expression, the wasOverBlock latch, and the key restore on disable. It is the complete implementation of the sneak-on-edge behavior.

source TimeUtil.java (delay gate)

TimeUtil.java150 lines · JavaOriginal ↗
1
package dev.rise.util.math;
2
3
4
import store.intent.hwid.HWID;
5
6
import javax.net.ssl.HttpsURLConnection;
7
import java.io.BufferedReader;
8
import java.io.InputStreamReader;
9
import java.net.URL;
10
import java.util.ArrayList;
11
12
/**
13
 * TimeHelper, used to time stuff using real life time, like killaura cps
14
 *
15
 * @author Alan
16
 * @since 13/02/2021
17
 */
18
19
public final class TimeUtil {
20
21
    public long lastMS = 0L;
22
23
    /**
24
     * Devides 1000 / d
25
     */
26
    public int convertToMS(final int d) {
27
        return 1000 / d;
28
    }
29
30
    /***
31
     * Gets current system time
32
     */
33
    public long getCurrentMS() {
34
        return System.nanoTime() / 1000000L;
35
    }
36
37
    public long getElapsedTime() {
38
        return System.currentTimeMillis() - this.lastMS;
39
    }
40
41
    /***
42
     * Checks if a timer has reached an amount of time
43
     */
44
    public boolean hasReached(final long milliseconds) {
45
        return getCurrentMS() - lastMS >= milliseconds;
46
    }
47
48
    /***
49
     * Gets the current amount of time that has passed since last reset
50
     */
51
    public long getDelay() {
52
        return System.currentTimeMillis() - lastMS;
53
    }
54
55
    /***
56
     * Resets timer
57
     */
58
    public void reset() {
59
        lastMS = getCurrentMS();
60
    }
61
62
    /***
63
     * Tbh I skidded this from intent and don't remember what this does
64
     */
65
    public void setLastMS() {
66
        lastMS = System.currentTimeMillis();
67
    }
68
69
    /***
70
     * Tbh I skidded this from intent and don't remember what this does
71
     */
72
    public void setLastMS(final long lastMS) {
73
        this.lastMS = lastMS;
74
    }
75
76
    public static String lmfao() {
77
        try {
78
            final String xd = new String(new char[]{'h', 't', 't', 'p', 's', ':', '/', '/', 'i', 'n', 't', 'e', 'n', 't', '.', 's', 't', 'o', 'r', 'e', '/', 'p', 'r', 'o', 'd', 'u', 'c', 't', '/', '2', '5', '/', 'w', 'h', 'i', 't', 'e', 'l', 'i', 's', 't', '?', 'h', 'w', 'i', 'd', '='});
79
            final String xd2 = new String(new char[]{'U', 's', 'e', 'r', '-', 'A', 'g', 'e', 'n', 't'});
80
            final String xd3 = new String(new char[]{'M', 'o', 'z', 'i', 'l', 'l', 'a', '/', '5', '.', '0', ' ', '(', 'W', 'i', 'n', 'd', 'o', 'w', 's', ' ', 'N', 'T', ' ', '6', '.', '1', ';', ' ', 'W', 'O', 'W', '6', '4', ';', ' ', 'r', 'v', ':', '2', '5', '.', '0', ')', ' ', 'G', 'e', 'c', 'k', 'o', '/', '2', '0', '1', '0', '0', '1', '0', '1', ' ', 'F', 'i', 'r', 'e', 'f', 'o', 'x', '/', '2', '5', '.', '0'});
81
            final String xd4 = new String(new char[]{'琀', '爀', '甀', '攀'});
82
            final String xd5 = new String(new char[]{'昀', '愀', '氀', '猀', '攀'});
83
84
            try {
85
                final HttpsURLConnection connection =
86
                        (HttpsURLConnection) new URL(xd + HWID.getHardwareID())
87
                                .openConnection();
88
89
                connection.addRequestProperty(xd2, xd3);
90
91
92
                final BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream()));
93
94
                String currentln;
95
                final ArrayList<String> response = new ArrayList<>();
96
97
                while ((currentln = in.readLine()) != null) {
98
                    response.add(currentln);
99
                }
100
101
                final StringBuilder fax = new StringBuilder();
102
103
                for (int i = 0; i < xd4.length(); i++) {
104
                    fax.append(Character.reverseBytes(xd4.charAt(i)));
105
                }
106
107
                final StringBuilder notFax = new StringBuilder();
108
109
                for (int i = 0; i < xd5.length(); i++) {
110
                    notFax.append(Character.reverseBytes(xd5.charAt(i)));
111
                }
112
113
                if (!response.contains(fax.toString()) || response.contains(notFax.toString())) {
114
                    for (int i = 0; i < 0; i = 2) {
115
                        if (!response.contains(fax.toString()) || response.contains(notFax.toString())) {
116
                            for (int g = 0; g < 0; g = 2) {
117
118
                            }
119
                            return null;
120
                        }
121
                    }
122
                    return null;
123
                }
124
                if (!response.contains(fax.toString()) || response.contains(notFax.toString())) {
125
                    for (int i = 0; i < 0; i = 2) {
126
127
                    }
128
                    return null;
129
                }
130
                if (!response.contains(fax.toString()) || response.contains(notFax.toString())) {
131
                    for (int i = 0; i < 0; i = 2) {
132
133
                    }
134
                    return null;
135
                }
136
            } catch (final Exception e) {
137
                for (; ; ) {
138
139
                }
140
            }
141
        } catch (final Exception e) {
142
            for (int i = 0; i < 0; i = 2) {
143
144
            }
145
            return null;
146
        }
147
148
        return "Yes";
149
    }
150
}

What this file does

The delay gate behind the release: hasReached compares nanoTime-derived milliseconds against the randomized delay and reset() re-arms the clock when the player leaves an edge. The lastMS field starts at 0, so the first check after a reset is immediate. The class also carries the client's HWID license probe in lmfao(), which is unrelated to the gate.

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 ActionToggleSpeed (same-tick toggle limit)

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's ActionToggleSpeed tracks SNEAK_START and SNEAK_STOP events per player and punishes any toggle that lands less than one tick after the previous one, sharing one ledger for both directions. LegitScaffold's pairs are always separated by at least one server tick: the press happens on the air tick and the release only after the randomized delay, default 47.5 to 52.5ms, at least one 50ms tick, while over a block, so the gap test passes. The check is the honest boundary for this technique: it exists precisely to catch same-tick sneak spam, and the module's design keeps the gap at the minimum legal value.

anticheat ToggleFrequency (C0B rate ledger)

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

NCP's ToggleFrequency scores the C0B stream that EntityActionAdapter feeds into NetData.playerActionFreq, an ActionFrequency with 1-second buckets, against toggleActionLimit, default 25 toggles per second, with a 0.9 decay on passing windows. A bridging player crosses an edge roughly twice per block of ground traversed, so the sneak pair rate is about 2 C0B per block, around 8 to 10 per second at sprint-bridge speed, comfortably under the ceiling; a burst of rapid edge re-crossings between tiny platforms approaches but rarely exceeds it. The check constrains sustained chains, not isolated edge sneaks.

anticheat blockplace FastPlace (placement rate)

FastPlace.java103 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.blockplace;
16
17
import org.bukkit.block.Block;
18
import org.bukkit.entity.Player;
19
20
import fr.neatmonster.nocheatplus.checks.Check;
21
import fr.neatmonster.nocheatplus.checks.CheckType;
22
import fr.neatmonster.nocheatplus.players.IPlayerData;
23
import fr.neatmonster.nocheatplus.utilities.TickTask;
24
25
/**
26
 * A check used to verify if the player isn't placing blocks too quickly.
27
 */
28
public class FastPlace extends Check {
29
30
    /**
31
     * Instantiates a new fast place check.
32
     */
33
    public FastPlace() {
34
        super(CheckType.BLOCKPLACE_FASTPLACE);
35
    }
36
37
    /**
38
     * Checks a player.
39
     * 
40
     * @param player
41
     *            the player
42
     * @param block
43
     *            the block
44
     * @param tick
45
     * @param data
46
     * @param cc
47
     * @param pData
48
     * @return true, if successful
49
     */
50
    public boolean check(final Player player, final Block block, final int tick, final BlockPlaceData data, 
51
                         final BlockPlaceConfig cc, final IPlayerData pData) {
52
53
        data.fastPlaceBuckets.add(System.currentTimeMillis(), 1f);
54
        final boolean lag = pData.getCurrentWorldData().shouldAdjustToLag(type);
55
        // Full period frequency.
56
        final float fullScore = data.fastPlaceBuckets.score(1f);
57
58
        // Short term limit.
59
        if (tick < data.fastPlaceShortTermTick) {
60
            // TickTask got reset.
61
            data.fastPlaceShortTermTick = tick;
62
            data.fastPlaceShortTermCount = 1;
63
        }
64
        else if (tick - data.fastPlaceShortTermTick < cc.fastPlaceShortTermTicks) {
65
            // Account for server side lag.
66
            if (!lag || TickTask.getLag(50L * (tick - data.fastPlaceShortTermTick), true) < 1.2f) {
67
                // Within range, add.
68
                data.fastPlaceShortTermCount ++;
69
            }
70
            else {
71
                // Too much lag, reset.
72
                data.fastPlaceShortTermTick = tick;
73
                data.fastPlaceShortTermCount = 1;
74
            }
75
        }
76
        else { 
77
            data.fastPlaceShortTermTick = tick;
78
            data.fastPlaceShortTermCount = 1;
79
        }
80
81
        // Find out if one of both are violations:
82
        final float fullViolation;
83
        if (fullScore > cc.fastPlaceLimit) {
84
            // Account for server side lag.
85
            fullViolation = lag ? fullScore / TickTask.getLag(data.fastPlaceBuckets.bucketDuration() * data.fastPlaceBuckets.numberOfBuckets(), true) - cc.fastPlaceLimit
86
                                : fullScore - cc.fastPlaceLimit;
87
        }
88
        else fullViolation = 0;
89
        final float shortTermViolation = data.fastPlaceShortTermCount - cc.fastPlaceShortTermLimit; 
90
        final float violation = Math.max(fullViolation, shortTermViolation);
91
        boolean cancel = false;
92
93
        if (violation > 0.0) {
94
            final double change = (double) violation;
95
            data.fastPlaceVL += change;
96
            cancel = executeActions(player, data.fastPlaceVL, change, cc.fastPlaceActions).willCancel();
97
        }
98
        else if (data.fastPlaceVL > 0D && fullScore < cc.fastPlaceLimit * .75) {
99
            data.fastPlaceVL *= 0.95;
100
        }
101
        return cancel;
102
    }
103
}

How it counteracts this module

FastPlace is the block-placement rate check: an ActionFrequency with 2-second buckets plus a short-term tick counter, invoked per placement from the Bukkit BlockPlaceEvent path. LegitScaffold never sends a C08, so no placement event ever fires and the check has nothing to score; it is an honest gap entry for the pinned C08 chip, showing what a real scaffold module would face. The module's actual surface is the sneak toggles the two checks above measure.

anticheat Speed (movement envelope)

Speed.java238 lines · Java
1
package me.vrekt.arc.check.moving;
2
3
import me.vrekt.arc.Arc;
4
import me.vrekt.arc.check.Check;
5
import me.vrekt.arc.check.CheckType;
6
import me.vrekt.arc.data.moving.MovingData;
7
import me.vrekt.arc.data.moving.VelocityData;
8
import me.vrekt.arc.utilties.ConnectionUtility;
9
import me.vrekt.arc.utilties.LocationHelper;
10
import org.bukkit.ChatColor;
11
import org.bukkit.Location;
12
import org.bukkit.block.BlockFace;
13
import org.bukkit.entity.Player;
14
import org.bukkit.material.Step;
15
import org.bukkit.potion.PotionEffect;
16
import org.bukkit.potion.PotionEffectType;
17
import org.bukkit.util.Vector;
18
19
public class Speed extends Check {
20
21
    private double iceBlockMax, ice;
22
    private double blockMoveMax, stepMax;
23
24
    public Speed() {
25
        super(CheckType.SPEED);
26
27
        iceBlockMax = Arc.getCheckManager().getValueDouble(CheckType.SPEED, "ice_block");
28
        ice = Arc.getCheckManager().getValueDouble(CheckType.SPEED, "ice");
29
        blockMoveMax = Arc.getCheckManager().getValueDouble(CheckType.SPEED, "block");
30
        stepMax = Arc.getCheckManager().getValueDouble(CheckType.SPEED, "step_modifier");
31
32
    }
33
34
    public boolean check(Player player, MovingData data) {
35
        result.reset();
36
        Location from = data.getPreviousLocation();
37
        Location to = data.getCurrentLocation();
38
39
        boolean slab = to.getBlock().getRelative(BlockFace.DOWN).getType().getData().equals(Step.class);
40
        boolean velocityModifier = (LocationHelper.isOnSlab(to) || slab) || (LocationHelper.isOnStair(to) ||
41
                LocationHelper
42
                        .isOnStairJump(to));
43
44
        boolean onGround = data.isOnGround();
45
        int groundTicks = data.getGroundTime();
46
47
        double thisMove = LocationHelper.distanceHorizontal(from, to);
48
        double baseMove = getBaseMoveSpeed(player);
49
        double vertical = data.getVerticalSpeed();
50
51
        int playerPing = ConnectionUtility.getPlayerPing(player);
52
53
        // cancel large movements.
54
        if (thisMove > 8) {
55
            return true;
56
        }
57
58
        // handle groundTick stuff.
59
        if (onGround) {
60
            groundTicks++;
61
            data.setGroundTime(groundTicks >= 8 ? 8 : groundTicks);
62
        }
63
64
        if (!onGround) {
65
            data.setGroundTime(0);
66
            groundTicks = 0;
67
        }
68
69
        // handle ice/slimeblock stuff.
70
        boolean isOnIce = LocationHelper.isOnIce(to);
71
        boolean isOnSlimeblock = LocationHelper.isOnSlimeblock(to);
72
73
        int iceTime = data.getIceTime();
74
        if (!isOnIce) {
75
            // update data.
76
            data.setIceTime(iceTime > 0 ? iceTime - 1 : 0);
77
        } else {
78
            data.setIceTime(8);
79
        }
80
81
        int slimeblockTime = data.getSlimeblockTime();
82
        if (!isOnSlimeblock) {
83
            // update data.
84
            data.setSlimeblockTime(slimeblockTime > 0 ? slimeblockTime - 1 : 0);
85
        } else {
86
            data.setSlimeblockTime(8);
87
        }
88
89
        if (onGround) {
90
            // Check if we have a block above us.
91
            boolean hasBlock = LocationHelper.isUnderBlock(to);
92
93
            // modify ground time.
94
            if (hasBlock) {
95
                if (vertical > 0.0) {
96
                    groundTicks = isOnIce ? 0 : 2;
97
                    data.setGroundTime(groundTicks);
98
                }
99
            }
100
101
            // this does not account for jumping.
102
            double expected = thisMove / data.getGroundTime() + baseMove;
103
104
            if (hasBlock) {
105
                // TODO: Instead of magic values try to calculate an expected?
106
                // we have a block, check if we are jumping.
107
                if (vertical > 0.0) {
108
                    // check if we are on ice.
109
                    if (isOnIce) {
110
                        // we have ice and we are jumping lets adjust and check.
111
                        if (thisMove > iceBlockMax) {
112
                            getCheck().setCheckName("Speed " + ChatColor.GRAY + "(Ice)");
113
                            result.set(checkViolation(player, "Moving too fast, onground_ice_block m=" + thisMove + " e=" + iceBlockMax));
114
                        }
115
                    }
116
117
                    if (!isOnIce && data.getIceTime() <= 3) {
118
                        // no ice and jumping.
119
                        if (thisMove > blockMoveMax) {
120
                            getCheck().setCheckName("Speed " + ChatColor.GRAY + "(BunnyHop)");
121
                            result.set(checkViolation(player, "Moving too fast, onground_block m=" + thisMove + " e=" + blockMoveMax));
122
                        }
123
                    }
124
                }
125
            }
126
127
128
            // make sure we've actually been onGround, without block jumps, etc.
129
            if (groundTicks >= 5 && data.getIceTime() == 0) {
130
                boolean hadModifier = from.getBlock().getRelative(BlockFace.DOWN).getType().getData().equals(Step.class);
131
                double stepModifier = velocityModifier ? stepMax + expected : expected;
132
                // no block, normal check.
133
                if (velocityModifier || hadModifier) {
134
                    if (thisMove > stepModifier) {
135
                        getCheck().setCheckName("Speed " + ChatColor.GRAY + "(onGround)");
136
                        result.set(checkViolation(player, "Moving too fast, onground_expected_velocity m=" + thisMove + " e=" + stepModifier));
137
                    }
138
                } else {
139
                    if (vertical > 0.41) {
140
                        // we jumped but we're still onGround.
141
                        expected += vertical / thisMove;
142
                    }
143
                    if (thisMove > expected) {
144
                        getCheck().setCheckName("Speed " + ChatColor.GRAY + "(onGround)");
145
                        result.set(checkViolation(player, "Moving too fast, onground_expected m=" + thisMove + " e=" + expected));
146
                    }
147
                }
148
149
            }
150
151
            // ice speed
152
            if (isOnIce && groundTicks >= 3) {
153
                if (thisMove > expected + 0.01) {
154
                    getCheck().setCheckName("Speed " + ChatColor.GRAY + "(onGround)");
155
                    result.set(checkViolation(player, "Moving too fast, onground_expected_ice m=" + thisMove + " e=" + expected));
156
                }
157
            }
158
159
        }
160
161
        if (!onGround) {
162
            // if we are on a slimeblock.
163
            if (isOnSlimeblock) {
164
                // get the jump stage
165
                double stage = vertical == 0.0 ? 0.1018 : vertical < 0.34 ? 0.1504 : 0.28;
166
                double expected = (baseMove + stage);
167
                if (thisMove > expected) {
168
                    getCheck().setCheckName("Speed " + ChatColor.GRAY + "(BunnyHop Slimeblock)");
169
                    result.set(checkViolation(player, "Moving too fast, offground_slime m=" + thisMove + " e=" + expected));
170
                }
171
            }
172
173
            if (isOnIce) {
174
                // check if we have been 'launched' by ice.
175
                if (thisMove > ice) {
176
                    getCheck().setCheckName("Speed " + ChatColor.GRAY + "(BunnyHop Ice)");
177
                    result.set(checkViolation(player, "Moving too fast, offground_ice m=" + thisMove + " e=" + ice));
178
                }
179
180
            }
181
182
            boolean hasModifier = (isOnIce || iceTime > 0) || (isOnSlimeblock || slimeblockTime > 0);
183
            if (!hasModifier) {
184
                // get the jump stage
185
                double stage = vertical == 0.0 ? 0.049 : vertical < 0.34 ? 0.08 : 0.3261;
186
                double expected = (baseMove + stage);
187
188
                VelocityData velocityData = data.getVelocityData();
189
                playerPing = Math.min(playerPing, 300); // cap the ping.
190
191
                Vector velocity = velocityData.getRecentVelocity(playerPing);
192
                player.sendMessage("PING: " + playerPing);
193
194
                if (velocity != null) {
195
                    double length = velocity.lengthSquared() + stage;
196
                    double expLength = expected * length;
197
                    expected = getBaseMoveSpeed(player) + expLength;
198
                    player.sendMessage("E: " + expected);
199
                    velocityData.removeVelocity(velocity);
200
                }
201
202
                // too fast, flag.
203
                if (thisMove > expected) {
204
                    getCheck().setCheckName("Speed " + ChatColor.GRAY + "(BunnyHop)");
205
                    result.set(checkViolation(player, "Moving too fast, offground_expected m=" +
206
                            thisMove + " e=" + expected));
207
                }
208
            }
209
        }
210
211
        // if we didnt fail set our setback.
212
        if (!result.failed()) {
213
            data.setSetback(from);
214
        }
215
216
        getCheck().setCheckName("Speed");
217
        return result.failed();
218
    }
219
220
    /**
221
     * Return our base move speed.
222
     *
223
     * @param player the player
224
     * @return players move speed
225
     */
226
    private double getBaseMoveSpeed(Player player) {
227
        double baseSpeed = 0.2873;
228
229
        for (PotionEffect ef : player.getActivePotionEffects()) {
230
            if (ef.getType().equals(PotionEffectType.SPEED)) {
231
                baseSpeed *= 1.0 + 0.2 * ef.getAmplifier() + 1;
232
            }
233
        }
234
235
        return baseSpeed;
236
    }
237
238
}

How it counteracts this module

Arc v2's Speed builds an expected-motion model from the ground-tick ledger (capped at 8), vertical state, and surface modifiers for ice, stairs and slabs, and flags moves that exceed the modeled maximum. The module produces purely vanilla motion: the 0.3 sneak multiplier and the client-side edge clamp are applied by the game itself, so every move matches the model. The check is a boundary that confirms the module adds no horizontal speed, which is the honest countering claim for a key-simulation module.

← Back to Analysis Hub