Memeware 7.3 Death Insult module 1 files, 78 lines

Memeware 7.3 Death Insult: Full Source Analysis

Memeware 7.3's Death Insult module watches the inbound S02PacketChat stream and turns the local player's kills into an automatic trash-talk broadcast.

me/memewaredevs/client/module/misc/DeathInsult.java · GitHub source ↗

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

Packets This Module Uses

Analysis

Overview

Memeware 7.3's Death Insult module watches the inbound S02PacketChat stream and turns the local player's kills into an automatic trash-talk broadcast. One LWJEB handler on PacketInEvent unpacks each chat packet's unformatted text and matches it against a set of death-message patterns - 'killed by <name>', 'slain by <name>', the void/fall/magic escape variants, the Spanish 'asesino ha' form, and the 'You recieved a reward for killing' server-reward line. On a match it sends a C01PacketChatMessage composed of one randomly chosen insult from a hardcoded 58-line pool plus a freshly generated 12-character hex token in brackets. The module has no throttle and no memory of prior responses: every matching S02 triggers one send, so a kill streak becomes a burst of insults, each one textually unique thanks to the random suffix.

Architecture

The module is one @Handler Consumer<PacketInEvent> plus a static message pool. The handler guards on the local player existing and the packet being an S02PacketChat, then reads func_148915_c().getUnformattedText() - the chat component's plain text with formatting codes stripped - and runs a chain of contains() tests plus one startsWith/contains pair. The patterns cover the standard vanilla death messages ('killed by', 'slain by', 'void while escaping', 'was killed with magic while fighting', 'couldn't fly while escaping', 'fell to their death while escaping'), a Spanish localization form (player name, an opening parenthesis and 'asesino ha'), and two reward lines ('You recieved a reward for killing', 'You have been rewarded $50 and 2 point(s)!'). Every test embeds mc.thePlayer.getName(), so only messages naming the local player match. There is no cooldown, no seen-message cache, and no enabled-state interaction beyond the handler itself: each matching S02 yields exactly one sendChatMessage.

Message generation

randomMessage() picks from a static 58-entry array with RandomUtils.nextInt(0, randomMessages.length - 1), which draws indices in [0, 57) - the last entry ('did you forget the attack button?') is unreachable by the off-by-one bound. The chosen line is concatenated with ' [' and RandomStringUtils.random(12, 'abcdef0123456789'), producing e.g. 'I don't cheat, you just need to click faster [3f9a2c1b7d4e]'. The hex token is regenerated per message, so two responses are never byte-identical even when the same insult is drawn twice. The send path is mc.thePlayer.sendChatMessage, which constructs a C01PacketChatMessage through the vanilla chat pipeline; since the insult text starts with a letter, the Commands module's dot-prefix interceptor leaves it alone. The pool itself is a mix of taunts and edgy one-liners stored inline in the class, which is why the module needs no supporting file.

Wire behavior

Outbound, the server sees normal chat: one C01 per matching death message, at the player's discretion of timing (death events), with content drawn from a closed 58-string pool plus a random hex suffix. Inbound, the module depends entirely on the server broadcasting death notifications as S02 chat - on servers that announce kills through titles, action bars or scoreboards instead, the patterns never match and the module is inert. Because there is no response cache, a kill streak produces one insult per kill with no gap control, and any server plugin that rewrites death text (prefixes, color, translated wording) silently breaks the string matches. The hex suffix is the module's one deliberate evasion device: it exists so repeated kills do not produce repeated chat lines for repeat-message filters to catch.

source DeathInsult.java (death-message trigger and insult sender)

DeathInsult.java78 lines · JavaOriginal ↗
1
/*
2
 * Decompiled with CFR 0.145.
3
 *
4
 * Could not load the following classes:
5
 *  org.apache.commons.lang3.RandomUtils
6
 */
7
package me.memewaredevs.client.module.misc;
8
9
import me.hippo.api.lwjeb.annotation.Handler;
10
import me.memewaredevs.client.event.events.PacketInEvent;
11
import me.memewaredevs.client.module.Module;
12
import net.minecraft.network.play.server.S02PacketChat;
13
import org.apache.commons.lang3.RandomStringUtils;
14
import org.apache.commons.lang3.RandomUtils;
15
16
import java.util.function.Consumer;
17
18
public class DeathInsult extends Module {
19
	public DeathInsult() {
20
		super("Death Insult", 0, Module.Category.MISC);
21
	}
22
23
	public static String randomMessage() {
24
		final String[] randomMessages = { "Did ur parents ask you to run away",
25
				"I'd tell you to uninstall, but your aim is so bad you wouldn't hit the button.",
26
				"You do be lookin' kinda bad at the game", "Did someone leave your cage open?",
27
				"rage at me on discord Dort#0001", "Is being in the spectator mode fun?",
28
				" you're the type of guy to quickdrop irl", "you got a solid 0% on the iq test.",
29
				"I understand why your parents abused you", "Do you practice being this bad?",
30
				"your aim is sponsored by Parkinson's", "go take a long walk on a short bridge",
31
				"mans probably plays fortnite lmao.", "plz no repotr i no want ban !",
32
				"you probably have the coronavirus.", "you really like taking L's.", "drown in your own salt",
33
				"I'm not saying you're worthless, but i'd unplug ur life support to charge my phone.",
34
				"could you please commit not alive?", "I don't cheat, you just need to click faster",
35
				"I speak english not your gibberish", "Your mom do be lookin' kinda black doe",
36
				"Hey look! It's a fortnite player", "Need some pvp advice? ", " do you really like dying this much?",
37
				"you probably reported me, which means you have geay.", "you're the type to get 3rd place in a 1v1.",
38
				"how does it feel to get stomped on?", "you are the type of guy to use sigma.",
39
				" that's a #VictoryRoyale! better luck next time!", "lol you probably speak dog eater",
40
				"is a fricking niggler", "I'm black and this a robbery",
41
				"even your mom is better than you in this game.", "go back to fortnite you degenerate.",
42
				"your iq is that of a steve.", "go commit stop breathing plz",
43
				"your parents abandoned you, then the orphanage did the same", "you probably bought sigma premium",
44
				"mans probably got an error on his hello world program lmao",
45
				"how'd you hit the download button with that aim", "Someone in 1940 forgot to gas you",
46
				"did your dad go get milk and went missing?", "mans thinks that his ping is equal to his iq.",
47
				"stop eating dogs", "if the body is 70% water then how is your body 100% salt?",
48
				"mans got thrown at a brick wall by his parents when he was 2 years old.",
49
				"you don't have parents, now that's an L",
50
				"how are you so bad? im losing brain cells while watching you play",
51
				"even lolitsalex has more wins than you",
52
				"some kids were dropped at birth, but you got thrown at the wall.", "i dont hack i just meme", "memeware by dort", "did you forget the attack button?"};
53
54
		return randomMessages[RandomUtils.nextInt(0, randomMessages.length - 1)];
55
	}
56
57
	@Handler
58
	public Consumer<PacketInEvent> eventConsumer0 = event -> {
59
		if (this.mc.thePlayer != null && this.mc.thePlayer.ticksExisted >= 0
60
				&& event.getPacket() instanceof S02PacketChat) {
61
			final String look = "killed by " + mc.thePlayer.getName();
62
			final String look2 = "slain by " + mc.thePlayer.getName();
63
			final String look3 = "void while escaping " + mc.thePlayer.getName();
64
			final String look4 = "was killed with magic while fighting " + mc.thePlayer.getName();
65
			final String look5 = "couldn't fly while escaping " + mc.thePlayer.getName();
66
			final String look6 = "fell to their death while escaping " + mc.thePlayer.getName();
67
			final String look7 = "You recieved a reward for killing ";
68
			final S02PacketChat cp = (S02PacketChat) event.getPacket();
69
			final String cp21 = cp.func_148915_c().getUnformattedText();
70
			if ((cp21.startsWith(mc.thePlayer.getName() + "(") && cp21.contains("asesino ha")) || cp21.contains(look)
71
					|| cp21.contains(look2) || cp21.contains(look3)
72
					|| cp21.contains("You have been rewarded $50 and 2 point(s)!") || cp21.contains(look4) || cp21.contains(look5) || cp21.contains(look6) || cp21.contains(look7)) {
73
				this.mc.thePlayer.sendChatMessage("" + DeathInsult.randomMessage() + " ["
74
						+ RandomStringUtils.random(12, "abcdef0123456789") + "]");
75
			}
76
		}
77
	};
78
}

What this file does

The file is self-contained: a static randomMessage() with the 58-line insult pool and the eventConsumer0 handler over PacketInEvent. The handler reads each S02PacketChat's unformatted text, applies the contains()/startsWith() pattern chain built around mc.thePlayer.getName(), and on any match calls sendChatMessage with the insult plus a fresh 12-hex-character bracket token from RandomStringUtils. Notable details: RandomUtils.nextInt(0, randomMessages.length - 1) makes the array's last entry unreachable; there is no cooldown or deduplication, so a kill streak yields one send per matching packet; and the pattern set includes a Spanish 'asesino ha' form and two reward lines ('You recieved a reward for killing', 'You have been rewarded $50 and 2 point(s)!') in addition to the vanilla death messages. The module touches no client utility - the send path is the vanilla sendChatMessage - which is why the analysis has a single file.

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 NoCheatPlus Text (repeat, notLetter and frequency scoring)

Text.java331 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.chat;
16
17
import java.util.Collections;
18
import java.util.LinkedList;
19
import java.util.List;
20
import java.util.Map;
21
22
import org.bukkit.entity.Player;
23
24
import fr.neatmonster.nocheatplus.NCPAPIProvider;
25
import fr.neatmonster.nocheatplus.checks.Check;
26
import fr.neatmonster.nocheatplus.checks.CheckType;
27
import fr.neatmonster.nocheatplus.checks.chat.analysis.MessageLetterCount;
28
import fr.neatmonster.nocheatplus.checks.chat.analysis.WordLetterCount;
29
import fr.neatmonster.nocheatplus.checks.chat.analysis.engine.LetterEngine;
30
import fr.neatmonster.nocheatplus.checks.combined.CombinedData;
31
import fr.neatmonster.nocheatplus.components.NoCheatPlusAPI;
32
import fr.neatmonster.nocheatplus.components.registry.feature.INotifyReload;
33
import fr.neatmonster.nocheatplus.config.ConfigFile;
34
import fr.neatmonster.nocheatplus.config.ConfigManager;
35
import fr.neatmonster.nocheatplus.players.IPlayerData;
36
import fr.neatmonster.nocheatplus.utilities.ColorUtil;
37
import fr.neatmonster.nocheatplus.utilities.StringUtil;
38
39
/**
40
 * Some alternative more or less advanced analysis methods.
41
 * @author asofold
42
 *
43
 */
44
public class Text extends Check implements INotifyReload {
45
46
    private LetterEngine engine = null;
47
48
    /** Not really cancelled but above threshold for actions. */
49
    private String lastCancelledMessage = "";
50
    private long lastCancelledTime = 0;
51
52
    private String lastGlobalMessage = "";
53
    private long lastGlobalTime = 0;
54
55
    public Text() {
56
        super(CheckType.CHAT_TEXT);
57
        init();
58
    }
59
60
    /**
61
     * Start analysis.
62
     * @param player
63
     *          The player who issued the message.
64
     * @param message
65
     *          The message to check.
66
     * @param captcha 
67
     *          Used for starting captcha on failure, if configured so.
68
     * @param alreadyCancelled 
69
     * @return
70
     */
71
    public boolean check(final Player player, final String message, 
72
                         final ChatConfig cc, final IPlayerData pData,
73
                         final ICaptcha captcha, boolean isMainThread, final boolean alreadyCancelled) {
74
        final ChatData data = pData.getGenericInstance(ChatData.class);
75
        synchronized (data) {
76
            return unsafeCheck(player, message, captcha, cc, data, pData, isMainThread, alreadyCancelled);
77
        }
78
    }
79
80
    private void init() {
81
        // Set some things from the global config.
82
        final ConfigFile config = ConfigManager.getConfigFile();
83
        final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
84
        if (engine != null) {
85
            engine.clear();
86
            api.removeComponent(engine);
87
        }
88
        engine = new LetterEngine(config);
89
        api.addComponent(engine);
90
    }
91
92
    @Override
93
    public void onReload() {
94
        synchronized(engine) {
95
            engine.clear();
96
        }
97
        init();
98
    }
99
100
    /**
101
     * Check without further synchronization.
102
     * @param player
103
     * @param message
104
     * @param captcha
105
     * @param cc
106
     * @param data
107
     * @param isMainThread 
108
     * @param alreadyCancelled 
109
     * @return
110
     */
111
    private boolean unsafeCheck(final Player player, final String message, final ICaptcha captcha,
112
                                final ChatConfig cc, final ChatData data, final IPlayerData pData,
113
                                boolean isMainThread, final boolean alreadyCancelled) {
114
115
        // Test captcha.
116
        if (captcha.shouldCheckCaptcha(player, cc, data, pData)) {
117
            captcha.checkCaptcha(player, message, cc, data, isMainThread);
118
            return true;
119
        } 
120
        else if (alreadyCancelled) {
121
            // Skip checking.
122
            return true;
123
        }
124
125
        final long time = System.currentTimeMillis();
126
        final String lcMessage = message.trim().toLowerCase();
127
        boolean cancel = false;
128
        final boolean debug = pData.isDebugActive(type);
129
        final List<String> debugParts;
130
        if (debug) {
131
            debugParts = new LinkedList<String>();
132
            debugParts.add("Message (length=" + message.length()+"): ");
133
        }
134
        else debugParts = null;
135
136
        // Update the frequency interval weights.
137
        data.chatFrequency.update(time);
138
139
        // Score for this message (violation score).
140
        float score = 0;
141
        final MessageLetterCount letterCounts = new MessageLetterCount(message);
142
        final int msgLen = message.length();
143
144
145
146
        // (Following: random/made up criteria.)
147
        // TODO: Create tests for all methods with wordlists, fake chat (refactor for that).
148
        // Full message processing. ------------
149
        // Upper case.
150
        if (letterCounts.fullCount.upperCase > msgLen / 3) {
151
            // TODO: Regard chunks of 48 or so letters of the message for this?
152
            final float wUpperCase = 0.6f * letterCounts.fullCount.getUpperCaseRatio();
153
            score += wUpperCase  * cc.textMessageUpperCase;
154
        }
155
156
        // Letters vs. word length.
157
        if (msgLen > 4) {
158
            final float fullRep = letterCounts.fullCount.getLetterCountRatio();
159
            // Long messages: very small and very big are bad !
160
            // 128 is a quick attempt to make one long message possible on 1.11.
161
            final float wRepetition = (float) Math.min(msgLen, 128) / 15.0f * Math.abs(0.5f - fullRep);
162
            score += wRepetition * cc.textMessageLetterCount;
163
164
            // Number of words vs. length of message
165
            final float fnWords = (float) letterCounts.words.length / (float) msgLen;
166
            if (fnWords > 0.75f) { // TODO: balance or configure or remove ?
167
                score += fnWords  * cc.textMessagePartition;
168
            }
169
        }
170
171
        final CombinedData cData = pData.getGenericInstance(CombinedData.class);
172
        final long timeout = 8000; // TODO: maybe set dynamically in data.
173
        // Repetition of last message.
174
        if (cc.textMsgRepeatSelf != 0f && time - data.chatLastTime < timeout) {
175
            if (StringUtil.isSimilar(lcMessage, data.chatLastMessage, 0.8f)) {
176
                final float timeWeight = (float) (timeout - (time - data.chatLastTime)) / (float) timeout; 
177
                score += cc.textMsgRepeatSelf * timeWeight;
178
            }
179
        }
180
        // Repetition of last global message.
181
        if (cc.textMsgRepeatGlobal != 0f && time - lastGlobalTime < timeout) {
182
            if (StringUtil.isSimilar(lcMessage, lastGlobalMessage, 0.8f)) {
183
                final float timeWeight = (float) (timeout - (time - lastGlobalTime)) / (float) timeout; 
184
                score += cc.textMsgRepeatGlobal * timeWeight;
185
            }
186
        }
187
        // Repetition of last cancelled message.
188
        if (cc.textMsgRepeatCancel != 0f && time - lastCancelledTime < timeout) {
189
            if (StringUtil.isSimilar(lcMessage, lastCancelledMessage, 0.8f)) {
190
                final float timeWeight = (float) (timeout - (time - lastCancelledTime)) / (float) timeout; 
191
                score += cc.textMsgRepeatCancel * timeWeight;
192
            }
193
        }
194
        // Chat quickly after join.
195
        if (cc.textMsgAfterJoin != 0f && time - cData.lastJoinTime < timeout) {
196
            final float timeWeight = (float) (timeout - (time - cData.lastJoinTime)) / (float) timeout;
197
            score += cc.textMsgAfterJoin * timeWeight; 
198
        }
199
        // Chat without moving.
200
        if (cc.textMsgNoMoving != 0f && time - cData.lastMoveTime > timeout) {
201
            score += cc.textMsgNoMoving;
202
        }
203
204
205
206
        // Per word checks. -------------------
207
        float wWords = 0.0f;
208
        final float avwLen = (float) msgLen / (float) letterCounts.words.length; 
209
        for (final WordLetterCount word : letterCounts.words) {
210
            float wWord = 0.0f;
211
            final int wLen = word.word.length();
212
            // TODO: ? used letters vs. word length.
213
214
            // Length of word vs. av. word length.
215
            final float fLenAv = Math.abs(avwLen - (float) wLen) / avwLen;
216
            wWord += fLenAv * cc.textMessageLengthAv;
217
218
            // Length of word vs. message length;
219
            final float fLenMsg = (float) wLen / (float) msgLen;
220
            wWord += fLenMsg * cc.textMessageLengthMsg;
221
222
            // Not letter:
223
            float notLetter = word.getNotLetterRatio();
224
            notLetter *= notLetter;
225
            wWord += notLetter * cc.textMessageNoLetter;
226
227
            wWord *= wWord; // TODO: quadratic ? (configurable)
228
            wWords += wWord;
229
        }
230
        wWords /= (float) letterCounts.words.length;
231
        score += wWords;
232
233
        if (debug && score > 0f) {
234
            debugParts.add("Simple score: " + StringUtil.fdec3.format(score));
235
        }
236
237
        // Engine:
238
        // TODO: more fine grained sync !
239
        float wEngine = 0f;
240
        final Map<String, Float> engMap;
241
        synchronized (engine) {
242
            engMap = engine.process(letterCounts, player.getName(), cc, data);
243
            // TODO: more fine grained sync !s
244
            // TODO: different methods (add or max or add+max or something else).
245
            for (final Float res : engMap.values()) {
246
                if (cc.textEngineMaximum) {
247
                    wEngine = Math.max(wEngine, res.floatValue());
248
                }
249
                else wEngine += res.floatValue();
250
            }
251
        }
252
        score += wEngine;
253
254
255
        // Wrapping it up. --------------------
256
        // Add weight to frequency counts.
257
        final float normalScore = Math.max(cc.textFreqNormMin, score);
258
        data.chatFrequency.add(time, normalScore);
259
        final float accumulated = cc.textFreqNormWeight * data.chatFrequency.score(cc.textFreqNormFactor);
260
        final boolean normalViolation = accumulated > cc.textFreqNormLevel;
261
        final float shortTermScore = Math.max(cc.textFreqShortTermMin, score);
262
        data.chatShortTermFrequency.add(time, shortTermScore);
263
        // TODO: very short term (1st bucket) or do it indirectly.
264
        final float shortTermAccumulated = cc.textFreqShortTermWeight * data.chatShortTermFrequency.score(cc.textFreqShortTermFactor);
265
        final boolean shortTermViolation = shortTermAccumulated > cc.textFreqShortTermLevel;
266
267
        if (normalViolation || shortTermViolation) {
268
            lastCancelledMessage = lcMessage;
269
            lastCancelledTime = time;
270
271
            final double added;
272
            if (shortTermViolation) {
273
                added = (shortTermAccumulated - cc.textFreqShortTermLevel)/ 3.0;
274
            } 
275
            else added = (accumulated - cc.textFreqNormLevel) / 10.0; 
276
            data.textVL += added;
277
278
            if (captcha.shouldStartCaptcha(player, cc, data, pData)) {
279
                captcha.sendNewCaptcha(player, cc, data);
280
                cancel = true;
281
            }
282
            else {
283
                if (shortTermViolation) {
284
                    if (executeActions(player, data.textVL, added, cc.textFreqShortTermActions).willCancel()) {
285
                        cancel = true;
286
                    }
287
                }
288
                else if (normalViolation) {
289
                    if (executeActions(player, data.textVL, added, cc.textFreqNormActions).willCancel()) {
290
                        cancel = true;
291
                    }
292
                }
293
            }
294
        }
295
        else if (cc.chatWarningCheck && time - data.chatWarningTime > cc.chatWarningTimeout && (100f * accumulated / cc.textFreqNormLevel > cc.chatWarningLevel || 100f * shortTermAccumulated / cc.textFreqShortTermLevel > cc.chatWarningLevel)) {
296
            NCPAPIProvider.getNoCheatPlusAPI().sendMessageOnTick(player.getName(), ColorUtil.replaceColors(cc.chatWarningMessage));
297
            data.chatWarningTime = time;
298
        }
299
        else {
300
            data.textVL *= 0.95;
301
            if (cc.textAllowVLReset && normalScore < 2.0f * cc.textFreqNormWeight && shortTermScore < 2.0f * cc.textFreqShortTermWeight) {
302
                // Reset the VL.
303
                // Maybe elaborate on resetting conditions (after some timeout just divide by two or so?).
304
                data.textVL = 0.0;
305
            }
306
        }
307
308
        if (debug) {
309
            final List<String> keys = new LinkedList<String>(engMap.keySet());
310
            Collections.sort(keys);
311
            for (String key : keys) {
312
                Float s = engMap.get(key);
313
                if (s.floatValue() > 0.0f)
314
                    debugParts.add(key + ":" + StringUtil.fdec3.format(s));
315
            }
316
            if (wEngine > 0.0f)
317
                debugParts.add("Engine score (" + (cc.textEngineMaximum?"max":"sum") + "): " + StringUtil.fdec3.format(wEngine));
318
319
            debugParts.add("Final score: " +  StringUtil.fdec3.format(score));
320
            debugParts.add("Normal: min=" +  StringUtil.fdec3.format(cc.textFreqNormMin) +", weight=" +  StringUtil.fdec3.format(cc.textFreqNormWeight) + " => accumulated=" + StringUtil.fdec3.format(accumulated));
321
            debugParts.add("Short-term: min=" +  StringUtil.fdec3.format(cc.textFreqShortTermMin) +", weight=" +  StringUtil.fdec3.format(cc.textFreqShortTermWeight) + " => accumulated=" + StringUtil.fdec3.format(shortTermAccumulated));
322
            debugParts.add("vl: " + StringUtil.fdec3.format(data.textVL));
323
            debug(player, StringUtil.join(debugParts, " | "));
324
            debugParts.clear();
325
        }
326
327
        lastGlobalMessage = data.chatLastMessage = lcMessage;
328
        lastGlobalTime = data.chatLastTime = time;
329
        return cancel;
330
    }
331
}

How it counteracts this module

NCP's Text check scores exactly the messages this module emits. The strongest specific hit is the hex token: each message ends in a 14-character bracket word like '[3f9a2c1b7d4e]' whose characters are all non-letters, and the per-word path computes getNotLetterRatio() squared (lines 209-231), so that single token contributes a large squared weight to every insult. The frequency accumulators - chatFrequency and chatShortTermFrequency with minimum floors and windowed levels (lines 257-265) - then carry that weight: a kill streak is a burst of insults at death-event rate, which is exactly the short-term burst pattern the short-term accumulator exists to catch, and each violation adds to textVL and triggers captcha or actions (lines 267-294).

The repeat-similarity path is where the module's evasion shows: isSimilar(lcMessage, chatLastMessage, 0.8f) within 8000ms (lines 174-179) compares full messages, and the regenerated hex suffix makes consecutive insults differ, so back-to-back kills are not caught by text similarity alone - the suffix exists precisely to defeat this. The honest residual is that the same insult line drawn twice (roughly 1 in 58 per pair) within 8 seconds still trips the comparison, and the no-moving penalty (textMsgNoMoving, lines 200-202) applies to a player standing still while the insults go out. Content-wise the fixed 58-line pool is also finite: over a long session the engine and word processors see the same taunts repeatedly, feeding the per-word scoring.

anticheat NoCheatPlus Captcha (auto-armed chat gate)

Captcha.java115 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.chat;
16
17
import java.util.concurrent.ThreadLocalRandom;
18
19
import org.bukkit.entity.Player;
20
21
import fr.neatmonster.nocheatplus.checks.Check;
22
import fr.neatmonster.nocheatplus.checks.CheckType;
23
import fr.neatmonster.nocheatplus.players.DataManager;
24
import fr.neatmonster.nocheatplus.players.IPlayerData;
25
import fr.neatmonster.nocheatplus.utilities.ColorUtil;
26
27
/**
28
 * NOTE: EARLY REFACTORING STATE, MOST METHODS NEED SYNC OVER DATA !
29
 * @author mc_dev
30
 *
31
 */
32
public class Captcha extends Check implements ICaptcha{
33
34
    public Captcha() {
35
        super(CheckType.CHAT_CAPTCHA);
36
    }
37
38
    @Override
39
    public void checkCaptcha(Player player, String message, ChatConfig cc, ChatData data, boolean isMainThread) {
40
        // Correct answer to the captcha?
41
        if (message.equals(data.captchaGenerated)) {
42
            // Yes, clear their data and do not worry anymore about them.
43
            data.reset();
44
            data.captchaStarted = false;
45
            player.sendMessage(ColorUtil.replaceColors(cc.captchaSuccess));
46
        } 
47
        else {
48
            // Increment their tries number counter.
49
            data.captchTries++;
50
            data.captchaVL ++;
51
            // Have they failed too man times?
52
            if (data.captchTries > cc.captchaTries) {
53
                // Find out if we need to kick the player or not.
54
                executeActions(player, data.captchaVL, 1, cc.captchaActions);
55
                // (Resetting captcha tries is done on quit/kick).
56
            }
57
            // Display the question again (if not kicked).
58
            if (player.isOnline()) {
59
                sendCaptcha(player, cc, data);
60
            }
61
        }
62
    }
63
64
    @Override
65
    public void sendNewCaptcha(Player player, ChatConfig cc, ChatData data) {
66
        // Display a captcha to the player.
67
        generateCaptcha(cc, data, true);
68
        sendCaptcha(player, cc, data);
69
        data.captchaStarted = true;
70
    }
71
72
    @Override
73
    public void generateCaptcha(ChatConfig cc, ChatData data, boolean reset) {
74
        if (reset) data.captchTries = 0;
75
        final char[] chars = new char[cc.captchaLength];
76
        for (int i = 0; i < cc.captchaLength; i++) {
77
            chars[i] = cc.captchaCharacters.charAt(ThreadLocalRandom.current().nextInt(cc.captchaCharacters.length()));
78
        }
79
        data.captchaGenerated = new String(chars);
80
    }
81
82
    @Override
83
    public void resetCaptcha(Player player){
84
        final IPlayerData pData = DataManager.getPlayerData(player);
85
        ChatData data = pData.getGenericInstance(ChatData.class);
86
        synchronized (data) {
87
            resetCaptcha(player, pData.getGenericInstance(ChatConfig.class), data, pData);
88
        }
89
    }
90
91
    @Override
92
    public void resetCaptcha(Player player, ChatConfig cc, ChatData data, IPlayerData pData) {
93
        data.captchTries = 0;
94
        if (shouldCheckCaptcha(player, cc, data, pData) || shouldStartCaptcha(player, cc, data, pData)){
95
            generateCaptcha(cc, data, true);
96
        }
97
    }
98
99
    @Override
100
    public void sendCaptcha(Player player, ChatConfig cc, ChatData data) {
101
        player.sendMessage(ColorUtil.replaceColors(cc.captchaQuestion.replace("[captcha]", data.captchaGenerated)));
102
    }
103
104
    @Override
105
    public boolean shouldStartCaptcha(Player player, ChatConfig cc, ChatData data, IPlayerData pData) {
106
        // TODO: Only call if IWorldData.isCheckActive(CHAT_CAPTCHA) has returned true?
107
        return !data.captchaStarted && pData.isCheckActive(CheckType.CHAT_CAPTCHA, player);
108
    }
109
110
    @Override
111
    public boolean shouldCheckCaptcha(Player player, ChatConfig cc, ChatData data, IPlayerData pData) {
112
        // TODO: Only call if IWorldData.isCheckActive(CHAT_CAPTCHA) has returned true?
113
        return data.captchaStarted  && pData.isCheckActive(CheckType.CHAT_CAPTCHA, player);
114
    }
115
}

How it counteracts this module

A kill-streak burst that trips Text's short-term accumulator arms the captcha: shouldStartCaptcha (lines 105-108) returns true while CHAT_CAPTCHA is active and no captcha is pending, and Text calls sendNewCaptcha on the first violation (Text line 278). The captcha is a random string of cc.captchaLength characters, and checkCaptcha accepts only message.equals(data.captchaGenerated) - an exact match (line 41). The module has no way to comply: it cannot detect the captcha question in the inbound stream (its patterns match only death lines), and its next send is the next insult, which fails the equality test, increments captchTries and captchaVL, and after cc.captchaTries attempts executes cc.captchaActions (lines 47-61).

The interaction is therefore self-escalating: the more kills the player gets, the more insults the module sends, the faster the failed captcha attempts accumulate, and the server's configured kick/ban action fires while the module keeps churning out wrong answers. The only escape is manual intervention - disabling the module and typing the exact generated string - which the module's design cannot perform. This is the cleanest server-side counter available: it does not need to identify the insult text at all, only to survive the burst long enough to arm the gate.

anticheat Spartan ChatEvent (chat hook, no chat analysis)

ChatEvent.java19 lines · Java
1
package ai.idealistic.spartan.listeners.bukkit.standalone;
2
3
import ai.idealistic.spartan.abstraction.protocol.PlayerProtocol;
4
import ai.idealistic.spartan.functionality.concurrent.CheckThread;
5
import ai.idealistic.spartan.functionality.server.PluginBase;
6
import org.bukkit.event.EventHandler;
7
import org.bukkit.event.EventPriority;
8
import org.bukkit.event.Listener;
9
import org.bukkit.event.player.AsyncPlayerChatEvent;
10
11
public class ChatEvent implements Listener {
12
13
    @EventHandler(priority = EventPriority.HIGHEST)
14
    private void Event(AsyncPlayerChatEvent e) {
15
        PlayerProtocol p = PluginBase.getProtocol(e.getPlayer());
16
        CheckThread.run(null, () -> p.executeRunners(e.isCancelled(), e));
17
    }
18
19
}

How it counteracts this module

Spartan's only chat-side hook is this standalone listener: @EventHandler at EventPriority.HIGHEST on AsyncPlayerChatEvent, whose body resolves the player's protocol wrapper and hands the event to the check-runner thread via p.executeRunners(e.isCancelled(), e). The honest note is that the corpus contains no Spartan chat-content or spam check consuming this event - it is a dispatch shim into Spartan's runner framework, so it neither detects nor blocks the insult stream by itself.

What it does establish is the message's exposure: Spartan listens at HIGHEST, so any moderation plugin at NORMAL or LOW priority sees the raw AsyncPlayerChatEvent first, including the 'insult [hex12]' shape. The bracket-token format is a trivially regexable tell ('\[[0-9a-f]{12}\]' at end of message) that no legitimate player produces, and the death-triggered timing (a chat line appearing within a second of every kill) is visible to any plugin that correlates chat with death events. The countering story is therefore ecosystem-level: Spartan itself contributes nothing, but the event chain it sits in exposes exactly the fingerprint a plugin-based filter would key on.

← Back to Analysis Hub