Spicy AutoClicker module 2 files, 182 lines

Spicy AutoClicker: Full Source Analysis

Spicy's AutoClicker is a hold-to-click module driven from one EventUpdate handler and a single NumberSetting: APS (0-20, default 10).

info/spicyclient/modules/combat/AutoClicker.java · GitHub source ↗

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

Packets This Module Uses

Analysis

Overview

Spicy's AutoClicker is a hold-to-click module driven from one EventUpdate handler and a single NumberSetting: APS (0-20, default 10). A free-running millisecond Timer gates the swing/attack cycle at a fixed 1000/APS period - the module has no randomization knob at all - and the whole cycle only fires while the left mouse button is held (keyBindAttack.pressed). Every cycle starts with swingItem(), which emits the C0A arm swing; when the crosshair is over an entity the module sends a C02 ATTACK, and when the use-item key is held with a sword it wraps the attack in an unblock/re-block pair: a C07 RELEASE_USE_ITEM at BlockPos.ORIGIN to unwind the previous block, then blockHypixel, which re-raises the sword through sendPacketNoEvent with a C02 INTERACT carrying a rotation-derived aim vector, a second C02 INTERACT and a C08 block placement at BlockPos(-1, -1, -1) with facing 255 - the classic Hypixel sword-block spoof. Off-entity cycles fall back to blockHypixel or a vanilla sendUseItem, so holding left click against a wall keeps the block raised. The static blocking flag and the commented-out 'Swing + Autoblock' ModeSetting are the only remnants of a richer design.

Architecture

The module is a single EventUpdate branch with no event-type filtering beyond that. The gate is timer.hasTimeElapsed((long)(1000 / aps.getValue()), true): Timer.hasTimeElapsed returns true once now - lastMS exceeds the deadline and then resets lastMS to the current System.currentTimeMillis(), so the period is measured from the previous fire rather than from a scheduled slot and no phase error accumulates. Because the gate is only evaluated on each EventUpdate tick, the real-time deadline is quantized to the next 50ms tick boundary, so the packet spacing is the nominal period plus up to one tick of latency. At the default 10 APS the cycle lands every ~100ms; at 20 APS every ~50ms. The APS 0 edge case is worth noting: 1000 / 0.0 is +Infinity, the cast to long saturates to Long.MAX_VALUE, and hasTimeElapsed(Long.MAX_VALUE) can never be true, so the module is inert at 0. The hold gate is re-checked on every tick, so releasing the mouse stops the cycle on the next update with no release shaping - no trailing clicks, no anti-shortpress behavior.

Attack path and Hypixel autoblock

When objectMouseOver.typeOfHit is ENTITY, the module first unwinds a previous block: if the use-item key is held and the equipped item is an ItemSword, it sends C07PacketPlayerDigging RELEASE_USE_ITEM at BlockPos.ORIGIN and clears the blocking flag, then sends the C02PacketUseEntity ATTACK through the normal send queue. Immediately after, if the use-item key is still held with a sword, blockHypixel re-raises the block: it computes the target rotations with RotationUtils.getRotations, calls the module's private sendUseItem (a verbatim copy of the vanilla use-item path - syncCurrentPlayItem, then itemStackIn.useItemRightClick), and fires three packets through sendPacketNoEvent: a C02 INTERACT whose Vec3 is RotationUtils.getVectorForRotation(rotations[0], rotations[1]) (the aim vector itself used as the interact point), a plain C02 INTERACT, and a C08PacketPlayerBlockPlacement at BlockPos(-1, -1, -1) with facing 255 and the held item. sendPacketNoEvent bypasses the event bus, so these packets are invisible to module-level interception. Off-entity the same blockHypixel runs if the use-item key is held with a sword; otherwise, if not already blocking, the module calls mc.playerController.sendUseItem (the real vanilla player controller path) and sets blocking = true - so clicking at a wall keeps the sword raised instead of swinging at air. onEnable and onDisable only snapshot mc.thePlayer.isBlocking() into the static blocking field, which is why the flag survives across the toggle.

Timing fingerprint

The click train is a fixed-period timer with no randomness: inter-click deltas are 1000/APS plus tick-quantization noise only, so at any stable APS the interval is either constant or alternating between two tick multiples (15 APS, for instance, oscillates between 1- and 2-tick spacings as the 66.7ms deadline lands). The swing always precedes the attack by construction - swingItem() runs before the C02 in the same tick - giving a strict 1:1 swing-to-attack ratio with no swung-but-not-attacked and no attacked-without-swing packets. Against hold-gated assumptions the module behaves like a human holding the button, but the cadence itself is machine-regular, and the two Hawk checks in the countering section exist precisely to measure that regularity.

source AutoClicker.java (module)

AutoClicker.java155 lines · JavaOriginal ↗
1
package info.spicyclient.modules.combat;
2
3
import org.lwjgl.input.Keyboard;
4
5
import info.spicyclient.chatCommands.Command;
6
import info.spicyclient.events.Event;
7
import info.spicyclient.events.listeners.EventUpdate;
8
import info.spicyclient.modules.Module;
9
import info.spicyclient.settings.ModeSetting;
10
import info.spicyclient.settings.NumberSetting;
11
import info.spicyclient.util.RotationUtils;
12
import info.spicyclient.util.Timer;
13
import net.minecraft.entity.EntityLivingBase;
14
import net.minecraft.entity.player.EntityPlayer;
15
import net.minecraft.item.ItemBlock;
16
import net.minecraft.item.ItemStack;
17
import net.minecraft.item.ItemSword;
18
import net.minecraft.network.play.client.C02PacketUseEntity;
19
import net.minecraft.network.play.client.C08PacketPlayerBlockPlacement;
20
import net.minecraft.network.play.client.C02PacketUseEntity.Action;
21
import net.minecraft.network.play.client.C07PacketPlayerDigging;
22
import net.minecraft.util.BlockPos;
23
import net.minecraft.util.EnumFacing;
24
import net.minecraft.util.MovingObjectPosition.MovingObjectType;
25
import net.minecraft.world.World;
26
import net.minecraft.world.WorldSettings;
27
28
public class AutoClicker extends Module {
29
	
30
	private NumberSetting aps = new NumberSetting("APS", 10, 0, 20, 1);
31
	//private ModeSetting mode = new ModeSetting("Mode", "Swing", "Swing", "Swing + Autoblock");
32
	
33
	private static transient boolean blocking = false;
34
	
35
	public AutoClicker() {
36
		super("Autoclicker", Keyboard.KEY_NONE, Category.COMBAT);
37
		resetSettings();
38
	}
39
	
40
	@Override
41
	public void resetSettings() {
42
		this.settings.clear();
43
		this.addSettings(aps);
44
	}
45
	
46
	public void onEnable() {
47
		blocking = mc.thePlayer.isBlocking();
48
	}
49
	
50
	public void onDisable() {
51
		blocking = mc.thePlayer.isBlocking();
52
	}
53
	
54
	public Timer timer = new Timer();
55
	
56
	public void onEvent(Event e) {
57
		
58
		if (e instanceof EventUpdate) {
59
			
60
			if (timer.hasTimeElapsed((long) (1000/aps.getValue()), true) && mc.gameSettings.keyBindAttack.pressed) {
61
				
62
				//if (mode.is("Swing + Autoblock")) {
63
					//mc.gameSettings.keyBindUseItem.pressed = true;
64
				//}
65
				
66
				mc.thePlayer.swingItem();
67
				
68
				if (mc.objectMouseOver.typeOfHit.equals(MovingObjectType.ENTITY)) {
69
					
70
					if (mc.gameSettings.keyBindUseItem.pressed && mc.thePlayer.getCurrentEquippedItem() != null && mc.thePlayer.getCurrentEquippedItem().getItem() instanceof ItemSword) {
71
						mc.thePlayer.sendQueue.addToSendQueue(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.RELEASE_USE_ITEM, BlockPos.ORIGIN, EnumFacing.DOWN));
72
						blocking = false;
73
					}
74
					
75
					mc.thePlayer.sendQueue.addToSendQueue(new C02PacketUseEntity(mc.objectMouseOver.entityHit, Action.ATTACK));
76
					
77
					if (mc.gameSettings.keyBindUseItem.pressed && mc.thePlayer.getCurrentEquippedItem() != null && mc.thePlayer.getCurrentEquippedItem().getItem() instanceof ItemSword) {
78
						blockHypixel((EntityLivingBase) mc.objectMouseOver.entityHit);
79
					}
80
					
81
				}else {
82
					
83
					if (mc.gameSettings.keyBindUseItem.pressed && mc.thePlayer.getCurrentEquippedItem() != null && mc.thePlayer.getCurrentEquippedItem().getItem() instanceof ItemSword) {
84
						blockHypixel((EntityLivingBase) mc.objectMouseOver.entityHit);
85
					}
86
					else if (!blocking && mc.thePlayer.inventory.getCurrentItem() != null) {
87
						mc.playerController.sendUseItem(mc.thePlayer, mc.theWorld, mc.thePlayer.inventory.getCurrentItem());
88
						blocking = true;
89
					}
90
					
91
				}
92
				
93
			}
94
			
95
			//else if (!mc.gameSettings.keyBindAttack.pressed){
96
				//mc.gameSettings.keyBindUseItem.pressed = false;
97
			//}
98
			
99
		}
100
		
101
	}
102
	
103
	private void blockHypixel(EntityLivingBase ent) {
104
		
105
		blocking = true;
106
		
107
		if (ent == null) {
108
			return;
109
		}
110
		
111
		sendUseItem(mc.thePlayer, mc.theWorld, mc.thePlayer.getCurrentEquippedItem());
112
		
113
		float[] rotations = RotationUtils.getRotations(ent);
114
		mc.getNetHandler().getNetworkManager().sendPacketNoEvent(new C02PacketUseEntity(ent, RotationUtils.getVectorForRotation(rotations[0], rotations[1])));
115
		mc.getNetHandler().getNetworkManager().sendPacketNoEvent(new C02PacketUseEntity(ent, Action.INTERACT));
116
		mc.getNetHandler().getNetworkManager().sendPacketNoEvent(new C08PacketPlayerBlockPlacement(new BlockPos(-1, -1, -1), 255, mc.thePlayer.getHeldItem(), 0, 0, 0));
117
		
118
	}
119
	
120
	public boolean sendUseItem(EntityPlayer playerIn, World worldIn, ItemStack itemStackIn)
121
    {
122
        if (mc.playerController.currentGameType == WorldSettings.GameType.SPECTATOR)
123
        {
124
            return false;
125
        }
126
        else
127
        {
128
        	
129
        	if (itemStackIn == null) {
130
        		return false;
131
        	}
132
        	
133
            mc.playerController.syncCurrentPlayItem();
134
            int i = itemStackIn.stackSize;
135
            ItemStack itemstack = itemStackIn.useItemRightClick(worldIn, playerIn);
136
137
            if (itemstack != itemStackIn || itemstack != null && itemstack.stackSize != i)
138
            {
139
                playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = itemstack;
140
141
                if (itemstack.stackSize == 0)
142
                {
143
                    playerIn.inventory.mainInventory[playerIn.inventory.currentItem] = null;
144
                }
145
146
                return true;
147
            }
148
            else
149
            {
150
                return false;
151
            }
152
        }
153
    }
154
	
155
}

What this file does

The whole module is 155 lines. The APS setting is declared at line 30 (min 0, max 20, default 10) and the Timer at line 54. onEnable/onDisable (lines 46-52) only record the blocking state, and the EventUpdate branch (lines 56-101) is the entire logic. The gate at line 60 combines the timer deadline with the hold check: hasTimeElapsed(1000 / aps, reset=true) and keyBindAttack.pressed must both pass. Line 66 swings the arm (swingItem sends C0APacketAnimation unconditionally in the 1.8 fork), and line 75 sends the C02 ATTACK for the hovered entity. The block unwinding lives at lines 70-73: when the use-item key is held with a sword, a C07 RELEASE_USE_ITEM at BlockPos.ORIGIN is queued and blocking is cleared before the attack. blockHypixel (lines 103-118) then re-raises the block: it marks blocking, runs the custom sendUseItem wrapper (lines 120-153, a copy of PlayerControllerMP.sendUseItem that guards SPECTATOR and null stacks, syncs the held slot, then calls useItemRightClick), and sends the three-packet spoof via sendPacketNoEvent - the C02 INTERACT with RotationUtils.getVectorForRotation aim vector (line 114), the plain C02 INTERACT (line 115), and the C08 at BlockPos(-1, -1, -1) facing 255 (line 116). The off-entity path (lines 81-91) either blockHypixels or, when not blocking, calls mc.playerController.sendUseItem and sets blocking = true. The commented-out autoblock mode (lines 31, 62-64, 95-97) shows the swing-plus-useItem variant was planned but disabled, which is why this module never fakes keyBindUseItem.pressed.

source Timer.java (cadence gate)

Timer.java27 lines · JavaOriginal ↗
1
package info.spicyclient.util;
2
3
public class Timer {
4
	
5
	public long lastMS = System.currentTimeMillis();;
6
	
7
	public void reset() {
8
		lastMS = System.currentTimeMillis();
9
	}
10
	
11
	public boolean hasTimeElapsed(long time, boolean reset) {
12
		
13
		if (System.currentTimeMillis()-lastMS > time) {
14
			
15
			if (reset)
16
				reset();
17
			
18
			return true;
19
				
20
			
21
		}else {
22
			return false;
23
		}
24
		
25
	}
26
	
27
}

What this file does

The Timer is a free-running wall-clock deadline, not a scheduler. lastMS is initialized to System.currentTimeMillis() at construction; hasTimeElapsed(time, reset=true) (lines 11-25) returns true when now - lastMS exceeds time and, because reset is passed true, immediately sets lastMS back to now. The period is therefore measured from the previous fire time: the next deadline is always 'one period after the last actual fire', so a delayed evaluation (a tick that ran late) does not cause a burst of catch-up clicks - there is no fixed schedule to catch up to. This is also why the AutoClicker's spacing carries tick quantization: the gate is only polled on EventUpdate, so a deadline that falls mid-tick only fires on the next tick, adding up to 50ms of latency to that interval. reset() is never called elsewhere by the module, so the only resets are the self-resets inside the gate. The same Timer class is used by Spicy's Killaura with a random float added to the period; the AutoClicker passes a plain 1000/APS, which is the entire difference between the two modules' timing fingerprints.

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 FightSpeed (CPS cap on tick deltas)

FightSpeed.java90 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.combat;
20
21
import me.islandscout.hawk.HawkPlayer;
22
import me.islandscout.hawk.check.EntityInteractionCheck;
23
import me.islandscout.hawk.event.InteractAction;
24
import me.islandscout.hawk.event.InteractEntityEvent;
25
import me.islandscout.hawk.util.MathPlus;
26
import me.islandscout.hawk.util.Placeholder;
27
import org.bukkit.entity.Player;
28
29
import java.util.*;
30
31
public class FightSpeed extends EntityInteractionCheck {
32
33
    //This check is very similar to the FightSpeedConsistency check, however I will
34
    //not be merging these, because their SAMPLES variable may vary
35
    //based on configuration. For instance, FightSpeedConsistency relies on samples
36
    //of 5, yet this check relies on samples of 10.
37
38
    private final Map<UUID, Long> lastClickTime; //in client ticks
39
    private final Map<UUID, List<Long>> deltaTimes;
40
    private static final double RECORD_SENSITIVITY = 4; //don't log click if it took longer than these ticks
41
    private static int SAMPLES;
42
    private final double MAX_CPS;
43
44
    public FightSpeed() {
45
        super("fightspeed", "%player% failed attack speed. CPS: %cps%, VL: %vl%");
46
        lastClickTime = new HashMap<>();
47
        deltaTimes = new HashMap<>();
48
        SAMPLES = (int)customSetting("sampleSize", "", 10);
49
        MAX_CPS = (double)customSetting("maxCps", "", 16D);
50
    }
51
52
    @Override
53
    protected void check(InteractEntityEvent e) {
54
        if (e.getInteractAction() == InteractAction.INTERACT)
55
            return;
56
        UUID uuid = e.getPlayer().getUniqueId();
57
        HawkPlayer pp = e.getHawkPlayer();
58
        if (lastClickTime.containsKey(uuid)) {
59
            List<Long> deltaTs = deltaTimes.getOrDefault(uuid, new ArrayList<>());
60
            long deltaT = (pp.getCurrentTick() - lastClickTime.get(uuid));
61
            if (deltaT <= RECORD_SENSITIVITY) {
62
                deltaTs.add(deltaT);
63
                if (deltaTs.size() >= SAMPLES) {
64
                    double avgCps = 0;
65
                    for (double entry : deltaTs) {
66
                        avgCps += entry;
67
                    }
68
                    double divisor = (avgCps / SAMPLES / 20);
69
                    avgCps = 1 / divisor;
70
                    //if someone manages to get an Infinity, they're dumb af
71
                    if (avgCps > MAX_CPS) {
72
                        punish(pp, 1, true, e, new Placeholder("cps", (Double.isInfinite(avgCps) ? avgCps : MathPlus.round(avgCps, 2) + "")));
73
                    } else {
74
                        reward(pp);
75
                    }
76
                    deltaTs.remove(0);
77
                }
78
                deltaTimes.put(uuid, deltaTs);
79
            }
80
        }
81
        lastClickTime.put(uuid, pp.getCurrentTick());
82
    }
83
84
    @Override
85
    public void removeData(Player p) {
86
        UUID uuid = p.getUniqueId();
87
        lastClickTime.remove(uuid);
88
        deltaTimes.remove(uuid);
89
    }
90
}

How it counteracts this module

Hawk's FightSpeed caps sustained click speed server-side. Every non-INTERACT InteractEntityEvent is timestamped with the HawkPlayer's current tick; the delta since the last attack is recorded only when it is at most RECORD_SENSITIVITY (4) ticks and appended to a per-player delta list. Once the list holds SAMPLES (default 10) deltas, the sum is converted to CPS as 1 / (sum / samples / 20), i.e. 20 divided by the average tick spacing, and an average above MAX_CPS (default 16) punishes with 'failed attack speed. CPS: %cps%'; otherwise the player is rewarded and the VL decays. Spicy's module feeds this check directly: at 20 APS the fixed 50ms period averages exactly 1 tick per click, so the reported CPS is 20 and every 10-click window trips the cap; at 15 APS the 1/2-tick alternation averages 1.33 ticks, reporting ~15 CPS, just under the line. The module's fixed period is the worst case for this check - a human's 15-20 CPS bursts would show far higher average tick spacings because real clicking does not sustain a 50ms period. The counter surface only opens at APS values whose tick-quantized average spacing stays under 1.25 ticks (roughly 12-16 APS sustained), and even there the fixed period is what the consistency check below exploits.

anticheat FightSpeedConsistency (stdev of window CPS)

FightSpeedConsistency.java120 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.combat;
20
21
import me.islandscout.hawk.HawkPlayer;
22
import me.islandscout.hawk.check.Cancelless;
23
import me.islandscout.hawk.check.EntityInteractionCheck;
24
import me.islandscout.hawk.event.*;
25
import me.islandscout.hawk.util.MathPlus;
26
import org.bukkit.entity.Player;
27
28
import java.util.*;
29
30
public class FightSpeedConsistency extends EntityInteractionCheck implements Cancelless {
31
32
    //This check is very similar to the FightSpeed check, however I will
33
    //not be merging these, because their SAMPLES variable may vary
34
    //based on configuration. For instance, FightSpeed relies on samples
35
    //of 10, yet this check relies on samples of 5.
36
37
    private final int SAMPLES;
38
    private final int SAMPLE_SIZE;
39
    private final double STDEV_THRESHOLD;
40
    private final double MIN_CPS;
41
    private final int RECORD_THRESHOLD; //don't log click if it took longer than these ticks
42
43
    private final Map<UUID, List<Double>> pSamples;
44
    private final Map<UUID, Long> lastClickTick;
45
    private final Map<UUID, List<Long>> deltaTimes;
46
47
    public FightSpeedConsistency() {
48
        super("fightspeedconsistency", false, -1, 3, 0.99, 5000, "%player% failed click consistency. Autoclicker? VL: %vl%", null);
49
        MIN_CPS = (double)customSetting("checkAboveCPS", "", 10D);
50
        SAMPLES = (int)customSetting("samples", "", 5);
51
        SAMPLE_SIZE = (int)customSetting("sampleSize", "", 20);
52
        STDEV_THRESHOLD = (double)customSetting("stdevThreshold", "", 0.05D);
53
        RECORD_THRESHOLD = (int)(20 * (1 / MIN_CPS) + 1);
54
        pSamples = new HashMap<>();
55
        lastClickTick = new HashMap<>();
56
        deltaTimes = new HashMap<>();
57
    }
58
59
    @Override
60
    protected void check(InteractEntityEvent e) {
61
        if (e.getInteractAction() == InteractAction.INTERACT)
62
            return;
63
        UUID uuid = e.getPlayer().getUniqueId();
64
        HawkPlayer pp = e.getHawkPlayer();
65
        if (lastClickTick.containsKey(uuid)) {
66
            List<Long> deltaTs = deltaTimes.getOrDefault(uuid, new ArrayList<>());
67
            long deltaT = (pp.getCurrentTick() - lastClickTick.get(uuid));
68
69
            //log click if player clicks faster than this
70
            if (deltaT <= RECORD_THRESHOLD) {
71
                deltaTs.add(deltaT);
72
73
                //begin computing avg cps
74
                if (deltaTs.size() >= SAMPLE_SIZE) {
75
                    double avgCps = 0;
76
                    for (double entry : deltaTs) {
77
                        avgCps += entry;
78
                    }
79
                    double divisor = (avgCps / SAMPLE_SIZE / 20);
80
                    avgCps = 1 / divisor;
81
82
                    List<Double> sampless = pSamples.getOrDefault(uuid, new ArrayList<>());
83
                    sampless.add(avgCps);
84
85
                    //Debug.broadcastMessage(avgCps + "");
86
87
                    //Begin computing standard deviation and judge player.
88
                    //Only if above min cps and enough samples.
89
                    //Acts like a narrow barrier between the two limits to prevent false flags.
90
                    //Explanation: When clicks are barely meeting speed requirements, a narrow
91
                    //range of CPSs will be processed, thus setting off false flags.
92
                    if(avgCps > MIN_CPS && sampless.size() >= SAMPLES) {
93
                        //Debug.broadcastMessage(ChatColor.YELLOW + "" + MathPlus.stdev(sampless));
94
                        if(MathPlus.stdev(sampless) < STDEV_THRESHOLD) {
95
                            punish(pp, false, e);
96
                        }
97
                        else {
98
                            reward(pp);
99
                        }
100
                    }
101
102
                    if(sampless.size() >= SAMPLES) {
103
                        sampless.remove(0);
104
                    }
105
                    pSamples.put(uuid, sampless);
106
                    deltaTs.remove(0);
107
                }
108
                deltaTimes.put(uuid, deltaTs);
109
            }
110
        }
111
        lastClickTick.put(uuid, pp.getCurrentTick());
112
    }
113
114
    @Override
115
    public void removeData(Player p) {
116
        pSamples.remove(p.getUniqueId());
117
        lastClickTick.remove(p.getUniqueId());
118
        deltaTimes.remove(p.getUniqueId());
119
    }
120
}

How it counteracts this module

FightSpeedConsistency targets machine-regular cadence rather than raw speed. It records the same tick deltas (RECORD_THRESHOLD = 20 * (1 / MIN_CPS) + 1), averages them over SAMPLE_SIZE (default 20) clicks into one CPS value, collects 5 such window averages, and computes their standard deviation: a stdev below STDEV_THRESHOLD (default 0.05) punishes with 'failed click consistency. Autoclicker?', but only when the window average exceeds MIN_CPS (default 10). This is the exact check Spicy's fixed 1000/APS period cannot pass: every 20-click window at any stable APS averages to the same value, the stdev of the 5 samples is effectively zero, and the only requirement is that the module click above 10 CPS on average - which means any APS setting above 10 is an immediate flag, and even 10 APS sits on the boundary. The tick-quantization jitter (at 15 APS, windows mixing different 1/2-tick counts) is far too small to move the stdev above 0.05. There is no randomization setting in the module to raise it, which is the entire point of the comparison with Sigma's AutoClicker in the sibling analysis.

anticheat NoSwing (attack-without-swing ledger)

NoSwing.java65 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.fight;
16
17
import org.bukkit.entity.Player;
18
19
import fr.neatmonster.nocheatplus.checks.Check;
20
import fr.neatmonster.nocheatplus.checks.CheckType;
21
22
/**
23
 * We require that the player moves their arm between attacks, this is basically what gets checked here.
24
 */
25
public class NoSwing extends Check {
26
27
    /**
28
     * Instantiates a new no swing check.
29
     */
30
    public NoSwing() {
31
        super(CheckType.FIGHT_NOSWING);
32
    }
33
34
    /**
35
     * Checks a player.
36
     * 
37
     * @param player
38
     *            the player
39
     * @return true, if successful
40
     */
41
    public boolean check(final Player player, final FightData data, final FightConfig cc) {
42
        boolean cancel = false;
43
44
        if (data.exemptArmSwing) {
45
            data.exemptArmSwing = false;
46
        }
47
        // Did they swing his arm before?
48
        else if (++data.noSwingCount <= 1) {
49
            // Yes, reward them with reduction of their violation level.
50
            data.noSwingVL *= 0.9D;
51
        } 
52
        else {
53
            data.noSwingCount = 0;
54
            // No, increase their violation level.
55
            data.noSwingVL += 1D;
56
57
            // Execute whatever actions are associated with this check and the violation level and find out if we should
58
            // cancel the event.
59
            cancel = executeActions(player, data.noSwingVL, 1D, cc.noSwingActions).willCancel();
60
        }
61
62
        return cancel;
63
    } 
64
65
}

How it counteracts this module

NCP's fight NoSwing enforces the swing-between-attacks contract: the FightListener increments data.noSwingCount on every attack (line 323-324) and decrements it on every PlayerAnimationEvent (line 800), and the check itself (lines 41-63) rewards a player whose first attack after a swing halves their VL, but a second consecutive attack with no swing in between resets the count, adds 1 to noSwingVL, and runs the configured actions (default cancel at VL thresholds). The ledger is per-entity-interaction, so it measures whether the C0A stream and the C02 stream are coupled. Spicy's module always swings: swingItem() runs in the same tick as the C02 ATTACK, so each attack re-arms the ledger and noSwingCount never exceeds 1 - this check stays clean against the module's normal configuration. It is still the canonical NCP C0A check and the relevant one for this packet class: it exists to catch the noSwing flavor of autoclickers and killauras that suppress the arm swing to dodge cadence checks, and any Spicy-side variant that disables the swing (or any other module on the client attacking without swinging) feeds this ledger directly. Its counter surface for Spicy's AutoClicker proper is nil, which is why the cadence checks above carry the real weight.

anticheat ClicksListener (C0A delay sampling feed)

ClicksListener.java65 lines · Java
1
package ai.idealistic.spartan.listeners.protocol;
2
3
import ai.idealistic.spartan.Register;
4
import ai.idealistic.spartan.abstraction.event.PlayerLeftClickEvent;
5
import ai.idealistic.spartan.abstraction.protocol.PlayerProtocol;
6
import ai.idealistic.spartan.functionality.concurrent.CheckThread;
7
import ai.idealistic.spartan.functionality.server.Config;
8
import ai.idealistic.spartan.functionality.server.PluginBase;
9
import com.comphenix.protocol.PacketType;
10
import com.comphenix.protocol.events.ListenerPriority;
11
import com.comphenix.protocol.events.PacketAdapter;
12
import com.comphenix.protocol.events.PacketEvent;
13
import org.bukkit.entity.Player;
14
15
public class ClicksListener extends PacketAdapter {
16
17
    public ClicksListener() {
18
        super(
19
                Register.plugin,
20
                ListenerPriority.NORMAL,
21
                PacketType.Play.Client.ARM_ANIMATION,
22
                PacketType.Play.Client.BLOCK_DIG
23
        );
24
    }
25
26
    @Override
27
    public void onPacketReceiving(PacketEvent event) {
28
        Player player = event.getPlayer();
29
        PlayerProtocol protocol = PluginBase.getProtocol(player);
30
31
        if (!Config.settings.getBoolean("Important.bedrock_on_protocollib")
32
                && protocol.isBedrockPlayer()) {
33
            return;
34
        }
35
        synchronized (protocol) {
36
            if (event.getPacket().getType().equals(PacketType.Play.Client.ARM_ANIMATION)) {
37
                long delay = System.currentTimeMillis() - protocol.oldClickTime;
38
39
                CheckThread.run(protocol, () -> {
40
                    if (delay > 150) {
41
                        protocol.clickBlocker = false;
42
                    }
43
                    if (!protocol.clickBlocker) {
44
                        protocol.executeRunners(
45
                                false,
46
                                new PlayerLeftClickEvent(
47
                                        player,
48
                                        delay
49
                                )
50
                        );
51
                    }
52
                    protocol.oldClickTime = System.currentTimeMillis();
53
                });
54
            } else if (event.getPacket().getType().equals(PacketType.Play.Client.BLOCK_DIG)) {
55
                String s = event.getPacket().getStructures().getValues().toString();
56
57
                CheckThread.run(protocol, () -> {
58
                    protocol.oldClickTime = System.currentTimeMillis();
59
                    protocol.clickBlocker = !s.contains("ABORT");
60
                });
61
            }
62
        }
63
    }
64
65
}

How it counteracts this module

Spartan's protocol layer samples the C0A stream itself. ClicksListener is a ProtocolLib PacketAdapter on Play.Client.ARM_ANIMATION and Play.Client.BLOCK_DIG: on every arm swing it computes delay = now - protocol.oldClickTime, and if the delay exceeds 150ms it clears protocol.clickBlocker; when not click-blocked it dispatches a PlayerLeftClickEvent carrying that delay through executeRunners - the event that the FastClicks check (registered for HackType.FAST_CLICKS in the same snapshot's Enums.java) consumes on the check thread - and then stamps oldClickTime. A BLOCK_DIG that is not an ABORT sets clickBlocker, suppressing click events while the player digs. The detector's input signal is therefore the per-C0A delay stream plus the dig-interaction state. Spicy's module produces the worst-case signal for any rate/regularity analysis on this feed: at a stable APS the delay between consecutive C0As is constant (plus tick quantization), a distribution a human never produces, and every swing carries its own C02, so the swing and attack rates are identical and both maximal. The check implementation class itself is not present in this source snapshot - only the sampling listener and the check registration - so the exact FastClicks thresholds cannot be quoted, but the listener is the layer that turns the module's fixed-period C0A train into the delay samples the detector judges.

← Back to Analysis Hub