Rise 5.99 InvMove module 2 files, 124 lines

Rise 5.99 InvMove: Full Source Analysis

Rise 5.99's InvMove lets the player move while a GUI is open.

dev/rise/module/impl/movement/InvMove.java · GitHub source ↗

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

Packets This Module Uses

Analysis

Overview

Rise 5.99's InvMove lets the player move while a GUI is open. On every PreMotionEvent with a non-chat screen active it writes the real keyboard state into the forward, back, left, right and jump KeyBinding pressed flags, so the vanilla movement pipeline runs while the container is open and the tick's C03 carries nonzero position deltas. A Slow Down setting damps motionX and motionZ while the screen is up, skipped for the client's own ClickGUI and StrikeGUI, and an optional Packet mode rewrites the window-click stream: each C0E click is replaced by a C16 OPEN_INVENTORY_ACHIEVEMENT plus the C0E and a C0D close, while close-window and achievement packets are cancelled, keeping the server-side inventory state consistent with the movement.

Keybind forcing

The handler activates whenever mc.currentScreen is non-null and is not GuiChat. For each of the five affected bindings it calls setKeyPressed(GameSettings.isKeyDown(binding)), which mirrors the physical keyboard state into the pressed flags that the vanilla movement code reads. Because the flags are re-asserted on every pre-motion tick, the vanilla EntityPlayerSP update computes motion from the forced keys exactly as if no GUI were open, and the tick's C03 position packet reflects that motion. The jump binding is included, so the module enables hopping while a chest is open, not just walking.

Slowdown and packet mode

The Slow Down setting multiplies motionX and motionZ by its value (0.1 to 1, default 1) while a screen is up, with ClickGUI and StrikeGUI exempt so the client's own GUI does not damp the player. Packet mode changes the wire behavior of inventory interactions: C0D close-window packets are cancelled, every C0E click is replaced by C16 OPEN_INVENTORY_ACHIEVEMENT followed by the original C0E and a C0D close for the inventory window, and C16 achievement packets are cancelled, all routed through PacketUtil.sendPacketWithoutEvent so the rewrite never re-enters the send event. The net effect is that the server-side window stays open across the click, which matters on servers that tie movement validation to inventory state.

Wire fingerprint

The primary signal is the C03 stream itself: position-changing moves while the server-side inventory window is open. The packet mode adds a secondary fingerprint: one extra C16 OPEN_INVENTORY_ACHIEVEMENT per rewritten click, plus the suppressed C0D and C16 traffic. Vanilla has no way to move under an open container, so any position delta attributed to an open window is anomalous, and the C16 spam is itself observable on the C03 corpus where inventory-open state checks live.

source InvMove.java

InvMove.java81 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.movement;
7
8
import dev.rise.event.impl.motion.PreMotionEvent;
9
import dev.rise.event.impl.packet.PacketSendEvent;
10
import dev.rise.module.Module;
11
import dev.rise.module.api.ModuleInfo;
12
import dev.rise.module.enums.Category;
13
import dev.rise.setting.impl.BooleanSetting;
14
import dev.rise.setting.impl.NumberSetting;
15
import dev.rise.ui.clickgui.impl.ClickGUI;
16
import dev.rise.ui.clickgui.impl.strikeless.StrikeGUI;
17
import dev.rise.util.player.PacketUtil;
18
import net.minecraft.client.gui.GuiChat;
19
import net.minecraft.client.settings.GameSettings;
20
import net.minecraft.client.settings.KeyBinding;
21
import net.minecraft.network.Packet;
22
import net.minecraft.network.play.client.C0DPacketCloseWindow;
23
import net.minecraft.network.play.client.C0EPacketClickWindow;
24
import net.minecraft.network.play.client.C16PacketClientStatus;
25
26
@ModuleInfo(name = "InvMove", description = "Lets you move while in Guis", category = Category.MOVEMENT)
27
public final class InvMove extends Module {
28
29
    private final NumberSetting slowdown = new NumberSetting("Slow Down", this, 1, 0.1, 1, 0.1);
30
    private final BooleanSetting packet = new BooleanSetting("Packet", this, false);
31
32
    private final KeyBinding[] affectedBindings = new KeyBinding[]{
33
            mc.gameSettings.keyBindForward,
34
            mc.gameSettings.keyBindBack,
35
            mc.gameSettings.keyBindRight,
36
            mc.gameSettings.keyBindLeft,
37
            mc.gameSettings.keyBindJump
38
    };
39
40
    @Override
41
    public void onPreMotion(final PreMotionEvent event) {
42
        if (mc.currentScreen != null && !(mc.currentScreen instanceof GuiChat)) {
43
            for (final KeyBinding a : affectedBindings) {
44
                a.setKeyPressed(GameSettings.isKeyDown(a));
45
            }
46
47
            if (mc.currentScreen != null) {
48
                final double s = slowdown.getValue();
49
50
                if (!(mc.currentScreen instanceof ClickGUI || mc.currentScreen instanceof StrikeGUI)) {
51
                    mc.thePlayer.motionX *= s;
52
                    mc.thePlayer.motionZ *= s;
53
                }
54
            }
55
        }
56
    }
57
58
    @Override
59
    public void onPacketSend(final PacketSendEvent event) {
60
        final Packet<?> p = event.getPacket();
61
62
        if (packet.isEnabled()) {
63
            if (p instanceof C0DPacketCloseWindow)
64
                event.setCancelled(true);
65
66
            if (p instanceof C0EPacketClickWindow) {
67
                event.setCancelled(true);
68
69
                PacketUtil.sendPacketWithoutEvent(new C16PacketClientStatus(C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT));
70
                PacketUtil.sendPacketWithoutEvent(event.getPacket());
71
                PacketUtil.sendPacketWithoutEvent(new C0DPacketCloseWindow(mc.thePlayer.inventoryContainer.windowId));
72
            }
73
74
            if (p instanceof C16PacketClientStatus) {
75
                final C16PacketClientStatus packetClientStatus = (C16PacketClientStatus) event.getPacket();
76
                if (packetClientStatus.getStatus() == C16PacketClientStatus.EnumState.OPEN_INVENTORY_ACHIEVEMENT)
77
                    event.setCancelled(true);
78
            }
79
        }
80
    }
81
}

What this file does

The module is entirely this file. The constructor registers Slow Down (1 default, 0.1 to 1) and Packet (false default), and builds the affectedBindings array from the five movement and jump keybindings. onPreMotion is the movement half: it checks for a non-chat screen, re-asserts the pressed flags from the physical keyboard, and applies the slowdown multiplier to the motion fields, exempting the client's own GUIs.

The packet half lives in onPacketSend. With Packet enabled, C0D close-window packets are cancelled outright, each C0E click is replaced by the C16 achievement open plus the click and a C0D close for the inventory window, and C16 achievement packets themselves are cancelled, all sent through PacketUtil.sendPacketWithoutEvent so the replacement traffic bypasses the event bus. With Packet disabled the module only forces keys and dampens motion; no inventory traffic is altered.

source PacketUtil.java (send bypass)

PacketUtil.java43 lines · JavaOriginal ↗
1
package dev.rise.util.player;
2
3
import lombok.experimental.UtilityClass;
4
import net.minecraft.client.Minecraft;
5
import net.minecraft.network.Packet;
6
7
@UtilityClass
8
public final class PacketUtil {
9
    private final Minecraft mc = Minecraft.getMinecraft();
10
11
    public void sendPacket(final Packet<?> packet) {
12
        mc.getNetHandler().addToSendQueue(packet);
13
    }
14
15
    public void sendPacketWithoutEvent(final Packet<?> packet) {
16
        mc.getNetHandler().addToSendQueueWithoutEvent(packet);
17
    }
18
19
    public void receivePacket(final Packet<?> packet) {
20
        mc.getNetHandler().addToReceiveQueue(packet);
21
    }
22
23
    public void receivePacketWithoutEvent(final Packet<?> packet) {
24
        mc.getNetHandler().addToReceiveQueueWithoutEvent(packet);
25
    }
26
    public class TimedPacket {
27
        private final Packet<?> packet;
28
        private final long time;
29
30
        public TimedPacket(final Packet<?> packet, final long time) {
31
            this.packet = packet;
32
            this.time = time;
33
        }
34
35
        public Packet<?> getPacket() {
36
            return packet;
37
        }
38
39
        public long getTime() {
40
            return time;
41
        }
42
    }
43
}

What this file does

PacketUtil is the send utility the packet mode relies on. sendPacketWithoutEvent routes through addToSendQueueWithoutEvent on the fork's NetHandlerPlayClient, which enqueues a packet for the network thread without firing the client's send event, and sendPacket is the normal event-visible path. The distinction is what makes the C16, C0E and C0D replacement sequence safe: a click rewritten through the silent path is not re-intercepted by InvMove's own onPacketSend, so the injected C16 cannot be cancelled by the module's own C16 branch.

The class also carries the TimedPacket holder used by other modules for delayed sends. For this module the two send methods are the whole interface: the silent path carries the rewrite, and the event path would be the only way the injected traffic could loop back into the interception logic.

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 InventoryMoveCheck (open-screen movement)

InventoryMoveCheck.java106 lines · Java
1
package io.github.coolmineman.cheaterdeleter.modules.movement;
2
3
import io.github.coolmineman.cheaterdeleter.events.PlayerMovementListener;
4
import io.github.coolmineman.cheaterdeleter.events.PacketCallback;
5
import io.github.coolmineman.cheaterdeleter.events.PlayerDamageListener;
6
import io.github.coolmineman.cheaterdeleter.modules.CDModule;
7
import io.github.coolmineman.cheaterdeleter.objects.PlayerMoveC2SPacketView;
8
import io.github.coolmineman.cheaterdeleter.objects.entity.CDPlayer;
9
import io.github.coolmineman.cheaterdeleter.util.BlockCollisionUtil;
10
import net.minecraft.entity.damage.DamageSource;
11
import net.minecraft.network.Packet;
12
import net.minecraft.network.listener.ServerPlayPacketListener;
13
import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket;
14
import net.minecraft.util.ActionResult;
15
16
public class InventoryMoveCheck extends CDModule
17
        implements PlayerMovementListener, PacketCallback, PlayerDamageListener {
18
    public InventoryMoveCheck() {
19
        super("inventorymove_check");
20
        PlayerMovementListener.EVENT.register(this);
21
        PacketCallback.EVENT.register(this);
22
        PlayerDamageListener.EVENT.register(this);
23
    }
24
25
    @Override
26
    public long getFlagCoolDownMs() {
27
        return 100;
28
    }
29
30
    @Override
31
    public void onMovement(CDPlayer player, PlayerMoveC2SPacketView packet, MoveCause cause) {
32
        if (
33
            !enabledFor(player) ||
34
            player.isFallFlying() ||
35
            player.isSpectator() ||
36
            BlockCollisionUtil.isNearby(player, 2, 4, BlockCollisionUtil.NON_SOLID_COLLISION)
37
        ) {
38
            return;
39
        }
40
        InventoryMoveCheckData data = player.getOrCreateData(InventoryMoveCheckData.class, InventoryMoveCheckData::new);
41
        if (packet.isChangePosition() && player.getCurrentScreenHandler() != null) {
42
            if (!data.wasOpen) {
43
                data.wasOpen = true;
44
                data.openTime = System.currentTimeMillis();
45
            }
46
            if (invalidateMove(player, packet)) {
47
                flag(player, FlagSeverity.MINOR, "Inventory Move");
48
            }
49
        } else if (player.getCurrentScreenHandler() == null) {
50
            data.lastDeltaX = Double.MAX_VALUE;
51
            data.lastDeltaZ = Double.MAX_VALUE;
52
            data.wasOpen = false;
53
        }
54
    }
55
56
    private boolean invalidateMove(CDPlayer player, PlayerMoveC2SPacketView packet) {
57
        InventoryMoveCheckData data = player.getOrCreateData(InventoryMoveCheckData.class, InventoryMoveCheckData::new);
58
        if (System.currentTimeMillis() - data.openTime < 500)
59
            return false;
60
        if (player.getVelocity().getY() < 0.0 && packet.getY() > player.getPacketY())
61
            return true;
62
        double delaX = Math.abs(packet.getX() - player.getPacketX());
63
        double delaZ = Math.abs(packet.getZ() - player.getPacketZ());
64
        if (player.getVelocity().getX() == 0.0 && delaX > 0.0 && delaX > data.lastDeltaX)
65
            return true;
66
        if (player.getVelocity().getX() != 0.0) {
67
            data.lastDeltaX = Double.MAX_VALUE;
68
        } else {
69
            data.lastDeltaX = delaX;
70
        }
71
        if (player.getVelocity().getZ() == 0.0 && delaZ > 0.0 && delaZ > data.lastDeltaZ)
72
            return true;
73
        if (player.getVelocity().getZ() != 0.0) {
74
            data.lastDeltaZ = Double.MAX_VALUE;
75
        } else {
76
            data.lastDeltaZ = delaZ;
77
        }
78
        return false;
79
    }
80
81
    public static class InventoryMoveCheckData {
82
        volatile double lastDeltaX = Double.MAX_VALUE;
83
        volatile double lastDeltaZ = Double.MAX_VALUE;
84
        volatile boolean wasOpen = false;
85
        volatile long openTime = 0;
86
    }
87
88
    @Override
89
    public ActionResult onPacket(CDPlayer player, Packet<ServerPlayPacketListener> packet) {
90
        if (packet instanceof CloseHandledScreenC2SPacket) {
91
            InventoryMoveCheckData data = player.getOrCreateData(InventoryMoveCheckData.class,
92
                    InventoryMoveCheckData::new);
93
            data.wasOpen = false;
94
        }
95
        return ActionResult.PASS;
96
    }
97
98
    @Override
99
    public void onPlayerDamage(CDPlayer player, DamageSource source, float amount) {
100
        InventoryMoveCheckData data = player.getOrCreateData(InventoryMoveCheckData.class, InventoryMoveCheckData::new);
101
        data.lastDeltaX = Double.MAX_VALUE;
102
        data.lastDeltaZ = Double.MAX_VALUE;
103
        data.openTime = System.currentTimeMillis() + 1000;
104
    }
105
    
106
}

How it counteracts this module

CheaterDeleter's InventoryMoveCheck is a modern-version port (1.16+ C2S packet views) that watches for position-changing moves while a screen handler is open. onMovement returns early for fall flying, spectators and players near non-solid collision, then, when the packet changes position and the current screen handler is non-null, it flags 'Inventory Move' at MINOR severity with a 100ms cooldown. The invalidateMove helper grants a 500ms grace after the screen opens, then flags growing horizontal deltas on any axis where the server-side velocity is exactly zero, plus an upward move while the server velocity is falling.

Rise's module at the default Slow Down of 1 is a direct hit: full-speed motion under an open container produces per-tick deltas that grow past the previous delta with zero server-side velocity, so the check flags within a few ticks of the grace expiring. The Slow Down setting is the honest bypass surface: damped motion makes each delta smaller than the last, which defeats the growing-delta test, and a close-window packet resets the check's wasOpen state, which the module's packet mode suppresses on purpose. The y-axis branch also catches the forced jump key when the server velocity is falling.

anticheat InventoryMove (leniency-window movement)

InventoryMove.java190 lines · Java
1
package de.photon.anticheataddition.modules.checks.inventory;
2
3
import de.photon.anticheataddition.AntiCheatAddition;
4
import de.photon.anticheataddition.modules.ViolationModule;
5
import de.photon.anticheataddition.user.User;
6
import de.photon.anticheataddition.user.data.TimeKey;
7
import de.photon.anticheataddition.util.datastructure.SetUtil;
8
import de.photon.anticheataddition.util.log.Log;
9
import de.photon.anticheataddition.util.mathematics.TimeUtil;
10
import de.photon.anticheataddition.util.minecraft.ping.PingProvider;
11
import de.photon.anticheataddition.util.minecraft.world.WorldUtil;
12
import de.photon.anticheataddition.util.minecraft.world.entity.EntityUtil;
13
import de.photon.anticheataddition.util.minecraft.world.entity.InternalPotion;
14
import de.photon.anticheataddition.util.minecraft.world.material.MaterialUtil;
15
import de.photon.anticheataddition.util.violationlevels.Flag;
16
import de.photon.anticheataddition.util.violationlevels.ViolationLevelManagement;
17
import de.photon.anticheataddition.util.violationlevels.ViolationManagement;
18
import org.bukkit.Bukkit;
19
import org.bukkit.Location;
20
import org.bukkit.Material;
21
import org.bukkit.block.Block;
22
import org.bukkit.block.BlockFace;
23
import org.bukkit.event.EventHandler;
24
import org.bukkit.event.EventPriority;
25
import org.bukkit.event.Listener;
26
import org.bukkit.event.player.PlayerMoveEvent;
27
import org.bukkit.event.player.PlayerTeleportEvent;
28
import org.bukkit.potion.PotionEffect;
29
30
import java.util.Set;
31
import java.util.stream.Stream;
32
33
public final class InventoryMove extends ViolationModule implements Listener
34
{
35
    // 300 is the vanilla breaking time without a speed effect (derived from testing, especially slab jumping)
36
    public static final long BASE_BREAKING_TIME = 300L;
37
38
39
    // The materials below a player that allow a player to jump while having an open inventory.
40
    private static final Set<Material> JUMP_ENABLING_MATERIALS = Stream.of(MaterialUtil.INSTANCE.getAutoStepMaterials(),
41
                                                                           MaterialUtil.INSTANCE.getBounceMaterials())
42
                                                                       .flatMap(Set::stream)
43
                                                                       .collect(SetUtil.toImmutableEnumSet());
44
45
    public static final InventoryMove INSTANCE = new InventoryMove();
46
    public static final double STANDING_STILL_THRESHOLD = 0.005;
47
    private final int cancelVl = loadInt(".cancel_vl", 60);
48
    private final boolean extremePingLeniency = loadBoolean(".extreme_ping_leniency", false);
49
50
    private InventoryMove()
51
    {
52
        super("Inventory.parts.Move");
53
    }
54
55
    private static void cancelAction(User user, PlayerMoveEvent event)
56
    {
57
        // Not many blocks moved to prevent exploits and world change problems.
58
        if (WorldUtil.INSTANCE.inSameWorld(event.getFrom(), event.getTo()) && event.getFrom().distanceSquared(event.getTo()) < 4) {
59
            // Teleport back the next tick.
60
            Bukkit.getScheduler().runTask(AntiCheatAddition.getInstance(), () -> user.getPlayer().teleport(event.getFrom(), PlayerTeleportEvent.TeleportCause.UNKNOWN));
61
        }
62
    }
63
64
    private static long breakingTime(User user)
65
    {
66
        return BASE_BREAKING_TIME + InternalPotion.SPEED.getPotionEffect(user.getPlayer())
67
                                                        .map(PotionEffect::getAmplifier)
68
                                                        // If a speed effect exists calculate the speed millis, otherwise the speedMillis are 0.
69
                                                        .map(amplifier -> TimeUtil.toMillis(Math.max(100, amplifier + 1)))
70
                                                        .orElse(0L);
71
    }
72
73
    @EventHandler(priority = EventPriority.LOWEST)
74
    public void onPlayerMove(PlayerMoveEvent event)
75
    {
76
        final var user = User.getUser(event.getPlayer());
77
        if (User.isUserInvalid(user, this) || event.getTo() == null ||
78
            // Check that the player has actually moved.
79
            // Do this here to prevent bypasses with setting allowedToJump to true
80
            event.getTo().distanceSquared(event.getFrom()) <= STANDING_STILL_THRESHOLD) return;
81
82
        // Not inside a vehicle
83
        if (user.getPlayer().isInsideVehicle() ||
84
            // Not flying (vanilla or elytra) as it may trigger some fps
85
            user.getPlayer().isFlying() ||
86
            EntityUtil.INSTANCE.isFlyingWithElytra(user.getPlayer()) ||
87
            // Player must not be in an inventory
88
            !user.hasOpenInventory() ||
89
            // After being hit a player moves due to knock-back, so recent hits can cause false positives.
90
            user.getPlayer().getNoDamageTicks() != 0 ||
91
            // Recent teleports can cause bugs
92
            Inventory.teleportOrWorldChangeBypassed(user) ||
93
            // The player is currently not in a liquid (liquids push)
94
            // This would need to check for async chunk loads if done in packets (see history)
95
            user.isInLiquids() ||
96
            // Auto-Disable if TPS are too low
97
            !Inventory.hasMinTPS()) {
98
            user.getData().bool.allowedToJump = true;
99
            return;
100
        }
101
102
        final boolean movingUpwards = event.getFrom().getY() < event.getTo().getY();
103
        final boolean noYMovement = event.getFrom().getY() == event.getTo().getY();
104
105
        // Player accelerated upwards.
106
        if (movingUpwards && !user.getData().bool.movingUpwards) {
107
            handleJump(user, event);
108
            return;
109
        }
110
111
        final double yMovement = event.getPlayer().getVelocity().getY();
112
113
        Log.finer(() -> "Inventory-Debug | Player " + user.getPlayer().getName() + " checking for falling: " + user.getTimeMap().at(TimeKey.VELOCITY_CHANGE_NO_EXTERNAL_CAUSES).passedTime() + " | y-velocity: " + yMovement);
114
115
        // This bypasses players during a long fall from hundreds of blocks.
116
        if (yMovement < -2.0 ||
117
            // Bypass a falling player after a normal jump in which they opened an inventory.
118
            // If the y-movement is 0, the falling process is finished and there is no need for bypassing anymore.
119
            (user.hasJumpedRecently(1850) && !noYMovement)) {
120
            user.getTimeMap().at(TimeKey.INVENTORY_MOVE_JUMP_END).update();
121
            return;
122
        }
123
124
        Log.finer(() -> "Inventory-Debug | Player " + user.getPlayer().getName() + " is not fall-bypassed with y-movement: " + yMovement);
125
126
        final long leniency = extremePingLeniency ? Math.min(PingProvider.INSTANCE.getPing(user.getPlayer()) / 2, 500) : 0;
127
        final long totalBreakingTime = breakingTime(user) + leniency;
128
129
        Log.finer(() -> "Inventory-Debug | Player " + user.getPlayer().getName() + " breaking time: " + totalBreakingTime + " (leniency: " + leniency + ")" +
130
                        " | inventory open passed time: " + user.getTimeMap().at(TimeKey.INVENTORY_OPENED).passedTime() +
131
                        " | jump end passed time: " + user.getTimeMap().at(TimeKey.INVENTORY_MOVE_JUMP_END).passedTime());
132
133
        // The breaking is no longer affecting the user as they have opened their inventory long enough ago.
134
        if (user.notRecentlyOpenedInventory(totalBreakingTime) &&
135
            // If the player jumped, we need to check the breaking time after the jump ended.
136
            user.getTimeMap().at(TimeKey.INVENTORY_MOVE_JUMP_END).notRecentlyUpdated(totalBreakingTime) &&
137
            // Do the entity pushing stuff here (performance impact)
138
            // No nearby entities that could push the player
139
            WorldUtil.INSTANCE.getLivingEntitiesAroundEntity(user.getPlayer(), user.getHitboxLocation().hitbox(), 0.1D).isEmpty()) {
140
            getManagement().flag(Flag.of(user)
141
                                     .setAddedVl(5)
142
                                     .setCancelAction(cancelVl, () -> cancelAction(user, event))
143
                                     .setDebug(() -> "Inventory-Debug | Player: " + user.getPlayer().getName() + " moved while having an open inventory."));
144
        }
145
    }
146
147
    private void handleJump(User user, PlayerMoveEvent event)
148
    {
149
        Log.finer(() -> "Inventory-Debug | Player " + user.getPlayer().getName() + " detected a jump.");
150
151
        // A player is only allowed to jump once.
152
        if (user.getData().bool.allowedToJump) {
153
            user.getData().bool.allowedToJump = false;
154
            return;
155
        }
156
157
        Log.finer(() -> "Inventory-Debug | Player " + user.getPlayer().getName() + " is not jump-bypassed.");
158
159
        // Bouncing can lead to false positives.
160
        if (playerCanJumpDueToGroundMaterial(event.getFrom())) return;
161
162
        Log.finer(() -> "Inventory-Debug | Player " + user.getPlayer().getName() + " no jump enabling materials detected.");
163
164
        getManagement().flag(Flag.of(user)
165
                                 .setAddedVl(25)
166
                                 .setCancelAction(cancelVl, () -> cancelAction(user, event))
167
                                 .setDebug(() -> "Inventory-Debug | Player: " + user.getPlayer().getName() + " jumped while having an open inventory."));
168
    }
169
170
    /**
171
     * This checks all 9 blocks centered on where the player stands as well as the 9 blocks below to reliably check for materials like slabs.
172
     * Checking all those blocks is required because stepping up a slab does not mean the player's block-location is already the slab.
173
     */
174
    private static boolean playerCanJumpDueToGroundMaterial(Location location)
175
    {
176
        return Stream.concat(WorldUtil.INSTANCE.getBlocksAround(location.getBlock(), WorldUtil.HORIZONTAL_FACES, Set.of()).stream(),
177
                             WorldUtil.INSTANCE.getBlocksAround(location.getBlock().getRelative(BlockFace.DOWN), WorldUtil.HORIZONTAL_FACES, Set.of()).stream())
178
                     .map(Block::getType)
179
                     .anyMatch(InventoryMove.JUMP_ENABLING_MATERIALS::contains);
180
    }
181
182
    @Override
183
    protected ViolationManagement createViolationManagement()
184
    {
185
        return ViolationLevelManagement.builder(this)
186
                                       .emptyThresholdManagement()
187
                                       .withDecay(100, 2).build();
188
    }
189
}

How it counteracts this module

Photon's InventoryMove runs on PlayerMoveEvent with a 0.005 squared-distance gate and a long list of bypasses: vehicles, flying, elytra, liquids, recent damage ticks, recent teleports and low TPS all disable it for the move. Movement past the breaking-time leniency (300ms base plus the speed potion bonus, with an optional ping half) flags at 5 VL with a cancel teleport back to the move origin at 60 VL. A separate jump branch flags upward acceleration at 25 VL, once per open, with slabs and bounce materials exempt.

Rise's module at default slowdown moves continuously under the inventory, so every move after the 300ms leniency adds 5 VL and the 60 VL cancel lands after roughly twelve seconds of sustained movement; the packet mode does not change this because the check is event-driven off the position stream, not the window packets. The forced jump key is the sharper hit: the module can hop under a chest, and the jump branch flags at 25 VL whenever the open state has not already consumed the once-per-open allowance. Damped slowdown still moves, so it only stretches the time to the cancel threshold, it does not evade the check.

anticheat InventoryMoveProtocol (score-accumulated alerts)

InventoryMoveProtocol.java136 lines · Java
1
package com.elikill58.negativity.spigot.protocols;
2
3
import org.bukkit.Material;
4
import org.bukkit.entity.Player;
5
import org.bukkit.event.EventHandler;
6
import org.bukkit.event.Listener;
7
import org.bukkit.event.inventory.InventoryClickEvent;
8
import org.bukkit.event.inventory.InventoryCloseEvent;
9
import org.bukkit.event.inventory.InventoryOpenEvent;
10
import org.bukkit.event.inventory.InventoryType.SlotType;
11
import org.bukkit.event.player.PlayerMoveEvent;
12
13
import com.elikill58.negativity.spigot.SpigotNegativity;
14
import com.elikill58.negativity.spigot.SpigotNegativityPlayer;
15
import com.elikill58.negativity.spigot.blocks.SpigotLocation;
16
import com.elikill58.negativity.spigot.utils.LocationUtils;
17
import com.elikill58.negativity.universal.Cheat;
18
import com.elikill58.negativity.universal.CheatKeys;
19
import com.elikill58.negativity.universal.ReportType;
20
import com.elikill58.negativity.universal.adapter.Adapter;
21
import com.elikill58.negativity.universal.utils.UniversalUtils;
22
23
public class InventoryMoveProtocol extends Cheat implements Listener {
24
25
	public InventoryMoveProtocol() {
26
		super(CheatKeys.INVENTORY_MOVE, false, Material.NETHER_STAR, CheatCategory.MOVEMENT, true, "invmove");
27
	}
28
29
	@EventHandler
30
	public void onMove(PlayerMoveEvent e) {
31
		Player p = e.getPlayer();
32
		SpigotNegativityPlayer np = SpigotNegativityPlayer.getNegativityPlayer(p);
33
		if (!np.hasDetectionActive(this) || np.isUsingTrident() || np.hasElytra() || p.isInsideVehicle() || p.getFallDistance() > 0.5 || np.inventoryMoveData == null
34
				|| LocationUtils.isInWater(new SpigotLocation(p.getLocation())) || p.getVelocity().length() > 0.1 || !np.inventoryMoveData.active || LocationUtils.hasMaterialsAround(new SpigotLocation(e.getFrom()), "PISTON")) {
35
			Adapter.getAdapter().debug("Velocity length: " + p.getVelocity().length());
36
			return;
37
		}
38
		if (p.getOpenInventory() == null) {
39
			np.inventoryMoveData = null;
40
			Adapter.getAdapter().debug("No opened inventory but data always running ?");
41
			return;
42
		}
43
		InventoryMoveData data = np.inventoryMoveData;
44
		int amount = 0;
45
		if (p.isSprinting())
46
			amount += data.sprint ? 1 : 5; // means it started sprinting since inv open
47
		if (p.isSneaking())
48
			amount += data.sneak ? 1 : 5; // means it started sneaking since inv open
49
50
		double distance = e.getFrom().distance(e.getTo());
51
		double distanceXZ = LocationUtils.distanceXZ(e.getFrom(), e.getTo());
52
		if (distanceXZ >= data.distanceXZ && distanceXZ >= p.getWalkSpeed()) // if running at least at the same
53
			amount += (data.distanceXZ - distanceXZ) + 1; // +1 to always have alert
54
55
		if (distance >= data.distance && distance >= p.getWalkSpeed() && p.getFallDistance() < 0.5) // fall "allow" to make the distance goes brr
56
			amount += (data.distanceXZ - distanceXZ) + 1 - p.getFallDistance();
57
		if (data.timeSinceOpen > 2)
58
			Adapter.getAdapter().debug("Time: " + data.timeSinceOpen + ", amount: " + amount);
59
		if (data.timeSinceOpen >= 3 && amount > 2) {
60
			SpigotNegativity.alertMod(ReportType.WARNING, p, this, UniversalUtils.parseInPorcent(80 + data.timeSinceOpen),
61
					"Sprint: " + p.isSprinting() + ", Sneak: " + p.isSneaking() + ", data: " + data + ", vel: " + p.getVelocity() + ", fd: " + String.format("%.5f", p.getFallDistance()),
62
					(CheatHover) null, amount);
63
		}
64
		data.update(distance, distanceXZ);
65
	}
66
67
	@EventHandler
68
	public void onClick(InventoryClickEvent e) {
69
		if (!(e.getWhoClicked() instanceof Player) || e.getClickedInventory() == null || !e.getSlotType().equals(SlotType.CONTAINER) || e.isCancelled())
70
			return;
71
		SpigotNegativityPlayer np = SpigotNegativityPlayer.getNegativityPlayer((Player) e.getWhoClicked());
72
		if (!np.hasDetectionActive(this))
73
			return;
74
		checkInvMove(np, (Player) e.getWhoClicked(), "Click");
75
	}
76
77
	@EventHandler
78
	public void onOpen(InventoryOpenEvent e) {
79
		if (!(e.getPlayer() instanceof Player) || e.isCancelled())
80
			return;
81
		SpigotNegativityPlayer np = SpigotNegativityPlayer.getNegativityPlayer((Player) e.getPlayer());
82
		if (!np.hasDetectionActive(this))
83
			return;
84
		checkInvMove(np, (Player) e.getPlayer(), "Open");
85
	}
86
87
	@EventHandler
88
	public void onClose(InventoryCloseEvent e) {
89
		if (e.getPlayer() instanceof Player)
90
			SpigotNegativityPlayer.getNegativityPlayer((Player) e.getPlayer()).inventoryMoveData.reset((Player) e.getPlayer());
91
	}
92
93
	private void checkInvMove(SpigotNegativityPlayer np, Player p, String from) {
94
		if (np.hasElytra() || p.isInsideVehicle() || p.getLocation().getBlock().getType().name().contains("WATER"))
95
			return;
96
		np.inventoryMoveData.active = true;
97
	}
98
99
	@Override
100
	public boolean isBlockedInFight() {
101
		return true;
102
	}
103
104
	public static class InventoryMoveData {
105
106
		public Player p;
107
		public double distance = 0, distanceXZ = 0;
108
		public int timeSinceOpen = 0;
109
		public boolean sprint, sneak, active;
110
111
		public InventoryMoveData() {
112
			reset(null);
113
		}
114
115
		public void update(double distance, double distanceXZ) {
116
			this.distance = distance;
117
			this.distanceXZ = distanceXZ;
118
			this.timeSinceOpen++;
119
		}
120
121
		public void reset(Player p) {
122
			this.sprint = p == null ? false : p.isSprinting();
123
			this.sneak = p == null ? false : p.isSneaking();
124
			this.active = false;
125
			this.distance = 0;
126
			this.distanceXZ = 0;
127
			this.timeSinceOpen = 0;
128
		}
129
130
		@Override
131
		public String toString() {
132
			return "InventoryMoveData{sprint=" + sprint + ",sneak=" + sneak + ",distance=" + String.format("%.3f", distance) + ",distanceXZ=" + String.format("%.3f", distance) + ",time="
133
					+ timeSinceOpen + "}";
134
		}
135
	}
136
}

How it counteracts this module

Negativity's InventoryMoveProtocol alerts on PlayerMoveEvent when an inventory is open. It requires an open inventory view, no trident, elytra, vehicle, water or piston nearby, fall distance under 0.5, and server-side velocity under 0.1, then scores the move: starting to sprint or sneak since the inventory opened adds 5 each, and a horizontal distance at least as large as the previous move and at least the walk speed adds the delta difference plus 1. An alert fires when the time since open reaches 3 ticks and the score exceeds 2.

Rise's module at default slowdown walks at full speed under the container, so the distance gate is met every tick and the score stays above 2 from the third tick on; the sprint key also works under the forced bindings, which adds the sprint-transition 5. The Slow Down setting is the designed bypass: damped motion falls below the walk-speed gate once the decay takes hold, and the velocity filter means knockback-assisted movement is not scored. The module's packet mode does not affect this check, which keys off the Bukkit position event rather than the window stream.

anticheat InventoryMove (sprint-sneak-rotation under GUI)

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 over the MoveEvent stream: it punishes when the move carries a rotation update, sprinting or sneaking while an inventory is open (hasInventoryOpen() != 0) and the move is not a teleport accept, with VL 3 per violation, a rubberband punishment, 0.999 decay and a 5-second timeout. The check comments note the known grace edges: rotation can legitimately persist one tick after opening, and teleport grace is handled by the teleport-accept flag.

Rise's module triggers the sprinting branch whenever the player holds the sprint key under a forced keybind state, because the vanilla sprint logic runs under the GUI once the bindings are pressed, and the rotation branch fires if the player looks around while the container is open. The check does not measure distance, so the Slow Down setting is irrelevant to it; any sprinting, sneaking or look rotation under an open inventory accumulates VL. The packet mode's C16 and C0D traffic is invisible to this check, which reads the movement event only.

← Back to Analysis Hub