Spicy InvWalk module 1 files, 76 lines

Spicy InvWalk: Full Source Analysis

Spicy's InvWalk lets the player move while any GUI screen is open.

info/spicyclient/modules/player/InvWalk.java · GitHub source ↗

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

Packets This Module Uses

Analysis

Overview

Spicy's InvWalk lets the player move while any GUI screen is open. On every pre EventUpdate, when mc.currentScreen is non-null and not a chat screen, the module re-asserts the forward, back, left, right and jump keybinds from the raw keyboard state, which vanilla would otherwise ignore while a screen is up. The resulting movement is ordinary C03 traffic produced by the normal movement handler; onDisable clears all six binds including sprint to avoid stuck keys. The module's value is the inventory-walk gameplay itself, and its detection surface is the window-state checks that expect no movement while a container is open.

Architecture

The module body is a single pre EventUpdate branch guarded by mc.currentScreen. When a screen is open and it is not a GuiChat, the five movement binds, forward, back, left, right and jump, are re-asserted from the raw keyboard state via KeyBinding.setKeyBindState(bind.getKeyCode(), Keyboard.isKeyDown(bind.getKeyCode())). The chat exclusion keeps typing in chat from moving the character. onDisable is the cleanup half: for each of the six binds including sprint it clears pressed, but only when the raw key is no longer down or a screen is still open, so a key genuinely held after the module turns off is not stuck.

Key techniques

Vanilla clears the movement input while any GUI is up, so without the module no C03 movement would be produced; with it, held keys keep driving the player through the normal movement handler. The re-assertion runs every tick, so key state changes are picked up within one tick and the player can start and stop moving while the inventory is open. The six-key list on disable is broader than the five-key loop on update, which is why sprint is restored on shutdown but never re-asserted during play: the module cannot sprint-burst from a chest, only walk and jump.

Detection surface

The module constructs nothing itself, but the re-asserted binds make the vanilla movement handler emit the same position-rotation packets it would emit with no screen open, and that is precisely the traffic window-state anticheats check for. The relevant server-side enforcement is window-open movement checking and the toggle and speed bounds on whatever else the player runs at the same time.

source InvWalk.java (module)

InvWalk.java76 lines · JavaOriginal ↗
1
package info.spicyclient.modules.player;
2
3
import org.lwjgl.input.Keyboard;
4
5
import info.spicyclient.events.Event;
6
import info.spicyclient.events.listeners.EventUpdate;
7
import info.spicyclient.modules.Module;
8
import net.minecraft.client.gui.GuiChat;
9
import net.minecraft.client.settings.GameSettings;
10
import net.minecraft.client.settings.KeyBinding;
11
12
public class InvWalk extends Module {
13
14
	public InvWalk() {
15
		super("Inventory Walk", Keyboard.KEY_NONE, Category.PLAYER);
16
		// TODO Auto-generated constructor stub
17
	}
18
	
19
	@Override
20
	public void onDisable() {
21
		
22
		if (!GameSettings.isKeyDown(mc.gameSettings.keyBindForward) || mc.currentScreen != null) {
23
            mc.gameSettings.keyBindForward.pressed = false;
24
        }
25
26
        if (!GameSettings.isKeyDown(mc.gameSettings.keyBindBack) || mc.currentScreen != null) {
27
            mc.gameSettings.keyBindBack.pressed = false;
28
        }
29
30
        if (!GameSettings.isKeyDown(mc.gameSettings.keyBindRight) || mc.currentScreen != null) {
31
            mc.gameSettings.keyBindRight.pressed = false;
32
        }
33
34
        if (!GameSettings.isKeyDown(mc.gameSettings.keyBindLeft) || mc.currentScreen != null) {
35
            mc.gameSettings.keyBindLeft.pressed = false;
36
        }
37
38
        if (!GameSettings.isKeyDown(mc.gameSettings.keyBindJump) || mc.currentScreen != null) {
39
            mc.gameSettings.keyBindJump.pressed = false;
40
        }
41
42
        if (!GameSettings.isKeyDown(mc.gameSettings.keyBindSprint) || mc.currentScreen != null) {
43
            mc.gameSettings.keyBindSprint.pressed = false;
44
        }
45
		
46
	}
47
	
48
	@Override
49
	public void onEvent(Event e) {
50
		
51
		if (e instanceof EventUpdate && e.isPre()) {
52
			
53
			if (mc.currentScreen instanceof GuiChat) {
54
				return;
55
			}
56
			
57
			if (mc.currentScreen != null) {
58
				
59
				KeyBinding[] moveKeys = new KeyBinding[]{
60
    				mc.gameSettings.keyBindForward,
61
    				mc.gameSettings.keyBindBack,
62
    				mc.gameSettings.keyBindLeft,
63
    				mc.gameSettings.keyBindRight,
64
    				mc.gameSettings.keyBindJump					
65
    			};
66
    			for (KeyBinding bind : moveKeys){
67
    				KeyBinding.setKeyBindState(bind.getKeyCode(), Keyboard.isKeyDown(bind.getKeyCode()));
68
    			}
69
    			
70
			}	
71
			
72
		}	
73
		
74
	}
75
	
76
}

What this file does

The module body is one pre EventUpdate branch guarded by mc.currentScreen: when a screen is open and it is not a GuiChat, the five movement binds are re-asserted from the raw keyboard state via KeyBinding.setKeyBindState. Vanilla clears the movement input while any GUI is up, so without the module no C03 movement would be produced; with it, held keys keep driving the player. The chat exclusion keeps typing in chat from moving the character, and the per-tick re-assertion means key state changes take effect within one tick.

onDisable is the cleanup half: for each of the six binds including sprint it clears pressed, but only when the raw key is no longer down or a screen is still open, so a key genuinely held after the module turns off is not stuck. The six-key list on disable is broader than the five-key loop on update, which is why sprint is restored on shutdown but never re-asserted during play: the module cannot sprint-burst from a chest, only walk and jump.

The packet story is the C03 stream. The module itself constructs nothing, but the re-asserted binds make the vanilla movement handler emit the same position-rotation packets it would emit with no screen open, and that is precisely the traffic window-state anticheats check for.

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 InventoryMove (window-open movement)

InventoryMove.java52 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.MovementCheck;
23
import me.islandscout.hawk.event.MoveEvent;
24
25
/*
26
 * InventoryActions check originally written by Havesta; modified, split apart, and implemented into Hawk by Islandscout
27
 *
28
 * InventoryMove checks if a player is
29
 * - rotating, sprinting, or sneaking while inventory is opened
30
 */
31
32
public class InventoryMove extends MovementCheck {
33
34
    public InventoryMove() {
35
        super("inventorymove", true, 3, 5, 0.999, 5000, "%player% failed inventory-move, VL: %vl%", null);
36
    }
37
38
    @Override
39
    protected void check(MoveEvent e) {
40
        HawkPlayer pp = e.getHawkPlayer();
41
42
        //TODO: false flag: rotation is still possible at least 1 tick after opening inventory
43
        //TODO: false flag: you gotta do that TP grace period thing for this too
44
        //TODO: false flag: ESCing out of F6 twitch options while inv is open will cause a desync. Forcibly close inventory on flag to fix desyncs like this?
45
        if((e.isUpdateRot() || pp.isSprinting() || pp.isSneaking()) && pp.hasInventoryOpen() != 0 && !e.isTeleportAccept()) {
46
            punishAndTryRubberband(pp, e);
47
        }
48
        else {
49
            reward(pp);
50
        }
51
    }
52
}

How it counteracts this module

Hawk's InventoryMove is a MovementCheck that flags C03 movement while a container is open. In check(MoveEvent) it punishes through punishAndTryRubberband when the player is sprinting, sneaking, or updating rotation, has an inventory open (pp.hasInventoryOpen() != 0), and the move is not a teleport acceptance; otherwise it rewards. It is registered with 5 punishment VLs and the standard 0.999 reward decay.

InvWalk is a direct target. The module's pre EventUpdate branch runs while mc.currentScreen is non-null, chat excluded, and re-asserts the forward, back, left, right and jump keybinds from the raw keyboard state, so every tick the player spends inside a chest or crafting GUI with movement keys held produces exactly the C03 packets this check exists to catch. The module's key loop does not include sprint, but vanilla movement packets carry rotation, which satisfies the isUpdateRot gate, so plain forward walking with the inventory open still triggers the punish path.

The boundary: Hawk's gate requires sprint, sneak, or a rotation update. A move packet that contains only position with no rotation change while the player is neither sprinting nor sneaking falls through, and the check also exempts teleport-accept moves, so inventory movement that arrives on the confirming packet of a server teleport is not punished. In practice InvWalk users move with WASD, which keeps rotation in the C03 stream, so the gap rarely matters.

anticheat ToggleFrequency (entity-action rate)

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

NoCheatPlus's ToggleFrequency scores C0BPacketEntityAction toggles into NetData.playerActionFreq, an ActionFrequency window. The full-window score, divided by the TickTask lag adjustment, is compared against cc.toggleActionLimit, and the excess becomes a violation that runs the configured toggleFrequency actions, with a 0.9 VL decay on clean ticks. It is the rate bound for sneak and sprint toggles.

InvWalk does not send C0B packets: the module only calls KeyBinding.setKeyBindState on the movement binds, and the sprint key is only cleared in onDisable, never re-asserted while a screen is open. The toggle ledger is therefore untouched by the module itself. The check stays relevant because inventory-walk players commonly run sprint modules alongside, and those re-assert sprint state through C0B; each re-assertion is scored, and sustained toggle spam pushes the window score past the limit.

The boundary: single toggles at human cadence sit well under the limit, and a plain InvWalk user who sends no C0B at all never appears in this check's data. Like the window-state entry, this check bounds the companion modules, not the inventory movement itself.

anticheat Speed (horizontal 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 check measures the reported horizontal delta against a world-derived envelope, with ice, ice-block, block-move and step modifiers and configurable maxima, punishing distances the player's movement mode and potion effects cannot justify. It is the generic horizontal-speed bound for the anticheat.

Inventory walking produces ordinary-speed movement: InvWalk re-asserts the same key states the player would use with no screen open, and the client's motion physics are unchanged, so the reported deltas stay inside the running-speed envelope and the check passes. It appears in this entry list because inventory-walk is frequently combined with speed enhancement, and the moment a speed module runs while the inventory is open, the C03 stream carries deltas past the envelope and Speed flags the session.

The boundary: by itself the module never violates a horizontal-speed check, and no speed check can distinguish an inventory-open move from a normal move by content, because the packets are identical. Detection of inventory walking relies on window-state checks such as Hawk's InventoryMove; Speed only contributes when the player is cheating horizontally on top of it.

← Back to Analysis Hub