Spicy HideName module 1 files, 69 lines

Spicy HideName: Full Source Analysis

Spicy's HideName rewrites the player's own username in inbound display packets.

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

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

Packets This Module Uses

Analysis

Overview

Spicy's HideName rewrites the player's own username in inbound display packets. On every pre EventPacket it strips the separator character from S02PacketChat chat text and S3CPacketUpdateScore scoreboard names, and when the result contains the session username it substitutes a picked alias from a six-option ModeSetting. The mutation happens in place before rendering, so the server never sees the substituted name and nothing is echoed back. The module is purely cosmetic: it hides the player's identity in chat and on scoreboards while contributing nothing to the wire.

Architecture

The module carries one ModeSetting (Name) with the aliases You, MooshroomMashUp, Fox_of_floof, lavaflowglow and _Floofy_Fox_, surfaced as the module's additionalInformation line in the HUD. The EventUpdate pre branch only refreshes that display string; all real work sits in the EventPacket pre branch. Two packet types are handled: S02PacketChat, where the chat component is rebuilt if its text contains the username, and S3CPacketUpdateScore, where the objective name and the entry name are rewritten via setObjective and setName. The imports also list S3BPacketScoreboardObjective and S3DPacketDisplayScoreboard, but no branch touches them.

Rewrite mechanics

Every string check first strips the separator character with replaceAll, then tests the result for the session username; when found, the same strip-and-replace is applied to the formatted text with the username swapped for the selected alias. The separator is the tell for the module's era: servers and plugins began inserting it into names to break naive substring replacement, and the module strips it before matching and before rewriting so the substitution still lands on display. Because the packet objects are mutated in place before the client renders them, the server never learns that a substitution happened: S02 and S3C are inbound display state with no serverbound counterpart.

Wire profile

The module emits no serverbound packet of any kind and touches no movement state. Its handlers are receive-side only, so the checks that matter for a hidden-name setup are the ones that enforce everything else the player does: movement envelopes, toggle rates and teleport ledgers all operate unchanged while the module is on. The rewrite itself is invisible to every anticheat, because the substituted name never leaves the client.

source HideName.java (module)

HideName.java69 lines · JavaOriginal ↗
1
package info.spicyclient.modules.player;
2
3
import org.lwjgl.input.Keyboard;
4
5
import info.spicyclient.SpicyClient;
6
import info.spicyclient.events.Event;
7
import info.spicyclient.events.listeners.EventPacket;
8
import info.spicyclient.events.listeners.EventUpdate;
9
import info.spicyclient.modules.Module;
10
import info.spicyclient.settings.ModeSetting;
11
import info.spicyclient.settings.SettingChangeEvent;
12
import net.minecraft.network.play.server.S02PacketChat;
13
import net.minecraft.network.play.server.S3BPacketScoreboardObjective;
14
import net.minecraft.network.play.server.S3CPacketUpdateScore;
15
import net.minecraft.network.play.server.S3DPacketDisplayScoreboard;
16
import net.minecraft.util.ChatComponentText;
17
18
public class HideName extends Module {
19
	
20
	public ModeSetting mode = new ModeSetting("Name", "You", "You", "MooshroomMashUp", "Fox_of_floof", "lavaflowglow", "_Floofy_Fox_");
21
	
22
	public HideName() {
23
		super("HideName", Keyboard.KEY_NONE, Category.PLAYER);
24
		resetSettings();
25
	}
26
	
27
	@Override
28
	public void resetSettings() {
29
		this.settings.clear();
30
		this.addSettings(mode);
31
	}
32
	
33
	@Override
34
	public void onEvent(Event e) {
35
		
36
		if (e instanceof EventUpdate && e.isPre()) {
37
			this.additionalInformation = mode.getMode();
38
		}
39
		
40
		if (e instanceof EventPacket && e.isPre()) {
41
			
42
			EventPacket packetEvent = (EventPacket) e;
43
			if (packetEvent.packet instanceof S02PacketChat) {
44
				
45
				S02PacketChat packet = (S02PacketChat) packetEvent.packet;
46
				
47
				if (packet.getChatComponent().getUnformattedText().replaceAll("׼", "").contains(mc.getSession().getUsername())) {
48
					packet.chatComponent = new ChatComponentText(packet.getChatComponent().getFormattedText().replaceAll("׼", "").replaceAll(mc.getSession().getUsername(), mode.getMode()));
49
				}
50
				
51
			}
52
			else if (packetEvent.packet instanceof S3CPacketUpdateScore) {
53
				S3CPacketUpdateScore packet = (S3CPacketUpdateScore) packetEvent.packet;
54
				
55
				if (packet.getObjectiveName().replaceAll("׼", "").contains(mc.getSession().getUsername())){
56
					packet.setObjective(packet.getObjectiveName().replaceAll("׼", "").replaceAll(mc.getSession().getUsername(), mode.getMode()));
57
				}
58
				
59
				if (packet.getName().replaceAll("׼", "").contains(mc.getSession().getUsername())){
60
					packet.setName(packet.getName().replaceAll("׼", "").replaceAll(mc.getSession().getUsername(), mode.getMode()));
61
				}
62
				
63
			}
64
			
65
		}
66
		
67
	}
68
	
69
}

What this file does

The module is two receive-side rewrites behind one EventPacket pre branch. For S02PacketChat it tests whether the unformatted text, after stripping the separator, contains the session username, and if so rebuilds the component from the formatted text with the username replaced by the selected alias. For S3CPacketUpdateScore it applies the same strip-and-replace to the objective name and the entry name fields. The ModeSetting is exposed as the module's additionalInformation line in the HUD, and resetSettings re-registers it so config loads cannot add stale settings.

The separator strip is the notable detail: it runs before matching and before rewriting, so a server that inserts the character into the player's name to break string replacement still gets its name substituted on display. The rewrite mutates the packet objects in place before rendering, which is why the server never learns of the substitution: S02 and S3C are inbound display state and nothing is echoed back.

The imports list S3BPacketScoreboardObjective and S3DPacketDisplayScoreboard, but no handler branch touches them; they are dead imports. The module emits no serverbound packet and touches no movement state, so it is invisible on the wire in both directions.

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 TeleportQueue (S08 teleport ledger)

TeleportQueue.java370 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.model;
16
17
import java.util.Iterator;
18
import java.util.LinkedList;
19
import java.util.concurrent.locks.Lock;
20
import java.util.concurrent.locks.ReentrantLock;
21
22
import fr.neatmonster.nocheatplus.compat.AlmostBoolean;
23
24
/**
25
 * Queue outgoing teleport locations (DataPacketFlying), in order to cancel
26
 * other moving until the client acknowledges previous teleport locations. In
27
 * fact this might only queue a single location.
28
 * 
29
 * @author asofold
30
 *
31
 */
32
public class TeleportQueue {
33
34
    public static enum AckResolution {
35
        /** Waiting for ACK. */
36
        WAITING,
37
        /** Packet is ACK. */
38
        ACK,
39
        /** Not waiting for an ACK. */
40
        IDLE
41
    }
42
43
    public static class AckReference {
44
        public int lastOutgoingId = Integer.MIN_VALUE;
45
        /**
46
         * The maximum of confirmed ids. Once lastOutgoingId is reached, we
47
         * assume all teleports are done. Until then this id may get adjusted if
48
         * lower than lastOutgoingId. Note that the id will be circling within 0
49
         * to Integer.MAX_VALUE - 1, systematically increasing until back to 0,
50
         * thus this value can be greater than lastOutGoingId, which should be
51
         * treated as 'bad luck', resetting this to Integer.MIN_VALUE.
52
         */
53
        public int maxConfirmedId = Integer.MIN_VALUE;
54
    }
55
56
    // TODO: Consider passing a reentrant lock in the constructor (e.g. one lock per NetData).
57
    private final Lock lock = new ReentrantLock();
58
59
    /** Validated outgoing teleport locations, expected to be confirmed by the client. */
60
    private final LinkedList<CountableLocation> expectIncoming = new LinkedList<CountableLocation>();
61
    /** Location from a Bukkit event, which we expect an outgoing teleport for. */
62
    private DataLocation expectOutgoing = null;
63
64
    private long maxAge = 4000; // TODO: configurable
65
    private int maxQueueSize = 60; // TODO: configurable
66
67
    /**
68
     * Queried from the primary thread (read only), reset with outgoing
69
     * teleport.
70
     */
71
    private CountableLocation lastAck = null;
72
73
    private AckReference lastAckReference = new AckReference();
74
75
    /**
76
     * Maximum age in milliseconds, older entries expire.
77
     * @return
78
     */
79
    public long getMaxAge() {
80
        return maxAge;
81
    }
82
83
    /**
84
     * The last confirmed teleport location (read-only by primary thread),
85
     * resets with outgoing teleport.
86
     * 
87
     * @return
88
     */
89
    public CountableLocation getLastAck() {
90
        return lastAck;
91
    }
92
93
    /**
94
     * Get the reference of the last ack, not resetting, but updating with
95
     * incoming acks. This always is the same object, it might only by updated
96
     * on a successful ACK, depending on what's needed (current use is to cancel
97
     * packets on processAck returning WAITING).
98
     * 
99
     * @return
100
     */
101
    public AckReference getLastAckReference() {
102
        return lastAckReference;
103
    }
104
105
    /**
106
     * Compact diagnostic snapshot for NET_MOVING false-positive analysis.
107
     */
108
    public String getDebugState(final long now) {
109
        final StringBuilder builder = new StringBuilder(300);
110
        lock.lock();
111
        builder.append("expectOutgoing=").append(expectOutgoing == null ? "none" : expectOutgoing.toString());
112
        builder.append(",expectIncomingSize=").append(expectIncoming.size());
113
        if (!expectIncoming.isEmpty()) {
114
            builder.append(",incomingFirst=").append(formatCountable(expectIncoming.getFirst(), now));
115
            builder.append(",incomingLast=").append(formatCountable(expectIncoming.getLast(), now));
116
        }
117
        builder.append(",lastAck=").append(lastAck == null ? "none" : formatCountable(lastAck, now));
118
        builder.append(",ackRef=lastOutgoing:").append(lastAckReference.lastOutgoingId)
119
                .append("/maxConfirmed:").append(lastAckReference.maxConfirmedId);
120
        builder.append(",maxAge=").append(maxAge);
121
        lock.unlock();
122
        return builder.toString();
123
    }
124
125
    private String formatCountable(final CountableLocation ref, final long now) {
126
        final StringBuilder builder = new StringBuilder(160);
127
        builder.append(ref.toString());
128
        builder.append(",age=");
129
        builder.append(now >= ref.time ? now - ref.time : -(ref.time - now));
130
        return builder.toString();
131
    }
132
133
    /**
134
     * Call for Bukkit events (expect this packet to be sent).<br>
135
     * TODO: The method name is misleading, as this also should be called with
136
     * expected outgoing packet.
137
     * 
138
     * @param packetData
139
     */
140
    public void onTeleportEvent(final double x, final double y, final double z, final float yaw, final float pitch) {
141
        lock.lock();
142
        lastAck = null;
143
        expectOutgoing = new DataLocation(x, y, z, yaw, pitch);
144
        lock.unlock();
145
    }
146
147
    /**
148
     * Call for outgoing teleport packets. Lazily checks for expiration and max
149
     * queue size. Update teleportId (Integer.MIN_VALUE means that it isn't
150
     * provided).
151
     * 
152
     * @param x
153
     * @param y
154
     * @param z
155
     * @param yaw
156
     * @param pitch
157
     * @param teleportId
158
     * @return
159
     */
160
    public CountableLocation onOutgoingTeleport(final double x, final double y, final double z, 
161
            final float yaw, final float pitch, final int teleportId) {
162
        CountableLocation res = null;
163
        final long time = System.currentTimeMillis();
164
        lock.lock();
165
        lastAckReference.lastOutgoingId = teleportId;
166
        if (lastAckReference.maxConfirmedId > lastAckReference.lastOutgoingId) {
167
            lastAckReference.maxConfirmedId = Integer.MIN_VALUE; // Some data loss accepted here.
168
        }
169
        // Only register this location, if it matches the location from a Bukkit event.
170
        if (expectOutgoing != null) {
171
            if (expectOutgoing.isSamePosAndLook(x, y, z, yaw, pitch)) {
172
                // Add to queue.
173
                if (!expectIncoming.isEmpty()) {
174
                    // Lazy expiration check.
175
                    final Iterator<CountableLocation> it = expectIncoming.iterator();
176
                    while (it.hasNext()) {
177
                        final CountableLocation ref = it.next();
178
                        if (time < ref.time) {
179
                            // Time ran backwards. Force keep entries.
180
                            ref.time = time;
181
                        }
182
                        else if (time - maxAge > ref.time) {
183
                            it.remove();
184
                        } else {
185
                            break;
186
                        }
187
                    }
188
                    if (!expectIncoming.isEmpty()) {
189
                        final CountableLocation last = expectIncoming.getLast();
190
                        if (last.isSamePosAndLook(x, y, z, yaw, pitch)) {
191
                            last.time = time;
192
                            last.count ++;
193
                            last.teleportId = teleportId;
194
                            res = last;
195
                        }
196
                    }
197
                }
198
                // Add a new entry, if not merged with last.
199
                if (res == null) {
200
                    res = new CountableLocation(x, y, z, yaw, pitch, 1, time, teleportId);
201
                    expectIncoming.addLast(res);
202
                    // Don't exceed maxQueueSize.
203
                    if (expectIncoming.size() > maxQueueSize) {
204
                        expectIncoming.removeFirst();
205
                    }
206
                }
207
            }
208
            // Reset in any case.
209
            expectOutgoing = null;
210
        }
211
        lock.unlock();
212
        return res;
213
    }
214
215
    /**
216
     * Process ack on receiving a 'confirm teleport' packet.
217
     * 
218
     * @param teleportId
219
     * @return YES, if this teleport id is explicitly matched (not necessarily
220
     *         the latest one), MAYBE if it's a unique id smaller than than
221
     *         maxConfirmedId. NO, if it's not a valid ack - it could be some
222
     *         other special condition, like Integer overflow, or timeout.
223
     */
224
    public AlmostBoolean processAck(final int teleportId) {
225
        /*
226
         * Return values are subject to change, e.g.: (ACK_LATEST_POS),
227
         * ACK_LATEST_ID, ACK_OUTDATED_POS, ACK_OUTDATED_ID, UNKNOWN
228
         */
229
        if (teleportId == Integer.MIN_VALUE) {
230
            // Could consider to return MAYBE for not knowing, needs elaborating on context and use cases.
231
            return AlmostBoolean.NO;
232
        }
233
        lock.lock();
234
        if (teleportId == lastAckReference.lastOutgoingId) {
235
            lastAckReference.maxConfirmedId = teleportId;
236
            // Abort here for efficiency.
237
            expectIncoming.clear();
238
            lock.unlock();
239
            return AlmostBoolean.YES;
240
        }
241
        AlmostBoolean ackState = AlmostBoolean.NO;
242
        final Iterator<CountableLocation> it = expectIncoming.iterator();
243
        while (it.hasNext()) {
244
            final CountableLocation ref = it.next();
245
            // No expiration checks here.
246
            if (ref.teleportId == teleportId) {
247
                // Match an outdated id.
248
                // Remove all preceding older entries and this one.
249
                while (ref != expectIncoming.getFirst()) {
250
                    expectIncoming.removeFirst();
251
                }
252
                expectIncoming.removeFirst();
253
                // The count doesn't count anymore.
254
                ref.count = 0;
255
                ackState = AlmostBoolean.YES;
256
                break;
257
            }
258
        }
259
        // Update lastAckReference only if within the safe area.
260
        if (teleportId < lastAckReference.lastOutgoingId 
261
                && teleportId > lastAckReference.maxConfirmedId) {
262
            // Allow update.
263
            lastAckReference.maxConfirmedId = teleportId;
264
            if (ackState == AlmostBoolean.NO) {
265
                // Adjust to maybe, as long as the id is increasing within unique range.
266
                ackState = AlmostBoolean.MAYBE;
267
            }
268
        }
269
        else {
270
            lastAckReference.maxConfirmedId = Integer.MIN_VALUE;
271
        }
272
        lock.unlock();
273
        return ackState;
274
    }
275
276
    /**
277
     * Accept a movement packet that matches the teleport location from a Bukkit
278
     * event before ProtocolLib has observed the matching outgoing position.
279
     */
280
    public boolean consumeExpectedOutgoingPosition(final DataPacketFlying packetData) {
281
        if (packetData == null || !packetData.hasPos) {
282
            return false;
283
        }
284
        lock.lock();
285
        final boolean match = expectOutgoing != null && expectOutgoing.isSamePos(packetData);
286
        if (match) {
287
            expectOutgoing = null;
288
        }
289
        lock.unlock();
290
        return match;
291
    }
292
293
    /**
294
     * Test if the move is an ACK move (or no ACK is expected), adjust internals
295
     * if necessary.
296
     * 
297
     * @param packetData
298
     * @return ACK, if the packet matches an expected ACK position. IDLE, if no
299
     *         ACK is expected or on timeout. CANCEL, if still waiting for an
300
     *         ACK.
301
     */
302
    public AckResolution processAck(final DataPacketFlying packetData) {
303
        // Check packet.
304
        if (!packetData.hasPos || !packetData.hasLook) {
305
            // Applies, if we don't have a teleport-confirm event.
306
            return AckResolution.IDLE;
307
        }
308
        // Check queue.
309
        final AckResolution res;
310
311
        lock.lock();
312
        if (expectIncoming.isEmpty()) {
313
            res = AckResolution.IDLE;
314
        } else {
315
            res = getAckResolution(packetData);
316
        }
317
        lock.unlock();
318
319
        return res;
320
    }
321
322
    /**
323
     * Check queue (lock is handled outside of this method). Does check for
324
     * expiration of entries. Must only be called under lock.
325
     * 
326
     * @param packetData
327
     * @return
328
     */
329
    private AckResolution getAckResolution(final DataPacketFlying packetData) {
330
        // Iterate from oldest to newest.
331
        final Iterator<CountableLocation> it = expectIncoming.iterator();
332
        while (it.hasNext()) {
333
            final CountableLocation ref = it.next();
334
            if (packetData.time - maxAge >= ref.time) {
335
                it.remove();
336
            }
337
            else if (packetData.isSamePosAndLook(ref)) {
338
                // Match.
339
                // Remove all preceding older entries.
340
                while (ref != expectIncoming.getFirst()) {
341
                    expectIncoming.removeFirst();
342
                }
343
                // Decrease count and remove the matching entry if count is down to 0.
344
                if (--ref.count <= 0) { // (Lots of safety margin.)
345
                    expectIncoming.removeFirst(); // Do not use the iterator here.
346
                }
347
                lastAck = ref;
348
                return AckResolution.ACK;
349
            }
350
            else {
351
                // Skip until match or none found.
352
                // TODO: Consider settings like maxSkipCount or strictly return WAITING.
353
                if (packetData.time < ref.time) {
354
                    // Time ran backwards, update to now.
355
                    ref.time = packetData.time;
356
                }
357
            }
358
        }
359
        // No match.
360
        return expectIncoming.isEmpty() ? AckResolution.IDLE : AckResolution.WAITING;
361
    }
362
363
    public void clear() {
364
        lock.lock();
365
        expectIncoming.clear();
366
        expectOutgoing = null;
367
        lock.unlock();
368
    }
369
370
}

How it counteracts this module

TeleportQueue is the net-side ledger behind NoCheatPlus movement enforcement. The class javadoc states the contract directly: it queues outgoing teleport locations so that other moving is cancelled until the client acknowledges the previous teleport location. Every S08PacketPlayerPosLook the server sends is recorded, and the movement checks only process moves once the client's C03 stream confirms the teleported position.

HideName never touches the teleport stream. Its two packet handlers are receive-side rewrites of S02PacketChat and S3CPacketUpdateScore, and it emits no serverbound packet of any kind, so the ledger sees zero difference while the module is active. The queue matters for a hidden-name setup only through the movement modules that usually accompany it: speed and bhop desyncs generate lag-back teleports, and the client must acknowledge each one in order before further moves are processed, so any movement cheat that fails to confirm the teleport position is set back immediately.

The honest boundary: the name rewriting itself is invisible to every server-side check. No anticheat validates chat or scoreboard rendering, because the rewrite happens after the packets are decoded and only affects the client's display. TeleportQueue is listed here because it is the enforcement layer that remains fully in force for everything else the player does while hidden.

anticheat ActionToggleSpeed (toggle rate)

ActionToggleSpeed.java80 lines · Java
1
/*
2
 * This file is part of Hawk Anticheat.
3
 * Copyright (C) 2018 Hawk Development Team
4
 *
5
 * This program is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
17
 */
18
19
package me.islandscout.hawk.check.movement;
20
21
import me.islandscout.hawk.HawkPlayer;
22
import me.islandscout.hawk.check.CustomCheck;
23
import me.islandscout.hawk.event.Event;
24
import me.islandscout.hawk.event.PlayerActionEvent;
25
import org.bukkit.entity.Player;
26
27
import java.util.HashMap;
28
import java.util.Map;
29
import java.util.UUID;
30
31
/**
32
 * This check limits clients' sprint and sneak toggle rates to
33
 * prevent exploitation of the speed check and combat mechanics.
34
 */
35
public class ActionToggleSpeed extends CustomCheck {
36
37
    private Map<UUID, Long> lastSneakToggle;
38
    private Map<UUID, Long> lastSprintToggle;
39
40
    public ActionToggleSpeed() {
41
        super("actiontogglespeed", "%player% failed action toggle speed, VL: %vl%");
42
        lastSneakToggle = new HashMap<>();
43
        lastSprintToggle = new HashMap<>();
44
    }
45
46
    @Override
47
    protected void check(Event e) {
48
        if(!(e instanceof PlayerActionEvent))
49
            return;
50
        PlayerActionEvent aE = (PlayerActionEvent)e;
51
        PlayerActionEvent.PlayerAction action = aE.getAction();
52
        HawkPlayer pp = e.getHawkPlayer();
53
        UUID uuid = e.getPlayer().getUniqueId();
54
        if(action == PlayerActionEvent.PlayerAction.SNEAK_START || action == PlayerActionEvent.PlayerAction.SNEAK_STOP) {
55
56
            if(pp.getCurrentTick() - lastSneakToggle.getOrDefault(uuid, 0L) < 1) {
57
                punish(pp, canCancel(), e);
58
            } else {
59
                reward(pp);
60
            }
61
62
            lastSneakToggle.put(uuid, pp.getCurrentTick());
63
        } else if(action == PlayerActionEvent.PlayerAction.SPRINT_START || action == PlayerActionEvent.PlayerAction.SPRINT_STOP) {
64
65
            if(pp.getCurrentTick() - lastSprintToggle.getOrDefault(uuid, 0L) < 1) {
66
                punish(pp, canCancel(), e);
67
            } else {
68
                reward(pp);
69
            }
70
71
            lastSprintToggle.put(uuid, pp.getCurrentTick());
72
        }
73
    }
74
75
    public void removeData(Player p) {
76
        UUID uuid = p.getUniqueId();
77
        lastSneakToggle.remove(uuid);
78
        lastSprintToggle.remove(uuid);
79
    }
80
}

How it counteracts this module

Hawk's ActionToggleSpeed keeps per-player timestamps for the two toggle actions that arrive as C0BPacketEntityAction: lastSneakToggle and lastSprintToggle. Each PlayerActionEvent is checked against the stored timestamp, and toggles that arrive faster than the tolerated cadence are punished, with the violation decaying over time. It exists to bound toggle spam from movement and speed modules that repeatedly re-assert sneak or sprint state every few ticks.

HideName sends no C0B packets at all: its handlers only mutate the chat component and scoreboard fields of incoming S02 and S3C packets before they render. The toggle-rate ledger is therefore completely unaffected by the module, and the check punishes the actual toggle spam of companion modules, sprint re-asserters and bhop toggles, at full strength.

The boundary: the check only fires on toggles faster than the threshold. A player who runs HideName with no other module generates no C0B traffic and is never seen by it; the name hide adds nothing to the wire, so any detection of the player comes exclusively from the movement behavior the check is designed for.

anticheat Speed (horizontal envelope)

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

How it counteracts this module

Arc-v2's Speed check rebuilds the allowed horizontal motion from world state. The constructor reads the configurable ceilings for ice, ice-block, block-move and step modifiers, and the per-move check compares the reported horizontal delta against the envelope with potion-effect modifiers applied, punishing distances that exceed what the player's movement mode and speed effects allow.

HideName contributes zero motion. The module rewrites only the display fields of incoming chat and scoreboard packets, so the player's reported position and velocity are exactly what the vanilla client sends; the Speed envelope sees a normal player and passes. It stays relevant to a hidden-name setup in the same way as the other two entries: any horizontal speed module running in the same session moves the reported deltas past the envelope, and Speed flags it independently of the name rewrite.

The boundary is complete on the display side: no anticheat can see the username substitution, because it never reaches the server. The three checks in this entry list are the enforcement that remains for the rest of the cheat setup, and none of them is weakened by HideName being on.

← Back to Analysis Hub