LiquidSense Dev AutoFish module 2 files, 310 lines

LiquidSense Dev AutoFish: Full Source Analysis

LiquidSense Dev's AutoFish automates the cast-and-reel cycle of a fishing rod from an UpdateEvent handler.

net/ccbluex/liquidbounce/features/module/modules/player/AutoFish.kt · GitHub source ↗

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

Analysis

Overview

LiquidSense Dev's AutoFish automates the cast-and-reel cycle of a fishing rod from an UpdateEvent handler. It requires an ItemFishingRod in hand, casts whenever a 500ms rodOutTimer has elapsed and no bobber entity exists, and reels the instant the bobber enters the sink state that marks a bite (motionX and motionZ zero while motionY is non-zero). The action for both directions is a single mc.rightClickMouse() call, which routes through the vanilla PlayerControllerMP.sendUseItem path and reaches the wire as a C08 use-item packet with facing 255; the server-side ItemFishingRod.onItemRightClick handler then either spawns the bobber or retracts it. The module's wire fingerprint is at most one or two C08 packets per second with a fishing rod held, which is indistinguishable from a fast human angler, and it never touches C02 or any other packet class.

Bite detection

The condition that triggers a reel is the bobber's local motion state: mc.thePlayer.fishEntity.motionX == 0.0 and motionZ == 0.0 while motionY != 0.0. That is the client-side sink animation the server produces when a fish bites: the hook stops drifting horizontally and drops, and a human player reacts by right-clicking within a few hundred milliseconds. The module evaluates the same state on the next UpdateEvent, so its reaction latency is a single tick from the moment the sink is visible, versus the roughly 100-300ms plus human error of a manual reel. The casting half uses the complementary condition: no fishEntity at all, gated by rodOutTimer.hasTimePassed(500L), so after a catch or a broken line the rod is re-cast no sooner than 500ms later.

Cast and reel wire path

Both the cast and the reel are plain right-clicks: the module calls mc.rightClickMouse(), the fork's MixinMinecraft injects into that method right after the vanilla rightClickDelayTimer field is set, and the vanilla body runs PlayerControllerMP.sendUseItem, which serializes a C08PacketPlayerBlockPlacement with a null-origin position and facing 255, the use-item form. On the server, ItemFishingRod.onItemRightClick branches on the player's fishEntity: with a bobber out it calls handleHookRetraction and damages the rod, otherwise it plays the cast sound and spawns a new EntityFishHook. The reel is therefore another C08 use, not a C07 RELEASE_USE_ITEM, and the bobber is never the target of a C02 use-entity packet; a fishing session produces zero entity-interaction traffic, which is why the brief's C02 chip is covered in prose only. The vanilla rightClickDelayTimer gate (set to 4 after each use) would cap programmatic re-casts even if the 500ms timer were removed.

Timing profile and detection surface

The module's only observable difference from a manual angler is the same-tick reel response and the exact 500ms cast cadence, both of which live in the client's timing, not in any packet property. The server sees one C08 use-item with a fishing rod every few seconds, well inside every item-use rate window, and the rod itself is a legitimate held item, so no content-based check can separate the module from a fast human. The countering entries below are therefore honest gaps: each check has a mechanism that would catch item-use automation, and each one structurally cannot see this pattern, which is the accurate statement for a module whose entire advantage is reaction time.

source AutoFish.kt

AutoFish.kt31 lines · JavaOriginal ↗
1
/*
2
 * LiquidBounce Hacked Client
3
 * A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
4
 * https://github.com/CCBlueX/LiquidBounce/
5
 */
6
package net.ccbluex.liquidbounce.features.module.modules.player
7
8
import net.ccbluex.liquidbounce.event.EventTarget
9
import net.ccbluex.liquidbounce.event.UpdateEvent
10
import net.ccbluex.liquidbounce.features.module.Module
11
import net.ccbluex.liquidbounce.features.module.ModuleCategory
12
import net.ccbluex.liquidbounce.features.module.ModuleInfo
13
import net.ccbluex.liquidbounce.utils.timer.MSTimer
14
import net.minecraft.item.ItemFishingRod
15
16
@ModuleInfo(name = "AutoFish", description = "Automatically catches fish when using a rod.", category = ModuleCategory.PLAYER)
17
class AutoFish : Module() {
18
19
    private val rodOutTimer = MSTimer()
20
21
    @EventTarget
22
    fun onUpdate(event: UpdateEvent) {
23
        if (mc.thePlayer.heldItem == null || mc.thePlayer.heldItem.item !is ItemFishingRod)
24
            return
25
26
        if (rodOutTimer.hasTimePassed(500L) && mc.thePlayer.fishEntity == null || (mc.thePlayer.fishEntity != null && mc.thePlayer.fishEntity.motionX == 0.0 && mc.thePlayer.fishEntity.motionZ == 0.0 && mc.thePlayer.fishEntity.motionY != 0.0)) {
27
            mc.rightClickMouse()
28
            rodOutTimer.reset()
29
        }
30
    }
31
}

What this file does

The module file is the whole mechanism. onUpdate checks the held item, evaluates the 500ms rodOutTimer gate against the bobber state, and calls mc.rightClickMouse() plus rodOutTimer.reset() when a cast or a reel is due. The rodOutTimer is an MSTimer whose hasTimePassed compares System.currentTimeMillis() against the last reset plus the delay, and its initial time of -1 makes the first check pass immediately, so with a rod already held the module casts on the first tick after enable. The file imports only ItemFishingRod and MSTimer, which confirms the cast and reel are deliberately routed through the vanilla right-click path rather than raw packet sends.

source MixinMinecraft.java (right-click injection point)

MixinMinecraft.java279 lines · JavaOriginal ↗
1
/*
2
 * LiquidBounce Hacked Client
3
 * A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
4
 * https://github.com/CCBlueX/LiquidBounce/
5
 */
6
package net.ccbluex.liquidbounce.injection.forge.mixins.client;
7
8
import net.ccbluex.liquidbounce.LiquidBounce;
9
import net.ccbluex.liquidbounce.event.*;
10
import net.ccbluex.liquidbounce.features.module.modules.combat.AutoClicker;
11
import net.ccbluex.liquidbounce.features.module.modules.exploit.AbortBreaking;
12
import net.ccbluex.liquidbounce.features.module.modules.world.ChestStealer;
13
import net.ccbluex.liquidbounce.features.module.modules.world.FastPlace;
14
import net.ccbluex.liquidbounce.ui.client.GuiMainMenu;
15
import net.ccbluex.liquidbounce.ui.client.GuiUpdate;
16
import net.ccbluex.liquidbounce.ui.client.GuiWelcome;
17
import net.ccbluex.liquidbounce.utils.CPSCounter;
18
import net.ccbluex.liquidbounce.utils.render.IconUtils;
19
import net.ccbluex.liquidbounce.utils.render.RenderUtils;
20
import net.minecraft.block.material.Material;
21
import net.minecraft.client.Minecraft;
22
import net.minecraft.client.entity.EntityPlayerSP;
23
import net.minecraft.client.gui.GuiGameOver;
24
import net.minecraft.client.gui.GuiScreen;
25
import net.minecraft.client.gui.ScaledResolution;
26
import net.minecraft.client.gui.inventory.GuiChest;
27
import net.minecraft.client.multiplayer.PlayerControllerMP;
28
import net.minecraft.client.multiplayer.WorldClient;
29
import net.minecraft.client.particle.EffectRenderer;
30
import net.minecraft.client.settings.GameSettings;
31
import net.minecraft.client.settings.KeyBinding;
32
import net.minecraft.util.BlockPos;
33
import net.minecraft.util.MouseHelper;
34
import net.minecraft.util.MovingObjectPosition;
35
import net.minecraft.util.Util;
36
import net.minecraftforge.client.event.GuiOpenEvent;
37
import net.minecraftforge.common.MinecraftForge;
38
import net.minecraftforge.fml.relauncher.Side;
39
import net.minecraftforge.fml.relauncher.SideOnly;
40
import org.lwjgl.Sys;
41
import org.lwjgl.input.Keyboard;
42
import org.lwjgl.opengl.Display;
43
import org.spongepowered.asm.mixin.Mixin;
44
import org.spongepowered.asm.mixin.Overwrite;
45
import org.spongepowered.asm.mixin.Shadow;
46
import org.spongepowered.asm.mixin.injection.At;
47
import org.spongepowered.asm.mixin.injection.Inject;
48
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
49
50
import java.nio.ByteBuffer;
51
import java.util.Arrays;
52
53
@Mixin(Minecraft.class)
54
@SideOnly(Side.CLIENT)
55
public abstract class MixinMinecraft {
56
57
    @Shadow
58
    public GuiScreen currentScreen;
59
60
    @Shadow
61
    public boolean skipRenderWorld;
62
63
64
    @Shadow
65
    private int leftClickCounter;
66
67
    @Shadow
68
    public MovingObjectPosition objectMouseOver;
69
70
    @Shadow
71
    public WorldClient theWorld;
72
73
    @Shadow
74
    public EntityPlayerSP thePlayer;
75
76
    @Shadow
77
    public EffectRenderer effectRenderer;
78
79
    @Shadow
80
    public PlayerControllerMP playerController;
81
82
    @Shadow
83
    public int displayWidth;
84
85
    @Shadow
86
    public int displayHeight;
87
88
    @Shadow
89
    public int rightClickDelayTimer;
90
91
    @Shadow
92
    public GameSettings gameSettings;
93
94
    @Shadow
95
    public boolean inGameHasFocus;
96
97
    /*
98
    @Shadow
99
    public abstract void setIngameNotInFocus();
100
101
     */
102
103
    @Shadow
104
    public MouseHelper mouseHelper;
105
106
    @Shadow
107
    public abstract void setIngameFocus();
108
109
    @Overwrite
110
    public void setIngameNotInFocus() {
111
        if (this.inGameHasFocus) {
112
            KeyBinding.unPressAllKeys();
113
            this.inGameHasFocus = false;
114
            this.mouseHelper.ungrabMouseCursor();
115
        }
116
117
118
    }
119
120
    @Inject(method = "run", at = @At("HEAD"))
121
    private void init(CallbackInfo callbackInfo) {
122
        if(displayWidth < 1067)
123
            displayWidth = 1067;
124
125
        if(displayHeight < 622)
126
            displayHeight = 622;
127
    }
128
129
    @Inject(method = "startGame", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;checkGLError(Ljava/lang/String;)V", ordinal = 2, shift = At.Shift.AFTER))
130
    private void startGame(CallbackInfo callbackInfo) {
131
        LiquidBounce.INSTANCE.startClient();
132
    }
133
134
    @Inject(method = "startGame", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;displayGuiScreen(Lnet/minecraft/client/gui/GuiScreen;)V", shift = At.Shift.AFTER))
135
    private void afterMainScreen(CallbackInfo callbackInfo) {
136
          //Minecraft.getMinecraft().displayGuiScreen(new GuiWelcome());
137
//        else if (LiquidBounce.INSTANCE.getLatestVersion() > LiquidBounce.CLIENT_VERSION - (LiquidBounce.IN_DEV ? 1 : 0))
138
//            Minecraft.getMinecraft().displayGuiScreen(new GuiUpdate());
139
    }
140
141
    @Inject(method = "createDisplay", at = @At(value = "INVOKE", target = "Lorg/lwjgl/opengl/Display;setTitle(Ljava/lang/String;)V", shift = At.Shift.AFTER))
142
    private void createDisplay(CallbackInfo callbackInfo) {
143
        Display.setTitle(LiquidBounce.CLIENT_NAME + " | " + LiquidBounce.CLIENT_VERSION + " | " + "By AquaVit" + " | " + LiquidBounce.MINECRAFT_VERSION + " | Injection...");
144
    }
145
146
    @Inject(method = "displayGuiScreen", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;currentScreen:Lnet/minecraft/client/gui/GuiScreen;", shift = At.Shift.AFTER))
147
    private void displayGuiScreen(CallbackInfo callbackInfo) {
148
        if(currentScreen instanceof net.minecraft.client.gui.GuiMainMenu || (currentScreen != null && currentScreen.getClass().getName().startsWith("net.labymod") && currentScreen.getClass().getSimpleName().equals("ModGuiMainMenu"))) {
149
            currentScreen = new GuiMainMenu();
150
151
            ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
152
            currentScreen.setWorldAndResolution(Minecraft.getMinecraft(), scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight());
153
            skipRenderWorld = false;
154
        }
155
156
        LiquidBounce.eventManager.callEvent(new ScreenEvent(currentScreen));
157
    }
158
159
    private long lastFrame = getTime();
160
161
    @Inject(method = "runGameLoop", at = @At("HEAD"))
162
    private void runGameLoop(final CallbackInfo callbackInfo) {
163
        final long currentTime = getTime();
164
        final int deltaTime = (int) (currentTime - lastFrame);
165
        lastFrame = currentTime;
166
167
        RenderUtils.deltaTime = deltaTime;
168
    }
169
170
    public long getTime() {
171
        return (Sys.getTime() * 1000) / Sys.getTimerResolution();
172
    }
173
174
    @Inject(method = "runTick", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;joinPlayerCounter:I", shift = At.Shift.BEFORE))
175
    private void onTick(final CallbackInfo callbackInfo) {
176
        LiquidBounce.eventManager.callEvent(new TickEvent());
177
    }
178
179
    @Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/Minecraft;dispatchKeypresses()V", shift = At.Shift.AFTER))
180
    private void onKey(CallbackInfo callbackInfo) {
181
        if(Keyboard.getEventKeyState() && currentScreen == null)
182
            LiquidBounce.eventManager.callEvent(new KeyEvent(Keyboard.getEventKey() == 0 ? Keyboard.getEventCharacter() + 256 : Keyboard.getEventKey()));
183
    }
184
185
    @Inject(method = "sendClickBlockToController", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/MovingObjectPosition;getBlockPos()Lnet/minecraft/util/BlockPos;"))
186
    private void onClickBlock(CallbackInfo callbackInfo) {
187
        if(this.leftClickCounter == 0 && theWorld.getBlockState(objectMouseOver.getBlockPos()).getBlock().getMaterial() != Material.air) {
188
            LiquidBounce.eventManager.callEvent(new ClickBlockEvent(objectMouseOver.getBlockPos(), this.objectMouseOver.sideHit));
189
        }
190
    }
191
192
    @Inject(method = "setWindowIcon", at = @At("HEAD"), cancellable = true)
193
    private void setWindowIcon(CallbackInfo callbackInfo) {
194
        if(Util.getOSType() != Util.EnumOS.OSX) {
195
            final ByteBuffer[] liquidBounceFavicon = IconUtils.getFavicon();
196
            if(liquidBounceFavicon != null) {
197
198
                Display.setIcon(liquidBounceFavicon);
199
                callbackInfo.cancel();
200
            }
201
        }
202
    }
203
204
    @Inject(method = "shutdown", at = @At("HEAD"))
205
    private void shutdown(CallbackInfo callbackInfo) {
206
        try{
207
            LiquidBounce.INSTANCE.stopClient();
208
        }catch (Exception e){
209
            System.exit(0);
210
        }
211
    }
212
213
    @Inject(method = "clickMouse", at = @At("HEAD"))
214
    private void clickMouse(CallbackInfo callbackInfo) {
215
216
        CPSCounter.registerClick(CPSCounter.MouseButton.LEFT);
217
218
        if (LiquidBounce.moduleManager.getModule(AutoClicker.class).getState())
219
            leftClickCounter = 0;
220
    }
221
222
    @Inject(method = "middleClickMouse", at = @At("HEAD"))
223
    private void middleClickMouse(CallbackInfo ci) {
224
        CPSCounter.registerClick(CPSCounter.MouseButton.MIDDLE);
225
    }
226
227
228
    @Inject(method = "rightClickMouse", at = @At(value = "FIELD", target = "Lnet/minecraft/client/Minecraft;rightClickDelayTimer:I", shift = At.Shift.AFTER))
229
    private void rightClickMouse(final CallbackInfo callbackInfo) {
230
        CPSCounter.registerClick(CPSCounter.MouseButton.RIGHT);
231
232
        final FastPlace fastPlace = (FastPlace) LiquidBounce.moduleManager.getModule(FastPlace.class);
233
234
        if (fastPlace.getState())
235
            rightClickDelayTimer = fastPlace.getSpeedValue().get();
236
    }
237
238
    @Inject(method = "loadWorld(Lnet/minecraft/client/multiplayer/WorldClient;Ljava/lang/String;)V", at = @At("HEAD"))
239
    private void loadWorld(WorldClient p_loadWorld_1_, String p_loadWorld_2_, final CallbackInfo callbackInfo) {
240
        LiquidBounce.eventManager.callEvent(new WorldEvent(p_loadWorld_1_));
241
    }
242
243
    /**
244
     * @author CCBlueX
245
     */
246
    @Overwrite
247
    private void sendClickBlockToController(boolean leftClick) {
248
        if(!leftClick)
249
            this.leftClickCounter = 0;
250
251
        if (this.leftClickCounter <= 0 && (!this.thePlayer.isUsingItem())) {
252
            if(leftClick && this.objectMouseOver != null && this.objectMouseOver.typeOfHit == MovingObjectPosition.MovingObjectType.BLOCK) {
253
                BlockPos blockPos = this.objectMouseOver.getBlockPos();
254
255
                if(this.leftClickCounter == 0)
256
                    LiquidBounce.eventManager.callEvent(new ClickBlockEvent(blockPos, this.objectMouseOver.sideHit));
257
258
259
                if(this.theWorld.getBlockState(blockPos).getBlock().getMaterial() != Material.air && this.playerController.onPlayerDamageBlock(blockPos, this.objectMouseOver.sideHit)) {
260
                    this.effectRenderer.addBlockHitEffects(blockPos, this.objectMouseOver.sideHit);
261
                    this.thePlayer.swingItem();
262
                }
263
            } else if (!LiquidBounce.moduleManager.getModule(AbortBreaking.class).getState()) {
264
                this.playerController.resetBlockRemoving();
265
            }
266
267
268
269
        }
270
    }
271
272
    /**
273
     * @author
274
     */
275
    @Overwrite
276
    public int getLimitFramerate() {
277
        return this.theWorld == null && this.currentScreen != null ? 60 : this.gameSettings.limitFramerate;
278
    }
279
}

What this file does

The mixin defines the fork's relationship to the vanilla right-click path. The rightClickMouse injection fires after the rightClickDelayTimer field is written in the vanilla method, which is the hook the click-speed modules use to zero the delay; AutoFish does not use that hook, but every rightClickMouse() the module calls passes through this injected method, so the mixin is the fork-level context in which the module's C08 uses are emitted. The file also injects into clickMouse, sendClickBlockToController and runTick, giving the surrounding event dispatch context. The LiquidSense Dev snapshot has no net/minecraft tree, so this mixin is the closest verifiable carrier of the module's wire path.

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 UseItemAdapter (use-item and release ledger)

UseItemAdapter.java438 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.protocollib;
16
17
import java.util.Arrays;
18
import java.util.LinkedList;
19
import java.util.List;
20
21
import org.bukkit.GameMode;
22
import org.bukkit.Material;
23
import org.bukkit.entity.HumanEntity;
24
import org.bukkit.entity.Player;
25
import org.bukkit.event.Event;
26
import org.bukkit.event.EventHandler;
27
import org.bukkit.event.EventPriority;
28
import org.bukkit.event.block.Action;
29
import org.bukkit.event.entity.PlayerDeathEvent;
30
import org.bukkit.event.inventory.InventoryOpenEvent;
31
import org.bukkit.event.player.PlayerInteractEvent;
32
import org.bukkit.event.player.PlayerItemConsumeEvent;
33
import org.bukkit.event.player.PlayerItemHeldEvent;
34
import org.bukkit.event.player.PlayerRespawnEvent;
35
import org.bukkit.event.player.PlayerRiptideEvent;
36
import org.bukkit.inventory.EquipmentSlot;
37
import org.bukkit.inventory.ItemStack;
38
import org.bukkit.inventory.meta.CrossbowMeta;
39
import org.bukkit.plugin.Plugin;
40
41
import com.comphenix.protocol.PacketType;
42
import com.comphenix.protocol.events.ListenerPriority;
43
import com.comphenix.protocol.events.PacketContainer;
44
import com.comphenix.protocol.events.PacketEvent;
45
import com.comphenix.protocol.reflect.StructureModifier;
46
import com.comphenix.protocol.wrappers.EnumWrappers.PlayerDigType;
47
48
import fr.neatmonster.nocheatplus.NCPAPIProvider;
49
import fr.neatmonster.nocheatplus.checks.combined.CombinedData;
50
import fr.neatmonster.nocheatplus.checks.moving.MovingConfig;
51
import fr.neatmonster.nocheatplus.checks.moving.MovingData;
52
import fr.neatmonster.nocheatplus.compat.Bridge1_13;
53
import fr.neatmonster.nocheatplus.compat.Bridge1_9;
54
import fr.neatmonster.nocheatplus.compat.bukkit.BridgeEnchant;
55
import fr.neatmonster.nocheatplus.compat.bukkit.BridgeMaterial;
56
import fr.neatmonster.nocheatplus.compat.BridgeMisc;
57
import fr.neatmonster.nocheatplus.compat.versions.ClientVersion;
58
import fr.neatmonster.nocheatplus.compat.versions.ServerVersion;
59
import fr.neatmonster.nocheatplus.components.NoCheatPlusAPI;
60
import fr.neatmonster.nocheatplus.components.registry.order.RegistrationOrder.RegisterMethodWithOrder;
61
import fr.neatmonster.nocheatplus.event.mini.MiniListener;
62
import fr.neatmonster.nocheatplus.logging.StaticLog;
63
import fr.neatmonster.nocheatplus.players.DataManager;
64
import fr.neatmonster.nocheatplus.players.IPlayerData;
65
import fr.neatmonster.nocheatplus.utilities.entity.InventoryUtil;
66
import fr.neatmonster.nocheatplus.utilities.map.BlockProperties;
67
import fr.neatmonster.nocheatplus.utilities.map.MaterialUtil;
68
69
/**
70
 * <p>Adapter for listening to packets and Bukkit events relevant to item use.</p>
71
 *
72
 * On versions 1.17 and above, the adapter will only register events related to a specific item-use exploit, 
73
 * as Bukkit provides the {@link HumanEntity#getItemInUse()} method.<br>
74
 *
75
 * <p>On versions 1.12 and above, up to 1.17, all listeners will be registered because Bukkit does not offer a way to 
76
 * determine <em>which</em> item is in use; we can only detect if a player is using an item through {@link HumanEntity#isHandRaised()}.</p>
77
 *
78
 * The {@link PlayerRespawnEvent} is always listened to in order to fix a specific item desynchronization issue.
79
 */
80
public class UseItemAdapter extends BaseAdapter {
81
    
82
    private final static String dftag = "system.nocheatplus.useitemadapter";
83
        
84
    // All relevant Bukkit events for item-use.
85
    private final static MiniListener<?>[] miniListeners = new MiniListener<?>[] {
86
        new MiniListener<PlayerItemConsumeEvent>() {
87
            @EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
88
            @RegisterMethodWithOrder(tag = dftag)
89
            @Override
90
            public void onEvent(final PlayerItemConsumeEvent event) {
91
                onItemConsume(event);
92
            }
93
        },
94
        new MiniListener<PlayerInteractEvent>() {
95
            @EventHandler(priority = EventPriority.MONITOR)
96
            @RegisterMethodWithOrder(tag = dftag)
97
            @Override
98
            public void onEvent(final PlayerInteractEvent event) {
99
                onItemInteract(event);
100
            }
101
        },
102
        new MiniListener<InventoryOpenEvent>() {
103
            @EventHandler(priority = EventPriority.LOWEST)
104
            @RegisterMethodWithOrder(tag = dftag)
105
            @Override
106
            public void onEvent(final InventoryOpenEvent event) {
107
                onInventoryOpen(event);
108
            }
109
        },
110
        new MiniListener<PlayerDeathEvent>() {
111
            @EventHandler(priority = EventPriority.MONITOR)
112
            @RegisterMethodWithOrder(tag = dftag)
113
            @Override
114
            public void onEvent(final PlayerDeathEvent event) {
115
                onDeath(event);
116
            }
117
        },
118
        new MiniListener<PlayerItemHeldEvent>() {
119
            @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
120
            @RegisterMethodWithOrder(tag = dftag)
121
            @Override
122
            public void onEvent(final PlayerItemHeldEvent event) {
123
                onChangeSlot(event);
124
            }
125
        },
126
    };
127
128
    private static int timeBetweenRL = 70;
129
130
    private static PacketType[] initPacketTypes() {
131
        // Only interested in these two packets.
132
        final List<PacketType> types = new LinkedList<PacketType>(Arrays.asList(PacketType.Play.Client.BLOCK_DIG, PacketType.Play.Client.BLOCK_PLACE));
133
        return types.toArray(new PacketType[types.size()]);
134
    }
135
136
    public UseItemAdapter(Plugin plugin) {
137
        super(plugin, ListenerPriority.MONITOR, initPacketTypes());
138
        final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
139
        if (!BridgeMisc.hasGetItemInUseMethod()) {
140
            // getItemInUse() isn't there, register all events
141
            if (Bridge1_13.hasPlayerRiptideEvent()) {
142
                // Only register this one if available.
143
                final MiniListener<?> riptideListener = new MiniListener<PlayerRiptideEvent>() {
144
                    @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
145
                    @RegisterMethodWithOrder(tag = dftag)
146
                    @Override
147
                    public void onEvent(final PlayerRiptideEvent event) {
148
                        onTridentRelease(event);
149
                   }
150
                };
151
                api.addComponent(riptideListener, false);
152
            }
153
            // ...All the other listeners
154
            for (final MiniListener<?> listener : miniListeners) {
155
                api.addComponent(listener, false);
156
            }
157
        }
158
        // Always register this event, because it is used to fix an MC/Bukkit glitch, not for item-use setting.
159
        final MiniListener<?> respawningListener = new MiniListener<PlayerRespawnEvent>() {
160
            @EventHandler(priority = EventPriority.MONITOR)
161
            @RegisterMethodWithOrder(tag = dftag)
162
            @Override
163
            public void onEvent(final PlayerRespawnEvent event) {
164
                onRespawning(event);
165
            }
166
        };
167
        api.addComponent(respawningListener, false);
168
    }
169
170
    @Override
171
    public void onPacketReceiving(final PacketEvent event) {
172
        // Fast return tests first.
173
        try {
174
            if (event.isPlayerTemporary()) return;
175
        } 
176
        catch (NoSuchMethodError e) {
177
            if (event.getPlayer() == null) {
178
                counters.add(ProtocolLibComponent.idNullPlayer, 1);
179
                return;
180
            }
181
            if (DataManager.getPlayerDataSafe(event.getPlayer()) == null) {
182
                StaticLog.logWarning("Failed to fetch player data with " + event.getPacketType() + " for: " + event.getPlayer().toString());
183
                return;
184
            }
185
        }
186
        if (BridgeMisc.hasGetItemInUseMethod()) {
187
            // getItemInUse() is already there. Only check the digging packet for exploitation prevention purposes.
188
            if (event.getPacketType().equals(PacketType.Play.Client.BLOCK_DIG)) {
189
                handleDiggingPacket(event);
190
            }
191
            // Don't need to do anything else.
192
            return;
193
        }
194
        
195
        // getItemInUse() ins't there: do the ordinary stuff.
196
        if (event.getPacketType().equals(PacketType.Play.Client.BLOCK_DIG)) {
197
            handleDiggingPacket(event);
198
        }
199
        else handleBlockPlacePacket(event);
200
    }
201
    
202
    /** Attempt to fix server-side-only blocking after respawn. */
203
    private static void onRespawning(final PlayerRespawnEvent e) {
204
        final IPlayerData pData = DataManager.getPlayerData(e.getPlayer());
205
        // Patch up issues on Bukkit's (Minecraft's ?) side (item has been reset already on death).
206
        if (Bridge1_9.hasGetItemInOffHand() && e.getPlayer().isBlocking()) {
207
            pData.requestItemUseResync();
208
        }
209
    }
210
211
    private static void onTridentRelease(final PlayerRiptideEvent e) {
212
        final IPlayerData pData = DataManager.getPlayerData(e.getPlayer());
213
        // This event is called on releasing the trident (See ItemTrident.java), so the item is not in use anymore.
214
        pData.setItemInUse(null);
215
    }
216
217
    private static void onItemConsume(final PlayerItemConsumeEvent e) {
218
        final Player p = e.getPlayer();
219
        final IPlayerData pData = DataManager.getPlayerData(p);
220
        // Consume(d) (!!), so the player isn't using the item anymore
221
        pData.setItemInUse(null);   
222
    }
223
224
    private static void onInventoryOpen(final InventoryOpenEvent e) {
225
        if (e.isCancelled()) return;
226
        final Player p = (Player) e.getPlayer();
227
        final IPlayerData pData = DataManager.getPlayerData(p);
228
        // Can't use item with an inventory open.
229
        pData.setItemInUse(null);
230
    }
231
232
    private static void onDeath(final PlayerDeathEvent e) {
233
        final IPlayerData pData = DataManager.getPlayerData((Player) e.getEntity());
234
        // Can't use item if dead
235
        pData.setItemInUse(null);  
236
    }
237
238
    @SuppressWarnings("deprecation")
239
	private static void onItemInteract(final PlayerInteractEvent e) {
240
        if (e.getAction() != Action.RIGHT_CLICK_AIR && e.getAction() != Action.RIGHT_CLICK_BLOCK) {
241
            return;
242
        }
243
        final Player p = e.getPlayer();
244
        final IPlayerData pData = DataManager.getPlayerData(p);
245
        final MovingConfig mCC = pData.getGenericInstance(MovingConfig.class);
246
        final CombinedData data = pData.getGenericInstance(CombinedData.class);
247
        data.offHandUse = false;
248
        if (!data.mightUseItem) {
249
            // Player did not send the block-placement packet, so they are for sure not using anything, return.
250
            return;
251
        }
252
        // Do reset the flag at the start (!)
253
        data.mightUseItem = false;
254
255
        if (e.useItemInHand().equals(Event.Result.DENY)) {
256
            // A plugin denied the item-use.
257
            return;
258
        }
259
260
        if (p.getGameMode() == GameMode.CREATIVE) {
261
            // TODO: If merging SurvivalFly and CreativeFly, creative mode needs to be taken into consideration as well.
262
            pData.setItemInUse(null);
263
            return;
264
        }
265
        
266
        // Proceed to check...
267
        if (e.hasItem()) {
268
            final ItemStack item = e.getItem();
269
            final Material m = item.getType();
270
            if (Bridge1_9.hasElytra() && p.hasCooldown(m)) {
271
                // Item is in cooldown so it cannot be used.
272
                return;
273
            }
274
            
275
            // Edible / consumable items...
276
            if (InventoryUtil.isConsumable(item)) {
277
                if (!Bridge1_9.hasElytra() && item.getDurability() > 16384) {
278
                    // pre1.9 splash potion edge case.
279
                    return;
280
                }
281
                if (m == Material.POTION || m == Material.MILK_BUCKET || m.toString().endsWith("_APPLE") || m.name().startsWith("HONEY_BOTTLE")) {
282
                    // Can be consumed regardless of hunger level
283
                    pData.setItemInUse(m);
284
                    data.offHandUse = Bridge1_9.hasGetItemInOffHand() && e.getHand() == EquipmentSlot.OFF_HAND;
285
                    return;
286
                }
287
                if (item.getType().isEdible() && p.getFoodLevel() < 20) {
288
                    // Hunger level dependant consumables.
289
                    pData.setItemInUse(m); 
290
                    data.offHandUse = Bridge1_9.hasGetItemInOffHand() && e.getHand() == EquipmentSlot.OFF_HAND;
291
                    return;
292
                }
293
            }
294
            // Bows...
295
            if (m == Material.BOW && InventoryUtil.hasArrow(p.getInventory(), false)) {
296
                pData.setItemInUse(m);
297
                data.offHandUse = Bridge1_9.hasGetItemInOffHand() && e.getHand() == EquipmentSlot.OFF_HAND;
298
                return;
299
            }
300
            // Shields and swords (legacy)... Bukkit takes care here, but set anyway.
301
            if (ServerVersion.isAtLeast("1.9") && pData.getClientVersion().isAtLeast(ClientVersion.V_1_9)) {
302
                // Both server and client are on a version that support shield (thus, sword-blocking is not possible)
303
            	if (m == Material.SHIELD) {
304
            	    pData.setItemInUse(m);
305
                    data.offHandUse = e.getHand() == EquipmentSlot.OFF_HAND;
306
                    return;
307
            	}
308
            }
309
            else if (MaterialUtil.isSword(m) && (ServerVersion.isLowerThan("1.9") || pData.getClientVersion().isAtMost(ClientVersion.V_1_8))) {
310
            	// Legacy server. Or legacy client on a modern server. Blocking is done with swords in both cases.
311
            	pData.setItemInUse(m);
312
            	// (Off hand doesn't exist)
313
            	return;
314
            }
315
            
316
            // Crosswbows...
317
            if (m.toString().equals("CROSSBOW")) {
318
                if (!((CrossbowMeta) item.getItemMeta()).hasChargedProjectiles() && InventoryUtil.hasArrow(p.getInventory(), true)) {
319
                    pData.setItemInUse(m);
320
                    data.offHandUse = e.getHand() == EquipmentSlot.OFF_HAND;
321
                }
322
            }
323
            // Tridents (1.13)... 
324
            if (m == BridgeMaterial.TRIDENT && item.getDurability() < m.getMaxDurability() - 1 && pData.getClientVersion().isAtLeast(ClientVersion.V_1_13)
325
            	&& (
326
                    // 1: If the trident has riptide enchant, it can only be used in rain or water 
327
            		BridgeEnchant.getRiptideLevel(p) > 0.0
328
                    && (
329
                        // 2: In water
330
                        BlockProperties.isInWater(p, p.getLocation(), mCC.yOnGround)
331
                        // 2: Always check raining first, since canSeeSky is a much more expensive call. Needs optimization.
332
                        || p.getLocation().getWorld().hasStorm() && BlockProperties.canSeeSky(p, p.getLocation(), mCC.yOnGround) 
333
                    ) 
334
                    // 1: Otherwise, the trident can be used and thrown anywhere
335
                    || BridgeEnchant.getRiptideLevel(p) <= 0.0
336
                )) {
337
                pData.setItemInUse(m);
338
                data.offHandUse = e.getHand() == EquipmentSlot.OFF_HAND;
339
                return;
340
            }
341
            // Spyglass (1.17)...
342
            if (BridgeMisc.hasIsFrozen() && m == Material.SPYGLASS) {
343
                pData.setItemInUse(m);
344
                data.offHandUse = e.getHand() == EquipmentSlot.OFF_HAND;
345
                return;
346
            }
347
            // Lastly, goat horns (1.19)...
348
            if (m.toString().equals("GOAT_HORN")) {
349
                pData.setItemInUse(m);
350
                data.offHandUse = e.getHand() == EquipmentSlot.OFF_HAND;
351
                return;
352
            }
353
            // 1.21.11: Spears...
354
            if (MaterialUtil.isSpear(m)) {
355
                pData.setItemInUse(m);
356
                data.offHandUse = e.getHand() == EquipmentSlot.OFF_HAND;
357
            }
358
        } 
359
        else {
360
            // No item in hands, no deal.
361
            pData.setItemInUse(null);  
362
        }
363
    }
364
    
365
    // NOTE: Bukkit takes care of invalid slot values (< 0 or > 8. PlayerConnection.java), so we don't need to check for this as well.
366
    private static void onChangeSlot(final PlayerItemHeldEvent e) {
367
        final Player p = e.getPlayer();
368
        final IPlayerData pData = DataManager.getPlayerData(p);
369
        // Switching a slot, so the item use status is reset.
370
        final MovingData mData = pData.getGenericInstance(MovingData.class);
371
        final CombinedData cData = pData.getGenericInstance(CombinedData.class);
372
        if (e.getPreviousSlot() != e.getNewSlot()) {
373
            /*if ((pData.getItemInUse() != null || p.isBlocking()) && mData.playerMoves.getCurrentMove() != null) {
374
                p.getInventory().setHeldItemSlot(e.getPreviousSlot());
375
                cData.invalidItemUse = true;
376
            }*/
377
            // To avoid any more potential bypasses, let Minecraft forcibly release the item.
378
            pData.requestItemUseResync();
379
        }
380
    }
381
382
    private void handleBlockPlacePacket(PacketEvent event) {
383
        final Player p = event.getPlayer();
384
        final IPlayerData pData = DataManager.getPlayerData(p);
385
        final CombinedData data = pData.getGenericInstance(CombinedData.class);
386
        final PacketContainer packet = event.getPacket();
387
        final StructureModifier<Integer> ints = packet.getIntegers();
388
        // Legacy: pre 1.9
389
        if (ints.size() > 0 && !ServerVersion.isAtLeast("1.9")) {
390
            final int faceIndex = ints.read(0); // arg 3 if 1.7.10 below
391
            if (faceIndex <= 5) {
392
                data.mightUseItem = false;
393
                return;
394
            }
395
        }
396
        // Player sends a block-placement item when right-clicking, so they might be actually using an item. Set the flag.
397
        if (!event.isCancelled()) data.mightUseItem = true;
398
    }
399
400
    private void handleDiggingPacket(PacketEvent event) {
401
        Player p = event.getPlayer();       
402
        final IPlayerData pData = DataManager.getPlayerDataSafe(p);
403
        final CombinedData data = pData.getGenericInstance(CombinedData.class);
404
        PlayerDigType digtype = event.getPacket().getPlayerDigTypes().read(0);
405
        if (!BridgeMisc.hasGetItemInUseMethod()) {
406
            // DROP_ALL_ITEMS when dead?
407
            if (digtype == PlayerDigType.DROP_ALL_ITEMS || digtype == PlayerDigType.DROP_ITEM) {
408
                pData.setItemInUse(null);
409
            }
410
        }
411
        
412
        if (digtype == PlayerDigType.RELEASE_USE_ITEM) {
413
            pData.setItemInUse(null);
414
            long now = System.currentTimeMillis();
415
            if (data.releaseItemTime != 0) {
416
                if (now < data.releaseItemTime) {
417
                    data.releaseItemTime = now;
418
                    return;
419
                }
420
                if (data.releaseItemTime + timeBetweenRL > now) {
421
                    data.isHackingRI = true;
422
                }
423
            }
424
            data.releaseItemTime = now;
425
        }
426
    }
427
428
    /**
429
     * Set Minimum time between RELEASE_USE_ITEM packet is sent.
430
     * If time lower this value, A check will flag
431
     * Should be set from 51-100. Larger number, more protection more false-positive
432
     * 
433
     * @param time milliseconds
434
     */ 
435
    public static void setuseRLThreshold(int time) {
436
        timeBetweenRL = time;
437
    }   
438
}

How it counteracts this module

NCP's ProtocolLib use-item adapter watches the C08 use form and the C07 release form. It marks mightUseItem for use packets with a face above 5, and its release ledger punishes C07 RELEASE_USE_ITEM packets arriving within the 70ms release interval, feeding the noslowpacket penalty in SurvivalFly. AutoFish's reels are C08 uses, not C07 releases, so the release ledger never arms, and the use packets themselves are tracked but trigger no rate penalty at one or two per second. The honest statement is both sides of the ledger: the check exists to catch item-use automation on the release side, and this module completes its entire cycle on the use side, which the check does not score.

anticheat blockplace FastPlace (placement-rate window)

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

NCP's block-placement rate check runs from BlockPlaceListener.onBlockPlace, a Bukkit BlockPlaceEvent handler, and scores placements into an ActionFrequency(2, 1000) window plus a short-term tick counter. A fishing-rod cast serializes as a C08 with a null-origin position and facing 255, which is the use-item form, so no BlockPlaceEvent ever fires and the placement window never sees the casts. Even if the event did fire, the module's 500ms minimum spacing is far below the click-spam rates FastPlace is calibrated for. This entry is the honest gap on the placement side: the check that catches C08 spam is structurally blind to air-use packets, which is exactly the class AutoFish emits.

anticheat FastConsume (consume-completion ledger)

FastConsume.java28 lines · Java
1
package me.vrekt.arc.check.inventory;
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.inventory.InventoryData;
7
import org.bukkit.entity.Player;
8
9
public class FastConsume extends Check {
10
11
    private int consumeTime = 0;
12
13
    public FastConsume() {
14
        super(CheckType.FASTCONSUME);
15
16
        consumeTime = Arc.getCheckManager().getValueInt(CheckType.FASTCONSUME, "consume-time");
17
    }
18
19
    public boolean check(Player player, InventoryData data) {
20
21
        long now = System.currentTimeMillis();
22
        long last = data.getConsumeTime();
23
        long total = now - last;
24
25
        // check if the time it took to consume the item is less than allowed.
26
        return total < consumeTime && checkViolation(player, "consume time less than allowed.");
27
    }
28
}

How it counteracts this module

Arc v2's FastConsume stamps a consume start on the item-use packet and closes the ledger only when the consumption completes, punishing eat cycles that finish faster than the server's fixed use timer (1280ms default). A fishing-rod cast never fires PlayerItemConsumeEvent, so the completion half never engages and the ledger stays open, exactly the same structural miss documented for splash-potion throws. The module's cast cadence of at most two uses per second is also comfortably under any consume-rate window. The honest framing is that the check is the closest Arc v2 item-use counter in the C08 corpus, and it cannot see a rod because rods are not consumables.

anticheat BlockInteractSpeed (same-tick interaction bound)

BlockInteractSpeed.java55 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.interaction.terrain;
20
21
import me.islandscout.hawk.HawkPlayer;
22
import me.islandscout.hawk.check.BlockInteractionCheck;
23
import me.islandscout.hawk.event.InteractWorldEvent;
24
import org.bukkit.entity.Player;
25
26
import java.util.HashMap;
27
import java.util.Map;
28
import java.util.UUID;
29
30
public class BlockInteractSpeed extends BlockInteractionCheck {
31
32
    private final Map<UUID, Long> lastPlaceTick;
33
34
    public BlockInteractSpeed() {
35
        super("blockplacespeed", "%player% failed block place speed. VL: %vl%");
36
        lastPlaceTick = new HashMap<>();
37
    }
38
39
    @Override
40
    protected void check(InteractWorldEvent e) {
41
        Player p = e.getPlayer();
42
        HawkPlayer pp = e.getHawkPlayer();
43
        if (pp.getCurrentTick() == lastPlaceTick.getOrDefault(p.getUniqueId(), 0L))
44
            punishAndTryCancelAndBlockRespawn(pp, 1, e);
45
        else
46
            reward(pp);
47
48
        lastPlaceTick.put(p.getUniqueId(), pp.getCurrentTick());
49
    }
50
51
    @Override
52
    public void removeData(Player p) {
53
        lastPlaceTick.remove(p.getUniqueId());
54
    }
55
}

How it counteracts this module

Hawk's BlockInteractSpeed punishes two interactions landing in the same server tick, the signature of click-speed and fast-place automation. AutoFish fires at most one right-click per UpdateEvent, gated by the 500ms rodOutTimer and further bounded by the vanilla rightClickDelayTimer, so the same-tick condition is unreachable by construction and the check stays clean even during a rapid catch streak. The entry is the honest boundary on the interaction side: the check's own detection threshold (two uses in one tick, about 40 interactions per second) is an order of magnitude above the module's peak rate of two per second, and no configuration change makes a rod user look like a fast-place spammer.

← Back to Analysis Hub