0x02 S02PacketChat
Server sends a chat message or command response to the client.
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| chatComponent | IChatComponent | The chat message or command response |
| type | byte | 0 = chat box, 1 = system message (singleplayer), 2 = above hotbar |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| JSON Data | Chat Component | The chat message JSON |
| Position | byte | 0=chat, 1=system, 2=actionbar |
MCP References
NetHandlerPlayClient.handleChat()Handler Interface
INetHandlerPlayClientNotes
Vanilla Source
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | |
| 29 | |
| 30 | |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | |
| 38 | |
| 39 | |
| 40 | |
| 41 | |
| 42 | |
| 43 | |
| 44 | |
| 45 | |
| 46 | |
| 47 | |
| 48 | |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | |
| 73 | |
Deobfuscated MCP 1.8.9 source of S02PacketChat, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S02PacketChat.java) at build time and verified present.
Deep Dive
Role in the protocol
The single channel for every server-to-client message in the PLAY state: player chat, command output, kill feed, actionbar text, plugin announcements, and anti-cheat notices. The payload is a JSON ChatComponent plus a byte position (0 chat box, 1 system message, 2 actionbar above the hotbar). Vanilla routing is trivial: NetHandlerPlayClient.handleChat sends type 2 to the ingame GUI overlay and everything else to GuiNewChat.printChatMessage. Because every server plugin funnels text through it, it is the most-intercepted clientbound packet in the corpus: 25 non-vanilla file hits across 6 of the 8 clients.
Vanilla handling
handleChat runs PacketThreadUtil.checkThreadAndEnqueue, then branches on the position byte: if (packetIn.func_179841_c() == 2) this.gameController.ingameGUI.func_175188_a(component, false); else this.gameController.ingameGUI.getChatGUI().printChatMessage(component). The component is parsed leniently from JSON; malformed components degrade to plain text rather than disconnecting. Server-side, S02PacketChat is the delivery vehicle: ServerConfigurationManager.sendChatMsgImpl broadcasts it, EntityPlayerMP.addChatMessage sends it per player, and kick/actionbar paths construct it directly.
Why clients touch it
Six families in the corpus. Game-end and lobby automation: Sigma AutoGG, Rise 5.99 AutoHypixel, Rise 6.x AutoPlay (parse the kill feed and the /play click actions in the component's siblings). Staff and identity: Rise 5.99 StaffAlert (captures the Hypixel API key line), Sigma StreamerMode, Spicy HideName, Rise 5.99 Denicker, Rise 6.x Streamer (rewrite or cancel messages that contain the player's name). Kill-feed banter: Memeware DeathInsult, Spicy KillSults. Request automation: Sigma AutoTPA, Rise 5.99 FightBot and BedwarsTP, Tenacity TPKiller, Rise 6.x WatchdogAutoPhase. Auth: Rise 5.99 AutoAuthme reacts to auth-me prompt text. The rest of the field is heterogeneous: Rise Nuker, PlayerHacks, Phase, Disabler, Translator and Ranking, Rise 6.x APIKeyComponent, IRCInfoComponent, AdaptiveRefreshRateComponent (uses S02 as a frame-rate hint), LoggerRCECheck, and the Spicy meme modules. Nekoware v1 is the only client with zero module hits.
Exploit surface
The JSON component is attacker-controlled server text, and the Log4Shell era made that concrete: Rise 6.x ships LoggerRCECheck, a SecurityFeature that pattern-matches ${...} in the unformatted and formatted text of every S02PacketChat (and in S29 sound names) and blocks the packet before it reaches the logger. Beyond RCE, the component's click events carry runCommand actions, which AutoPlay extracts programmatically instead of waiting for a user click. Cancel-and-rerender name protection (StreamerMode) hides the player's name from the local log while the original packet never renders. DeathInsult appends a random hex suffix so message-spam filters cannot match the repeated insult string. Position matters: modules that must react to actionbar text (AutoPlay skips non-chat via isChat()) filter on the type byte.
Server-Side Handling
Server emission points: ServerConfigurationManager.sendChatMsgImpl builds S02PacketChat and broadcasts to all players; EntityPlayerMP.addChatMessage sends to one player; NetHandlerPlayServer wraps kick reasons and actionbar messages. Nothing validates the component server-side because the server is the author of it. The client parses it leniently; the only client-side failure mode is a giant JSON string approaching the 32767-byte String cap, which degrades to a truncated render.
Protocol Analysis
Wire layout: ChatComponent serialized as JSON (String, VarInt length + UTF-8), then a byte position (0 chat, 1 system/singleplayer, 2 actionbar). Components are trees: getFormattedText() includes color codes, getUnformattedText() strips them, getSiblings() exposes the child components where click actions (runCommand/suggestCommand) and hover events live. AutoPlay reads /play commands by splitting a sibling's toString() on quotes. Position 2 messages bypass the chat history and render above the hotbar; isChat() (type == 0) is the standard filter before pattern matching.
Anti-Cheat Landscape
No anti-cheat measures chat content or rate, but anti-cheat messages themselves are data for modules: Tenacity TPKiller and Rise 6.x WatchdogAutoPhase and Nuker read server notices from this packet to trigger or reset their behavior. Server-side, the same channel is the delivery path for ban/kick notices, so watchdog-style anti-cheats both emit through it and are blind to its client-side consumption. The only hard security boundary is injection: LoggerRCECheck exists because a ${...} payload inside a chat component could reach the logging pipeline; the pattern match on both text forms is the mitigation.
implementation Implementation Cases
The chat/actionbar delivery packet and the most-intercepted clientbound packet in the corpus. Six module families parse it: game-end automation, staff detection and name protection, kill-feed banter, request automation, auth-me login, and a long tail of utility and security components. Nekoware v1 alone has zero module hits.
Detect game-end or lobby prompts in chat and react automatically: send gg, queue the next game, or rejoin.
A PacketReceiveEvent listener instanceof-checks S02PacketChat, filters on position, and pattern-matches the component text. Rise 6.x AutoPlay skips non-chat positions via chat.isChat(), looks for a 'play again?' prompt, iterates getSiblings(), and extracts the /play command embedded in a click action by splitting the sibling's toString() on quotes, then sends it via ChatUtil.send. Sigma 4.11 AutoGG matches kill-feed lines and calls ChatUtil to send gg.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/module/impl/other/AutoPlay.java =====
package com.alan.clients.module.impl.other;
import com.alan.clients.component.impl.render.NotificationComponent;
import com.alan.clients.event.Listener;
import com.alan.clients.event.annotations.EventLink;
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
import com.alan.clients.module.Module;
import com.alan.clients.module.api.Category;
import com.alan.clients.module.api.ModuleInfo;
import com.alan.clients.util.chat.ChatUtil;
import com.alan.clients.value.impl.ModeValue;
import com.alan.clients.value.impl.SubMode;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.util.IChatComponent;
@ModuleInfo(aliases = {"module.other.hypixelautoplay.name"}, description = "module.other.hypixelautoplay.description", category = Category.PLAYER)
public final class AutoPlay extends Module {
private final ModeValue mode = new ModeValue("Mode", this)
.add(new SubMode("Hypixel"))
.setDefault("Hypixel");
@EventLink
public final Listener<PacketReceiveEvent> onPacketReceive = event -> {
Packet<?> packet = event.getPacket();
if (packet instanceof S02PacketChat) {
S02PacketChat chat = ((S02PacketChat) packet);
//switch (mode.getValue().getName()) {
//case "Hypixel":
if (mode.getValue().getName().equals("Hypixel")) {
if (chat.isChat()) return;
if (chat.getChatComponent().getFormattedText().contains("play again?")) {
for (IChatComponent iChatComponent : chat.getChatComponent().getSiblings()) {
for (String value : iChatComponent.toString().split("'")) {
if (value.startsWith("/play") && !value.contains(".")) {
ChatUtil.send(value);
NotificationComponent.post("Auto Play", "Joined a new game", 7000);
break;
}
}
}
}
// break;
}
}
};
}
// NOTE (AI): The Hypixel SubMode is the only mode; the listener reads getFormattedText() so click-event JSON inside the component is preserved, then splits a sibling's toString() on single quotes to pull the /play runCommand value out.
// NOTE (AI): ChatUtil.send bypasses the client-side command parser, so the extracted /play reaches the server verbatim. The isChat() guard drops actionbar messages (position 2) before pattern matching.
// NOTE (AI): Sigma 4.11 AutoGG and Rise 5.99 AutoHypixel are the same family on their own event buses; Rise 6.x also has APIKeyComponent, which parses the 'Your new API key is' chat line for the Hypixel API.
Track Hypixel staff bans by capturing the API key from chat and polling the punishment stats endpoint.
onPacketReceive scans every S02PacketChat: if the unformatted text starts with 'Your new API key is ', the key is stored and a chat message confirms it. Until the key is set, onUpdate sends /api new every 10 ticks on Hypixel. Once set, a timer thread polls https://api.hypixel.net/punishmentstats?key=... and fires notifications when staff_total increases.
// ===== FILE: Rise 5.99, dev/rise/module/impl/other/StaffAlert.java =====
package dev.rise.module.impl.other;
import com.google.gson.JsonParser;
import dev.rise.Rise;
import dev.rise.event.impl.other.UpdateEvent;
import dev.rise.event.impl.packet.PacketReceiveEvent;
import dev.rise.module.Module;
import dev.rise.module.api.ModuleInfo;
import dev.rise.module.enums.Category;
import dev.rise.notifications.NotificationType;
import dev.rise.setting.impl.NumberSetting;
import dev.rise.util.math.MathUtil;
import dev.rise.util.math.TimeUtil;
import dev.rise.util.player.PacketUtil;
import dev.rise.util.player.PlayerUtil;
import net.minecraft.network.Packet;
import net.minecraft.network.handshake.client.C00Handshake;
import net.minecraft.network.login.server.S02PacketLoginSuccess;
import net.minecraft.network.play.client.C01PacketChatMessage;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.network.play.server.S40PacketDisconnect;
import net.minecraft.network.status.server.S01PacketPong;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
@ModuleInfo(name = "StaffAlert", description = "Alerts you when staff ban someone else on Hypixel", category = Category.OTHER)
public class StaffAlert extends Module {
private final NumberSetting delay = new NumberSetting("Delay (Seconds)", this, 60, 1, 120, 1);
private final TimeUtil timer = new TimeUtil();
private int lastTimeAmountOfBans = -1;
public static String apikey;
private boolean hasKey;
@Override
public void onUpdateAlwaysInGui() {
this.hidden = !(PlayerUtil.isOnServer("Hypixel") || mc.isSingleplayer());
}
@Override
public void onPacketReceive(final PacketReceiveEvent event) {
if (event.getPacket() instanceof S02PacketChat) {
final S02PacketChat p = (S02PacketChat) event.getPacket();
final String message = p.getChatComponent().getUnformattedText();
if (message.startsWith("Your new API key is ")) {
apikey = message.replace("Your new API key is ", "");
Rise.addChatMessage("API Key Set!");
}
}
}
@Override
public void onUpdate(final UpdateEvent event) {
if(apikey == null && PlayerUtil.isOnServer("Hypixel") && mc.thePlayer.ticksExisted >= 40 && !mc.isSingleplayer() && mc.thePlayer.ticksExisted % 10 == 0){
timer.reset();
PacketUtil.sendPacket(new C01PacketChatMessage("/api new"));
}
if (!PlayerUtil.isOnServer("Hypixel") || mc.isSingleplayer()) {
this.registerNotification(this.getModuleInfo().name() + " only works on Hypixel.");
this.toggleModule();
return;
}
if (mc.isSingleplayer()) {
lastTimeAmountOfBans = -1;
timer.reset();
return;
}
if (timer.hasReached((long) delay.getValue() * 1000) || lastTimeAmountOfBans == -1) {
new Thread(() -> {
try {
final HttpURLConnection connection = (HttpURLConnection) new URL("https://api.hypixel.net/punishmentstats?key=" + apikey).openConnection();
connection.addRequestProperty("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0");
connection.setRequestMethod("GET");
connection.setDoInput(true);
connection.setDoOutput(true);
connection.connect();
final BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
for (String read; (read = reader.readLine()) != null; ) {
if (read.contains("true")) { //alan loves this code
final int staffBans = JsonParser.parseString(read).getAsJsonObject().get("staff_total").getAsInt();
final int diff = staffBans - lastTimeAmountOfBans;
final int delay = (int) Math.round(this.delay.getValue());
if (lastTimeAmountOfBans != -1 && diff > 0)
Rise.INSTANCE.getNotificationManager().registerNotification(diff + (diff == 1 ? " player has" : " players have") + " been staff banned in the past " + (delay == 1 ? "second" : delay + "s") + ".", NotificationType.WARNING);
lastTimeAmountOfBans = staffBans;
}
}
} catch (final Exception e) {
if(apikey != null) {
Rise.INSTANCE.getNotificationManager().registerNotification(this.getModuleInfo().name() + " failed to get staff ban information.", NotificationType.WARNING);
}
e.printStackTrace();
}
}).start();
timer.reset();
}
}
@Override
protected void onEnable() {
lastTimeAmountOfBans = -1;
timer.reset();
}
}
// NOTE (AI): The S02PacketChat hook is one line of the file: capture the API key line. The rest is the Hypixel API poller, which runs on a raw Thread with an HttpURLConnection and a browser User-Agent.
// NOTE (AI): The imports of S02PacketLoginSuccess, S01PacketPong, C00Handshake and S40PacketDisconnect are dead; only S02PacketChat and C01PacketChatMessage are exercised.
// NOTE (AI): The module self-disables off Hypixel and auto-sends /api new on a 10-tick cadence, which is the only serverbound traffic it generates from chat content.
Keep the player's name out of chat rendering: rewrite the component locally or cancel the packet entirely.
Sigma 4.11 StreamerMode: on incoming S02PacketChat with NAMEPROTECT enabled, if the unformatted text contains the player's name, it re-renders the message with the name replaced by a colored 'You' via ChatUtil.printChat and cancels the original; otherwise it cancels any message containing a word from a join/leave/death blacklist. Spicy HideName cancels chat packets that contain the player's name; Rise 5.99 Denicker and Rise 6.x Streamer do the same with their own component access.
// ===== FILE: Sigma 4.11, info/sigmaclient/module/impl/other/StreamerMode.java =====
package info.sigmaclient.module.impl.other;
import info.sigmaclient.event.Event;
import info.sigmaclient.event.impl.EventUpdate;
import info.sigmaclient.event.impl.EventPacket;
import info.sigmaclient.module.data.ModuleData;
import info.sigmaclient.module.data.Setting;
import info.sigmaclient.event.RegisterEvent;
import info.sigmaclient.module.Module;
import info.sigmaclient.util.misc.ChatUtil;
import net.minecraft.client.gui.GuiPlayerTabOverlay;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.play.server.S02PacketChat;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Arithmo on 5/15/2017 at 12:07 AM.
*/
public class StreamerMode extends Module {
private String NAMEPROTECT = "PROTECT";
private String SCRAMBLE = "SCRAMBLE";
private String HIDESCORE = "HIDESCORE";
private String HIDETAB = "HIDETAB";
private String SPOOFSKINS = "SPOOFSKINS";
public static boolean scrambleNames;
public static boolean hideTab;
public static boolean hideScore;
public static boolean spoofSkins;
public StreamerMode(ModuleData data) {
super(data);
settings.put(NAMEPROTECT, new Setting<>(NAMEPROTECT, true, "Protects your name."));
settings.put(SCRAMBLE, new Setting<>(SCRAMBLE, true, "Scrambles other player names."));
settings.put(HIDESCORE, new Setting<>(HIDESCORE, false, "Hides scoreboard."));
settings.put(SPOOFSKINS, new Setting<>(SPOOFSKINS, false, "Spoofs player skins."));
settings.put(HIDETAB, new Setting<>(HIDETAB, false, "Hides tablist/player list."));
}
public static List<String> strings = new ArrayList<>();
@Override
public void onDisable() {
super.onDisable();
scrambleNames = false;
hideScore = false;
hideTab = false;
spoofSkins = false;
strings.clear();
}
@RegisterEvent(events = {EventUpdate.class, EventPacket.class})
public void onEvent(Event event) {
if (event instanceof EventUpdate) {
EventUpdate em = (EventUpdate) event;
if (em.isPre()) {
scrambleNames = (Boolean) settings.get(SCRAMBLE).getValue();
spoofSkins = (Boolean) settings.get(SPOOFSKINS).getValue();
hideScore = (Boolean) settings.get(HIDESCORE).getValue();
hideTab = (Boolean) settings.get(HIDETAB).getValue();
final NetHandlerPlayClient var4 = mc.thePlayer.sendQueue;
final List players = GuiPlayerTabOverlay.field_175252_a.sortedCopy(var4.func_175106_d());
for (final Object o : players) {
final NetworkPlayerInfo info = (NetworkPlayerInfo) o;
if (info == null) {
break;
}
if (!strings.contains(info.getGameProfile().getName())) {
strings.add(info.getGameProfile().getName());
}
}
for (Object o : mc.theWorld.getLoadedEntityList()) {
if (o instanceof EntityPlayer) {
if (!strings.contains(((EntityPlayer) o).getName())) {
strings.add(((EntityPlayer) o).getName());
}
}
}
}
}
if (event instanceof EventPacket) {
EventPacket ep = (EventPacket) event;
if (ep.isIncoming() && ep.getPacket() instanceof S02PacketChat && (Boolean) settings.get(NAMEPROTECT).getValue()) {
S02PacketChat packet = (S02PacketChat) ep.getPacket();
if (packet.func_148915_c().getUnformattedText().contains(mc.thePlayer.getName())) {
String temp = packet.func_148915_c().getFormattedText();
ChatUtil.printChat(temp.replaceAll(mc.thePlayer.getName(), "\2479You\247r"));
ep.setCancelled(true);
} else {
String[] list = new String[]{"join", "left", "leave", "leaving", "lobby", "server", "fell", "died", "slain", "burn", "void", "disconnect", "kill", "by", "was", "quit", "blood", "game"};
for (String str : list) {
if (packet.func_148915_c().getUnformattedText().toLowerCase().contains(str)) {
ep.setCancelled(true);
break;
}
}
}
}
}
}
}
// NOTE (AI): The replacement uses '\2479You\247r': the color code is carried inside the replacement so the local rerender keeps formatting, while the original packet is cancelled so the true name never renders.
// NOTE (AI): The second branch is a crude chat filter: any message whose text contains a word from the join/leave/death list is cancelled outright, which also blocks legitimate messages that merely contain 'kill' or 'game'.
// NOTE (AI): The static flags (scrambleNames, hideTab, hideScore, spoofSkins) are written on EventUpdate and read by other render modules, a shared-state broadcast pattern Sigma uses across modules.
Reply to the kill feed with an insult when the player scores a kill.
Memeware DeathInsult matches seven kill-feed patterns on the unformatted text (killed by / slain by / void while escaping / magic while fighting / couldn't fly / fell to their death while escaping / Hypixel reward lines, plus a Spanish 'asesino ha' variant), then sends a random insult from a static table appended with a 12-character hex suffix via mc.thePlayer.sendChatMessage. Spicy KillSults runs the same idea on its own event bus with its own phrase table.
// ===== FILE: Memeware 7.3, me/memewaredevs/client/module/misc/DeathInsult.java =====
/*
* Decompiled with CFR 0.145.
*
* Could not load the following classes:
* org.apache.commons.lang3.RandomUtils
*/
package me.memewaredevs.client.module.misc;
import me.hippo.api.lwjeb.annotation.Handler;
import me.memewaredevs.client.event.events.PacketInEvent;
import me.memewaredevs.client.module.Module;
import net.minecraft.network.play.server.S02PacketChat;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;
import java.util.function.Consumer;
public class DeathInsult extends Module {
public DeathInsult() {
super("Death Insult", 0, Module.Category.MISC);
}
public static String randomMessage() {
final String[] randomMessages = { "Did ur parents ask you to run away",
"I'd tell you to uninstall, but your aim is so bad you wouldn't hit the button.",
"You do be lookin' kinda bad at the game", "Did someone leave your cage open?",
"rage at me on discord Dort#0001", "Is being in the spectator mode fun?",
" you're the type of guy to quickdrop irl", "you got a solid 0% on the iq test.",
"I understand why your parents abused you", "Do you practice being this bad?",
"your aim is sponsored by Parkinson's", "go take a long walk on a short bridge",
"mans probably plays fortnite lmao.", "plz no repotr i no want ban !",
"you probably have the coronavirus.", "you really like taking L's.", "drown in your own salt",
"I'm not saying you're worthless, but i'd unplug ur life support to charge my phone.",
"could you please commit not alive?", "I don't cheat, you just need to click faster",
"I speak english not your gibberish", "Your mom do be lookin' kinda black doe",
"Hey look! It's a fortnite player", "Need some pvp advice? ", " do you really like dying this much?",
"you probably reported me, which means you have geay.", "you're the type to get 3rd place in a 1v1.",
"how does it feel to get stomped on?", "you are the type of guy to use sigma.",
" that's a #VictoryRoyale! better luck next time!", "lol you probably speak dog eater",
"is a fricking niggler", "I'm black and this a robbery",
"even your mom is better than you in this game.", "go back to fortnite you degenerate.",
"your iq is that of a steve.", "go commit stop breathing plz",
"your parents abandoned you, then the orphanage did the same", "you probably bought sigma premium",
"mans probably got an error on his hello world program lmao",
"how'd you hit the download button with that aim", "Someone in 1940 forgot to gas you",
"did your dad go get milk and went missing?", "mans thinks that his ping is equal to his iq.",
"stop eating dogs", "if the body is 70% water then how is your body 100% salt?",
"mans got thrown at a brick wall by his parents when he was 2 years old.",
"you don't have parents, now that's an L",
"how are you so bad? im losing brain cells while watching you play",
"even lolitsalex has more wins than you",
"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?"};
return randomMessages[RandomUtils.nextInt(0, randomMessages.length - 1)];
}
@Handler
public Consumer<PacketInEvent> eventConsumer0 = event -> {
if (this.mc.thePlayer != null && this.mc.thePlayer.ticksExisted >= 0
&& event.getPacket() instanceof S02PacketChat) {
final String look = "killed by " + mc.thePlayer.getName();
final String look2 = "slain by " + mc.thePlayer.getName();
final String look3 = "void while escaping " + mc.thePlayer.getName();
final String look4 = "was killed with magic while fighting " + mc.thePlayer.getName();
final String look5 = "couldn't fly while escaping " + mc.thePlayer.getName();
final String look6 = "fell to their death while escaping " + mc.thePlayer.getName();
final String look7 = "You recieved a reward for killing ";
final S02PacketChat cp = (S02PacketChat) event.getPacket();
final String cp21 = cp.func_148915_c().getUnformattedText();
if ((cp21.startsWith(mc.thePlayer.getName() + "(") && cp21.contains("asesino ha")) || cp21.contains(look)
|| cp21.contains(look2) || cp21.contains(look3)
|| cp21.contains("You have been rewarded $50 and 2 point(s)!") || cp21.contains(look4) || cp21.contains(look5) || cp21.contains(look6) || cp21.contains(look7)) {
this.mc.thePlayer.sendChatMessage("" + DeathInsult.randomMessage() + " ["
+ RandomStringUtils.random(12, "abcdef0123456789") + "]");
}
}
};
}
// NOTE (AI): The pattern list covers vanilla, Hypixel, and Spanish-language kill feeds, and the trigger is gated on mc.thePlayer != null with ticksExisted >= 0, so the handler never fires before world state exists.
// NOTE (AI): The random 12-char hex suffix (RandomStringUtils) defeats per-message spam filters: the same insult string is never sent twice, which is the actual anti-detection trick in this module.
// NOTE (AI): The reply goes through vanilla sendChatMessage, so a message starting with '.' would be eaten by the client command system; the insults never start with '.', which is why it works.
Trigger a game action from a specific chat line: accept teleport and party requests, respond to kill messages, or react to anti-cheat checks.
Sigma AutoTPA matches 'has requested to teleport to you', 'has requested that you teleport to them', and party-invite lines on the formatted text, verifies the requester is in FriendManager.friendsList (name or alias), and sends /tpaccept or /party accept via ChatUtil.sendChat_NoFilter. Rise 5.99 FightBot and BedwarsTP parse kill/bed lines; Tenacity TPKiller reacts to anti-cheat or kill notices; Rise 6.x WatchdogAutoPhase watches for watchdog check messages to time a phase reset.
// ===== FILE: Sigma 4.11, info/sigmaclient/module/impl/other/AutoTPA.java =====
package info.sigmaclient.module.impl.other;
import info.sigmaclient.event.Event;
import info.sigmaclient.event.RegisterEvent;
import info.sigmaclient.event.impl.EventPacket;
import info.sigmaclient.management.friend.Friend;
import info.sigmaclient.management.friend.FriendManager;
import info.sigmaclient.module.Module;
import info.sigmaclient.module.data.ModuleData;
import info.sigmaclient.util.misc.ChatUtil;
import net.minecraft.network.play.server.S02PacketChat;
/**
* Created by cool1 on 2/4/2017.
*/
public class AutoTPA extends Module {
public AutoTPA(ModuleData data) {
super(data);
}
@Override
@RegisterEvent(events = EventPacket.class)
public void onEvent(Event event) {
EventPacket ep = (EventPacket) event;
if (ep.isIncoming() && ep.getPacket() instanceof S02PacketChat) {
S02PacketChat s02PacketChat = (S02PacketChat) ep.getPacket();
if (s02PacketChat.func_148915_c().getFormattedText().contains("has requested to teleport to you") || s02PacketChat.func_148915_c().getFormattedText().contains("has requested that you teleport to them")) {
for (Friend friend : FriendManager.friendsList) {
if (s02PacketChat.func_148915_c().getFormattedText().contains(friend.name) || s02PacketChat.func_148915_c().getFormattedText().contains(friend.alias)) {
ChatUtil.sendChat_NoFilter("/tpaccept");
break;
}
}
}
if (s02PacketChat.func_148915_c().getFormattedText().contains("has invited you to join their party!")) {
for (Friend friend : FriendManager.friendsList) {
if (s02PacketChat.func_148915_c().getFormattedText().contains(friend.name) || s02PacketChat.func_148915_c().getFormattedText().contains(friend.alias)) {
ChatUtil.sendChat_NoFilter("/party accept " + friend.name);
break;
}
}
}
}
}
}
// NOTE (AI): Matching runs on getFormattedText(), so color-coded names still match, and the friend check runs before any command is sent, so only whitelisted requesters trigger a response.
// NOTE (AI): ChatUtil.sendChat_NoFilter pushes a C01PacketChatMessage directly into the send queue, bypassing Sigma's client-side command parser and the vanilla sendChatMessage prefix handling.
// NOTE (AI): The whole module is one EventPacket handler with isIncoming() as the gate: 46 lines, the smallest complete S02PacketChat consumer in the corpus.
Automate registration and login on auth-me servers by reacting to the server's prompt messages.
onPacketReceive scans S02PacketChat: if the unformatted text contains '/register' the module registers, if it contains '/login' it logs in. Register generates a random 8-char password, sends /register via sendChatMessage, schedules /login one second later on a static scheduled executor, and persists the per-server credentials to authmelogins.txt. The companion onPacketSend cancels the player's own /register and /login C01PacketChatMessage packets so nothing double-fires. State resets on WorldChangedEvent and GUI transitions.
// ===== FILE: Rise 5.99, dev/rise/module/impl/other/AutoAuthme.java =====
package dev.rise.module.impl.other;
import dev.rise.Rise;
import dev.rise.event.impl.other.OpenGUIEvent;
import dev.rise.event.impl.other.WorldChangedEvent;
import dev.rise.event.impl.packet.PacketReceiveEvent;
import dev.rise.event.impl.packet.PacketSendEvent;
import dev.rise.module.Module;
import dev.rise.module.api.ModuleInfo;
import dev.rise.module.enums.Category;
import dev.rise.util.math.RandomUtil;
import dev.rise.util.misc.FileUtil;
import lombok.Data;
import net.minecraft.client.gui.GuiDisconnected;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.gui.GuiMultiplayer;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.multiplayer.GuiConnecting;
import net.minecraft.network.play.client.C01PacketChatMessage;
import net.minecraft.network.play.server.S02PacketChat;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;
@ModuleInfo(name = "AutoAuthme", description = "Automatically authenticates you when the server is using the Authme plugin", category = Category.OTHER)
public class AutoAuthme extends Module {
private static final ScheduledExecutorService SCHEDULED_EXECUTOR = Executors.newScheduledThreadPool(1);
private static final List<AutoAuthmeLogin> logins = new ArrayList<>();
private boolean loggedIn, loggingIn;
public static void loadLogins() {
final String loginContent = FileUtil.loadFile("authmelogins.txt");
if (loginContent == null) return;
for (final String loginLine : loginContent.split("\r\n")) {
final String[] loginData = loginLine.split(":");
if (loginLine.length() < 3) continue;
logins.add(new AutoAuthmeLogin(loginData[0], loginData[1], loginData[2]));
}
}
public static void saveLogins() {
final StringBuilder loginContent = new StringBuilder();
for (final AutoAuthmeLogin login : logins) {
loginContent.append("\r\n").append(login.getServerIp()).append(":").append(login.getUsername()).append(":").append(login.getPassword());
}
FileUtil.saveFile("authmelogins.txt", true, loginContent.toString());
}
@Override
public void onWorldChanged(final WorldChangedEvent event) {
loggedIn = loggingIn = false;
}
@Override
public void onPacketSend(final PacketSendEvent event) {
if (!loggedIn && !loggingIn) {
if (event.getPacket() instanceof C01PacketChatMessage) {
final C01PacketChatMessage packet = (C01PacketChatMessage) event.getPacket();
final String message = packet.getMessage();
if (message.equalsIgnoreCase("/register")) {
register();
event.setCancelled(true);
} else if (message.equalsIgnoreCase("/login")) {
login();
event.setCancelled(true);
}
}
}
}
@Override
public void onPacketReceive(final PacketReceiveEvent event) {
if (!loggedIn && !loggingIn) {
if (event.getPacket() instanceof S02PacketChat) {
final S02PacketChat packet = (S02PacketChat) event.getPacket();
// Get the message with color and formatting codes removed
final String message = packet.getChatComponent().getUnformattedText();
if (message.toLowerCase().contains("/register")) {
register();
} else if (message.toLowerCase().contains("/login")) {
login();
}
}
}
}
@Override
public void onOpenGUI(final OpenGUIEvent event) {
final GuiScreen gui = event.getNewScreen();
if (mc.getCurrentServerData() == null || gui == null
|| gui instanceof GuiConnecting || gui instanceof GuiMultiplayer
|| gui instanceof GuiDisconnected || gui instanceof GuiMainMenu) {
loggedIn = loggingIn = false;
}
}
private void register() {
loggingIn = true;
final String serverIp = mc.getCurrentServerData().serverIP;
final String username = mc.thePlayer.getName();
final String password = RandomUtil.randomStringOfSize(8, RandomUtil.QWERTY_CHARSET);
Rise.addChatMessage(
"AutoAuthme is automatically registering and logging in for you! Hover for login info!",
"Server IP: " + serverIp + "\nUsername: " + username + "\nPassword: " + password
);
mc.thePlayer.sendChatMessage("/register " + password + " " + password);
SCHEDULED_EXECUTOR.schedule(() -> {
mc.thePlayer.sendChatMessage("/login " + password);
loggedIn = true;
}, 1L, TimeUnit.SECONDS);
logins.add(new AutoAuthmeLogin(serverIp, username, password));
}
private void login() {
loggingIn = true;
final String serverIp = mc.getCurrentServerData().serverIP;
final String username = mc.thePlayer.getName();
for (final AutoAuthmeLogin login : logins) {
if (login.getServerIp().equalsIgnoreCase(serverIp) && login.getUsername().equalsIgnoreCase(username)) {
final String password = login.getPassword();
mc.thePlayer.sendChatMessage("/login " + password);
Rise.addChatMessage(
"AutoAuthme is automatically logging you in! Hover for login info!",
"Server IP: " + serverIp + "\nUsername: " + username + "\nPassword: " + password
);
loggedIn = true;
return;
}
}
}
}
@Data
class AutoAuthmeLogin {
private final String serverIp, username, password;
}
// NOTE (AI): The receive hook is the trigger: auth-me servers print a prompt containing '/register' or '/login', and the module keys off that text rather than any packet flag, which makes it work across every auth-me variant.
// NOTE (AI): The send hook cancels the user's own C01 /register and /login packets while loggedIn/loggingIn is false, so the credential flow runs exactly once per join.
// NOTE (AI): Credentials are stored per server IP and username in authmelogins.txt; the login() path only fires if a stored entry matches, otherwise it stays quiet. The scheduled /login runs on a dedicated executor thread one second after register.
Gate the cage-phase exploit on S02 chat signals: enable phasing when the server announces the cage countdown, disable when the fight starts.
The EventPacket.In listener checks S02PacketChat; on BLOCKS_MC, unformatted text containing 'Cages open in: 2 seconds!' sets canPhase true, and 'Cages opened! FIGHT!' calls setState(false). The rest of the module removes the glass block under the player while cagePhasing and restores it on disable.
// ===== FILE: November Recode 2.0, feature/module/impl/exploit/PhaseModule.java =====
/* November.lol © 2023 */
package lol.november.feature.module.impl.exploit;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import lol.november.feature.module.Category;
import lol.november.feature.module.Module;
import lol.november.feature.module.Register;
import lol.november.feature.setting.Setting;
import lol.november.listener.bus.Listener;
import lol.november.listener.bus.Subscribe;
import lol.november.listener.event.net.EventPacket;
import lol.november.listener.event.player.EventUpdate;
import net.minecraft.block.BlockGlass;
import net.minecraft.block.state.IBlockState;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C01PacketChatMessage;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.network.play.server.S08PacketPlayerPosLook;
import net.minecraft.util.BlockPos;
/**
* @author Gavin
* @since 2.0.0
*/
@Register(
name = "Phase",
description = "Phases through blocks",
category = Category.EXPLOIT
)
public class PhaseModule extends Module {
private final Setting<Mode> mode = new Setting<>("Mode", Mode.CAGE_PHASE);
private final Setting<Server> server = new Setting<>(
"Server",
Server.BLOCKS_MC
);
private final Queue<Packet<?>> packetQueue = new ConcurrentLinkedQueue<>();
private int ticksSinceLastSetback = -1;
private BlockPos phasePos;
private IBlockState phaseState;
private boolean cagePhasing, canPhase = true;
@Override
public void enable() {
super.enable();
canPhase = server.getValue() == Server.GENERIC;
}
@Override
public void disable() {
super.disable();
if (mc.thePlayer != null && !packetQueue.isEmpty()) {
while (!packetQueue.isEmpty()) {
mc.thePlayer.sendQueue.addToSendQueueSilent(packetQueue.poll());
}
}
packetQueue.clear();
ticksSinceLastSetback = -1;
if (cagePhasing) {
if (phasePos != null && phaseState != null) {
mc.theWorld.setBlockState(phasePos, phaseState);
}
cagePhasing = false;
phasePos = null;
phaseState = null;
}
canPhase = true;
}
@Subscribe
private final Listener<EventUpdate> update = event -> {
if (mc.thePlayer.ticksExisted < 5) {
packetQueue.clear();
ticksSinceLastSetback = 0;
phaseState = null;
phasePos = null;
cagePhasing = false;
canPhase = server.getValue() == Server.GENERIC;
return;
}
ticksSinceLastSetback++;
if (mode.getValue() == Mode.CAGE_PHASE) {
if (
ticksSinceLastSetback < 20 || !mc.thePlayer.onGround || !canPhase
) return;
if (!cagePhasing) {
BlockPos under = new BlockPos(mc.thePlayer.getPositionVector()).down();
IBlockState state = mc.theWorld.getBlockState(under);
if (state.getBlock() instanceof BlockGlass) {
cagePhasing = true;
mc.theWorld.setBlockToAir(under);
// Printer.print("Phased through glass");
phasePos = under;
phaseState = state;
}
} else {
if (phasePos != null && phaseState != null) {
// Printer.print("Replaced glass to not desync");
mc.theWorld.setBlockState(phasePos, phaseState);
phaseState = null;
}
}
}
};
@Subscribe
private final Listener<EventPacket.Out> packetOut = event -> {
if (mc.thePlayer == null || mc.thePlayer.ticksExisted < 10) return;
if (cagePhasing) {
if (event.get() instanceof C01PacketChatMessage) return;
event.setCanceled(true);
packetQueue.add(event.get());
}
};
@Subscribe
private final Listener<EventPacket.In> packetIn = event -> {
if (event.get() instanceof S08PacketPlayerPosLook) {
ticksSinceLastSetback = 0;
// Printer.print("Setback");
} else if (event.get() instanceof S02PacketChat packet) {
if (mode.getValue() != Mode.CAGE_PHASE) return;
String raw = packet.getChatComponent().getUnformattedText();
if (server.getValue() == Server.HYPIXEL) {
// TODO
} else if (server.getValue() == Server.BLOCKS_MC) {
if (raw.contains("Cages open in: 2 seconds!")) {
canPhase = true;
} else if (raw.contains("Cages opened! FIGHT!")) {
setState(false);
}
}
}
};
private enum Mode {
CAGE_PHASE,
}
private enum Server {
GENERIC,
BLOCKS_MC,
HYPIXEL,
}
}
// NOTE (AI): The S02 branch is the BLOCKS_MC case inside packetIn; the EventUpdate and EventPacket.Out handlers drive the actual phasing.Extract real player names from S02 kill-feed and chat lines on the Hyt (Chinese) BedWars server, so KillAura skips anti-cheat bots.
The HytBedwars branch of onPacket matches two regexes against the unformatted text: '杀死了 (.*?)\(' for kill feed and '> (.*?)\(' for chat names. Each captured name goes into the static playerName list for 6 seconds (a background thread removes it), and the entity check later exempts entities whose names are in the list.
// ===== FILE: LiquidSense Dev, net/ccbluex/liquidbounce/features/module/modules/misc/AntiBot.java =====
/*
* LiquidBounce Hacked Client
* A free open source mixin-based injection hacked client for Minecraft using Minecraft Forge.
* https://github.com/CCBlueX/LiquidBounce/
*/
package net.ccbluex.liquidbounce.features.module.modules.misc;
import com.google.common.collect.ComparisonChain;
import com.google.common.collect.Ordering;
import net.ccbluex.liquidbounce.LiquidBounce;
import net.ccbluex.liquidbounce.event.*;
import net.ccbluex.liquidbounce.features.module.Module;
import net.ccbluex.liquidbounce.features.module.ModuleCategory;
import net.ccbluex.liquidbounce.features.module.ModuleInfo;
import net.ccbluex.liquidbounce.utils.EntityUtils;
import net.ccbluex.liquidbounce.utils.misc.StringUtils;
import net.ccbluex.liquidbounce.utils.render.ColorUtils;
import net.ccbluex.liquidbounce.utils.timer.TimerOther;
import net.ccbluex.liquidbounce.value.BoolValue;
import net.ccbluex.liquidbounce.value.FloatValue;
import net.ccbluex.liquidbounce.value.IntegerValue;
import net.ccbluex.liquidbounce.value.ListValue;
import net.minecraft.client.Minecraft;
import net.minecraft.client.network.NetHandlerPlayClient;
import net.minecraft.client.network.NetworkPlayerInfo;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.C01PacketChatMessage;
import net.minecraft.network.play.server.S02PacketChat;
import net.minecraft.network.play.server.S0BPacketAnimation;
import net.minecraft.network.play.server.S14PacketEntity;
import net.minecraft.scoreboard.ScorePlayerTeam;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.WorldSettings;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import tv.twitch.chat.ChatEvent;
import java.util.*;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ModuleInfo(name = "AntiBot", description = "Prevents KillAura from attacking AntiCheat bots.", category = ModuleCategory.MISC)
public class AntiBot extends Module {
public static final List<String> playerName = new ArrayList<>();
private static List<EntityPlayer> invalid = new ArrayList<>();
private static List<EntityPlayer> removed = new ArrayList<>();
private final IntegerValue livingTime = new IntegerValue("LivingTimeValue", 160, 0, 500);
private final BoolValue killer = new BoolValue("BotKiller", true);
private final BoolValue tabValue = new BoolValue("Tab", true);
private final ListValue tabModeValue = new ListValue("TabMode", new String[]{"Equals", "Contains"}, "Contains");
private final BoolValue entityIDValue = new BoolValue("EntityID", true);
private final BoolValue colorValue = new BoolValue("Color", false);
private final BoolValue livingTimeValue = new BoolValue("LivingTime", false);
private final BoolValue groundValue = new BoolValue("Ground", true);
private final BoolValue airValue = new BoolValue("Air", false);
private final BoolValue invaildGroundValue = new BoolValue("InvaildGround", true);
private final BoolValue swingValue = new BoolValue("Swing", false);
private final BoolValue healthValue = new BoolValue("Health", false);
private final BoolValue derpValue = new BoolValue("Derp", true);
private final BoolValue wasInvisibleValue = new BoolValue("WasInvisible", false);
private final BoolValue armorValue = new BoolValue("Armor", false);
private final BoolValue pingValue = new BoolValue("Ping", false);
private final BoolValue needHitValue = new BoolValue("NeedHit", false);
private final BoolValue duplicateInWorldValue = new BoolValue("DuplicateInWorld", false);
private final BoolValue duplicateInTabValue = new BoolValue("DuplicateInTab", false);
private final BoolValue hytBedwarsValue = new BoolValue("HYTBedwars", false);
private final List<Integer> ground = new ArrayList<>();
private final List<Integer> air = new ArrayList<>();
private final Map<Integer, Integer> invaildGround = new HashMap<>();
private final List<Integer> swing = new ArrayList<>();
private final List<Integer> invisible = new ArrayList<>();
private final List<Integer> hitted = new ArrayList<>();
TimerOther lastRemoved = new TimerOther();
private TimerOther timer = new TimerOther();
@Override
public void onDisable() {
mc.ingameGUI.getChatGUI().addToSentMessages("test");
clearAll();
super.onDisable();
}
@EventTarget
public void onUpdate(UpdateEvent e) {
if (killer.get()) {
if (!removed.isEmpty()) {
if (lastRemoved.delay(1000)) {
if (removed.size() == 1) {
mc.thePlayer.addChatMessage(new ChatComponentText("§b"+removed.size() + " bot has been removed"));
} else {
mc.thePlayer.addChatMessage(new ChatComponentText("§f"+removed.size() + " bots has been removed"));
}
lastRemoved.reset();
removed.clear();
}
}
}
if (!invalid.isEmpty() && timer.delay(1000)) {
invalid.clear();
timer.reset();
}
// Loop through entity list
for (Object o : mc.theWorld.getLoadedEntityList()) {
if (o instanceof EntityPlayer) {
EntityPlayer ent = (EntityPlayer) o;
//Make sure it's not the local player + they are in a worrying distance. Ignore them if they're already invalid.
if (ent != mc.thePlayer && !invalid.contains(ent)) {
String formated = ent.getDisplayName().getFormattedText();
String custom = ent.getCustomNameTag();
String name = ent.getName();
if (ent.isInvisible() && !formated.startsWith("§c") && formated.endsWith("§r") && custom.equals(name)) {
double diffX = Math.abs(ent.posX - mc.thePlayer.posX);
double diffY = Math.abs(ent.posY - mc.thePlayer.posY);
double diffZ = Math.abs(ent.posZ - mc.thePlayer.posZ);
double diffH = Math.sqrt(diffX * diffX + diffZ * diffZ);
if (diffY < 13 && diffY > 10 && diffH < 3) {
List<EntityPlayer> list = getTabPlayerList();
if (!list.contains(ent)) {
if (killer.get() != null) {
lastRemoved.reset();
removed.add(ent);
mc.theWorld.removeEntity(ent);
}
invalid.add(ent);
}
}
}
//SHOP BEDWARS
if (!formated.startsWith("§") && formated.endsWith("§r")) {
invalid.add(ent);
}
if (ent.isInvisible()) {
//BOT INVISIBLES IN GAME
if (!custom.equalsIgnoreCase("") && custom.toLowerCase().contains("§c§c") && name.contains("§c")) {
if (killer.get() != null) {
lastRemoved.reset();
removed.add(ent);
mc.theWorld.removeEntity(ent);
}
invalid.add(ent);
}
}
//WATCHDOG BOT
if (!custom.equalsIgnoreCase("") && custom.toLowerCase().contains("§c") && custom.toLowerCase().contains("§r") || custom.endsWith("§c")) {
if (killer.get() != null) {
lastRemoved.reset();
removed.add(ent);
mc.theWorld.removeEntity(ent);
}
invalid.add(ent);
}
//BOT LOBBY
if (formated.contains("§8[NPC]")) {
invalid.add(ent);
}
if (!formated.contains("§c") && !custom.equalsIgnoreCase("")) {
invalid.add(ent);
}
}
}
}
}
public static List<EntityPlayer> getTabPlayerList() {
Minecraft mc = AntiBot.mc;
NetHandlerPlayClient var4 = mc.thePlayer.sendQueue;
ArrayList list = new ArrayList();
List players = Ordering.from(new PlayerComparator()).sortedCopy((Iterable) var4.getPlayerInfoMap());
for (Object o : players) {
NetworkPlayerInfo info = (NetworkPlayerInfo) o;
if (info == null) {
continue;
}
ArrayList list2 = list;
list2.add(mc.theWorld.getPlayerEntityByName(info.getGameProfile().getName()));
}
return (List<EntityPlayer>) list;
}
@EventTarget
public void onPacket(final PacketEvent event) {
if (mc.thePlayer == null || mc.theWorld == null)
return;
final Packet<?> packet = event.getPacket();
if (packet instanceof S02PacketChat) {
if (hytBedwarsValue.get()) {
S02PacketChat chatMessage = (S02PacketChat) packet;
Matcher matcher = Pattern.compile("杀死了 (.*?)\\(").matcher(chatMessage.getChatComponent().getUnformattedText());
Matcher matcher2 = Pattern.compile("> (.*?)\\(").matcher(chatMessage.getChatComponent().getUnformattedText());
if (matcher.find()) {
String name = matcher.group(1);
if (!name.equals("")) {
if (!AntiBot.playerName.contains(name)) {
AntiBot.playerName.add(name);
// mc.thePlayer.addChatMessage(new ChatComponentText("已加入列表: " + name));
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(6000);
playerName.remove(name);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
}).start();
}
}
}
if (matcher2.find()) {
String name = matcher2.group(1);
if (!name.equals("")) {
if (!AntiBot.playerName.contains(name)) {
AntiBot.playerName.add(name);
// mc.thePlayer.addChatMessage(new ChatComponentText("已加入列表: " + name));
new Thread(new Runnable() {
@Override
public void run() {
try {
Thread.sleep(6000);
playerName.remove(name);
} catch (InterruptedException ex) {
ex.printStackTrace();
}
}
}).start();
}
}
}
}
}
if (packet instanceof S14PacketEntity) {
final S14PacketEntity packetEntity = (S14PacketEntity) event.getPacket();
final Entity entity = packetEntity.getEntity(mc.theWorld);
if (entity instanceof EntityPlayer) {
if (packetEntity.getOnGround() && !ground.contains(entity.getEntityId()))
ground.add(entity.getEntityId());
if (!packetEntity.getOnGround() && !air.contains(entity.getEntityId()))
air.add(entity.getEntityId());
if (packetEntity.getOnGround()) {
if (entity.prevPosY != entity.posY)
invaildGround.put(entity.getEntityId(), invaildGround.getOrDefault(entity.getEntityId(), 0) + 1);
} else {
final int currentVL = invaildGround.getOrDefault(entity.getEntityId(), 0) / 2;
if (currentVL <= 0)
invaildGround.remove(entity.getEntityId());
else
invaildGround.put(entity.getEntityId(), currentVL);
}
if (entity.isInvisible() && !invisible.contains(entity.getEntityId()))
invisible.add(entity.getEntityId());
}
}
if (packet instanceof S0BPacketAnimation) {
final S0BPacketAnimation packetAnimation = (S0BPacketAnimation) event.getPacket();
final Entity entity = mc.theWorld.getEntityByID(packetAnimation.getEntityID());
if (entity instanceof EntityLivingBase && packetAnimation.getAnimationType() == 0 && !swing.contains(entity.getEntityId()))
swing.add(entity.getEntityId());
}
}
@EventTarget
public void onAttack(final AttackEvent e) {
final Entity entity = e.getTargetEntity();
if (entity instanceof EntityLivingBase && !hitted.contains(entity.getEntityId()))
hitted.add(entity.getEntityId());
}
@EventTarget
public void onWorld(final WorldEvent event) {
clearAll();
}
private void clearAll() {
hitted.clear();
swing.clear();
ground.clear();
invaildGround.clear();
invisible.clear();
playerName.clear();
}
public static boolean isBot(final EntityLivingBase entity) {
if (!(entity instanceof EntityPlayer))
return false;
final AntiBot antiBot = (AntiBot) LiquidBounce.moduleManager.getModule(AntiBot.class);
// mc.ingameGUI.getChatGUI().addToSentMessages("tick: " + entity.ticksExisted);
if (antiBot == null || !antiBot.getState())
return false;
if (antiBot.colorValue.get() && !entity.getDisplayName().getFormattedText()
.replace("§r", "").contains("§"))
return true;
// mc.thePlayer.addChatMessage(new ChatComponentText(entity.getName()
// + " " + playerName.contains(entity.getName())
// + " " + playerName.size()));
if (antiBot.hytBedwarsValue.get() && playerName.contains(entity.getName()))
return true;
if (antiBot.livingTimeValue.get() && entity.ticksExisted < antiBot.livingTime.get())
return true;
if (antiBot.groundValue.get() && !antiBot.ground.contains(entity.getEntityId()))
return true;
if (antiBot.airValue.get() && !antiBot.air.contains(entity.getEntityId()))
return true;
if (antiBot.swingValue.get() && !antiBot.swing.contains(entity.getEntityId()))
return true;
if (antiBot.healthValue.get() && entity.getHealth() > 20F)
return true;
if (antiBot.entityIDValue.get() && (entity.getEntityId() >= 1000000000 || entity.getEntityId() <= -1))
return true;
if (antiBot.derpValue.get() && (entity.rotationPitch > 90F || entity.rotationPitch < -90F))
return true;
if (antiBot.wasInvisibleValue.get() && antiBot.invisible.contains(entity.getEntityId()))
return true;
if (antiBot.armorValue.get()) {
final EntityPlayer player = (EntityPlayer) entity;
if (player.inventory.armorInventory[0] == null && player.inventory.armorInventory[1] == null &&
player.inventory.armorInventory[2] == null && player.inventory.armorInventory[3] == null)
return true;
}
if (antiBot.pingValue.get()) {
EntityPlayer player = (EntityPlayer) entity;
if (mc.getNetHandler().getPlayerInfo(player.getUniqueID()).getResponseTime() == 0)
return true;
}
if (antiBot.needHitValue.get() && !antiBot.hitted.contains(entity.getEntityId()))
return true;
if (antiBot.invaildGroundValue.get() && antiBot.invaildGround.getOrDefault(entity.getEntityId(), 0) >= 10)
return true;
if (antiBot.tabValue.get()) {
final boolean equals = antiBot.tabModeValue.get().equalsIgnoreCase("Equals");
final String targetName = ColorUtils.stripColor(entity.getDisplayName().getFormattedText());
if (targetName != null) {
for (final NetworkPlayerInfo networkPlayerInfo : mc.getNetHandler().getPlayerInfoMap()) {
final String networkName = ColorUtils.stripColor(EntityUtils.getName(networkPlayerInfo));
if (networkName == null)
continue;
if (equals ? targetName.equals(networkName) : targetName.contains(networkName))
return false;
}
return true;
}
}
if (antiBot.duplicateInWorldValue.get()) {
if (mc.theWorld.loadedEntityList.stream()
.filter(currEntity -> currEntity instanceof EntityPlayer && ((EntityPlayer) currEntity)
.getDisplayNameString().equals(((EntityPlayer) currEntity).getDisplayNameString()))
.count() > 1)
return true;
}
if (antiBot.duplicateInTabValue.get()) {
if (mc.getNetHandler().getPlayerInfoMap().stream()
.filter(networkPlayer -> entity.getName().equals(ColorUtils.stripColor(EntityUtils.getName(networkPlayer))))
.count() > 1)
return true;
}
return entity.getName().isEmpty() || entity.getName().equals(mc.thePlayer.getName());
}
@SideOnly(Side.CLIENT)
public static class PlayerComparator implements Comparator<NetworkPlayerInfo> {
private PlayerComparator() {
}
public int compare(NetworkPlayerInfo p_compare_1_, NetworkPlayerInfo p_compare_2_) {
ScorePlayerTeam scoreplayerteam = p_compare_1_.getPlayerTeam();
ScorePlayerTeam scoreplayerteam1 = p_compare_2_.getPlayerTeam();
return ComparisonChain.start()
.compareTrueFirst(p_compare_1_.getGameType() != WorldSettings.GameType.SPECTATOR,
p_compare_2_.getGameType() != WorldSettings.GameType.SPECTATOR)
.compare(scoreplayerteam != null ? scoreplayerteam.getRegisteredName() : "",
scoreplayerteam1 != null ? scoreplayerteam1.getRegisteredName() : "")
.compare(p_compare_1_.getGameProfile().getName(), p_compare_2_.getGameProfile().getName()).result();
}
}
}
// NOTE (AI): The S02 parsing is the hytBedwarsValue branch of onPacket; the rest of the file is LiquidBounce's standard AntiBot heuristics (tab, entity id, living time, ground/air).anticheat Anti-Cheat Checks
S02 is the outbound chat packet: anticheats send their own alerts through it, but they cannot see what the client renders, so none of them validate the packet's payload on the server side. The chat checks that exist in the corpus run on the INBOUND chat packet or Bukkit chat events and then talk back through S02: Grim flags blank tab-complete and impossible chat, NCP gates chat behind a captcha, Photon flags chat while sprinting or with an open inventory, and BetterAnticheat flags chat while chat is set to hidden. From the anticheat's point of view S02 is the delivery channel, not the input.
Flags blank or slash-only tab-complete packets, an exploit probe that accompanies chat-related client abuse.
Pre-Via listener on the inbound tab-complete packet: if the text is exactly a slash or trims to empty, the check flags and cancels the packet. This is the chat-domain check in Grim's corpus for S02 because the outbound chat packet is the visible counterpart; the detection itself happens on the client-to-server side.
// ===== FILE: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/checks/impl/chat/ChatA.java =====
package ac.grim.grimac.checks.impl.chat;
import ac.grim.grimac.checks.Check;
import ac.grim.grimac.checks.CheckData;
import ac.grim.grimac.checks.type.PreViaPacketReceiveListener;
import ac.grim.grimac.player.GrimPlayer;
import com.github.retrooper.packetevents.PacketEvents;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.manager.server.ServerVersion;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientTabComplete;
@CheckData(name = "ChatA", stableKey = "grim.exploit.blank_tab_complete", description = "Sent a tab complete packet with no command or input text", experimental = true)
public class ChatA extends Check implements PreViaPacketReceiveListener {
public ChatA(GrimPlayer player) {
super(player);
}
@Override
public boolean isApplicable() {
return PacketEvents.getAPI().getServerManager().getVersion().isNewerThanOrEquals(ServerVersion.V_1_13);
}
@Override
public void onPreViaPacketReceive(PacketReceiveEvent event) {
if (event.getPacketType() == PacketType.Play.Client.TAB_COMPLETE) {
WrapperPlayClientTabComplete wrapper = new WrapperPlayClientTabComplete(event);
String text = wrapper.getText();
if (text.equals("/") || text.trim().isEmpty()) {
if (flag() && shouldModifyPackets()) {
event.setCancelled(true);
player.onPacketCancel();
}
}
}
}
}
// NOTE (AI): Grim's other chat checks (ChatB, ChatC, ChatD) follow the same pattern on other chat-adjacent inbound packets.Gates chat behind a generated captcha: players must answer correctly before chat is accepted, with kick actions on repeated failure.
On the inbound chat listener, a player flagged by other chat checks is sent a captcha question through the outbound chat channel (S02). The captcha check compares the player's next message to the generated code, increments tries and violation level on mismatch, re-sends the question, and executes the configured actions (up to kicking) once tries exceed the threshold.
// ===== FILE: Updated-NoCheatPlus-NoCheatPlus, NCPCore/src/main/java/fr/neatmonster/nocheatplus/checks/chat/Captcha.java =====
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package fr.neatmonster.nocheatplus.checks.chat;
import java.util.concurrent.ThreadLocalRandom;
import org.bukkit.entity.Player;
import fr.neatmonster.nocheatplus.checks.Check;
import fr.neatmonster.nocheatplus.checks.CheckType;
import fr.neatmonster.nocheatplus.players.DataManager;
import fr.neatmonster.nocheatplus.players.IPlayerData;
import fr.neatmonster.nocheatplus.utilities.ColorUtil;
/**
* NOTE: EARLY REFACTORING STATE, MOST METHODS NEED SYNC OVER DATA !
* @author mc_dev
*
*/
public class Captcha extends Check implements ICaptcha{
public Captcha() {
super(CheckType.CHAT_CAPTCHA);
}
@Override
public void checkCaptcha(Player player, String message, ChatConfig cc, ChatData data, boolean isMainThread) {
// Correct answer to the captcha?
if (message.equals(data.captchaGenerated)) {
// Yes, clear their data and do not worry anymore about them.
data.reset();
data.captchaStarted = false;
player.sendMessage(ColorUtil.replaceColors(cc.captchaSuccess));
}
else {
// Increment their tries number counter.
data.captchTries++;
data.captchaVL ++;
// Have they failed too man times?
if (data.captchTries > cc.captchaTries) {
// Find out if we need to kick the player or not.
executeActions(player, data.captchaVL, 1, cc.captchaActions);
// (Resetting captcha tries is done on quit/kick).
}
// Display the question again (if not kicked).
if (player.isOnline()) {
sendCaptcha(player, cc, data);
}
}
}
@Override
public void sendNewCaptcha(Player player, ChatConfig cc, ChatData data) {
// Display a captcha to the player.
generateCaptcha(cc, data, true);
sendCaptcha(player, cc, data);
data.captchaStarted = true;
}
@Override
public void generateCaptcha(ChatConfig cc, ChatData data, boolean reset) {
if (reset) data.captchTries = 0;
final char[] chars = new char[cc.captchaLength];
for (int i = 0; i < cc.captchaLength; i++) {
chars[i] = cc.captchaCharacters.charAt(ThreadLocalRandom.current().nextInt(cc.captchaCharacters.length()));
}
data.captchaGenerated = new String(chars);
}
@Override
public void resetCaptcha(Player player){
final IPlayerData pData = DataManager.getPlayerData(player);
ChatData data = pData.getGenericInstance(ChatData.class);
synchronized (data) {
resetCaptcha(player, pData.getGenericInstance(ChatConfig.class), data, pData);
}
}
@Override
public void resetCaptcha(Player player, ChatConfig cc, ChatData data, IPlayerData pData) {
data.captchTries = 0;
if (shouldCheckCaptcha(player, cc, data, pData) || shouldStartCaptcha(player, cc, data, pData)){
generateCaptcha(cc, data, true);
}
}
@Override
public void sendCaptcha(Player player, ChatConfig cc, ChatData data) {
player.sendMessage(ColorUtil.replaceColors(cc.captchaQuestion.replace("[captcha]", data.captchaGenerated)));
}
@Override
public boolean shouldStartCaptcha(Player player, ChatConfig cc, ChatData data, IPlayerData pData) {
// TODO: Only call if IWorldData.isCheckActive(CHAT_CAPTCHA) has returned true?
return !data.captchaStarted && pData.isCheckActive(CheckType.CHAT_CAPTCHA, player);
}
@Override
public boolean shouldCheckCaptcha(Player player, ChatConfig cc, ChatData data, IPlayerData pData) {
// TODO: Only call if IWorldData.isCheckActive(CHAT_CAPTCHA) has returned true?
return data.captchaStarted && pData.isCheckActive(CheckType.CHAT_CAPTCHA, player);
}
}
// NOTE (AI): Captcha resets on quit and can be reissued on login; the question text is replaced into the configurable message through the chat channel.Flags chat messages that a vanilla client could not physically send, because the player is sprinting, sneaking, blocking, dead or had an inventory open.
Listens to Bukkit's async chat event rather than the packet. If the user is sprinting, sneaking, blocking, dead, or has had an inventory open for over a second, the chat is impossible and the module flags with 25 violation points, cancelling the event at the configured violation level.
// ===== FILE: Photon-GitHub-AntiCheatAddition, src/main/java/de/photon/anticheataddition/modules/checks/impossiblechat/ImpossibleChat.java =====
package de.photon.anticheataddition.modules.checks.impossiblechat;
import de.photon.anticheataddition.modules.ViolationModule;
import de.photon.anticheataddition.user.User;
import de.photon.anticheataddition.util.violationlevels.Flag;
import de.photon.anticheataddition.util.violationlevels.ViolationLevelManagement;
import de.photon.anticheataddition.util.violationlevels.ViolationManagement;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
public final class ImpossibleChat extends ViolationModule implements Listener
{
public static final ImpossibleChat INSTANCE = new ImpossibleChat();
private final int cancelVl = loadInt(".cancel_vl", 75);
private ImpossibleChat()
{
super("ImpossibleChat");
}
@EventHandler
public void onAsyncChat(final AsyncPlayerChatEvent event)
{
final var user = User.getUser(event.getPlayer());
if (User.isUserInvalid(user, this)) return;
if (user.getPlayer().isSprinting() ||
user.getPlayer().isSneaking() ||
user.getPlayer().isBlocking() ||
user.getPlayer().isDead() ||
// Have the inventory opened for some time
(user.hasOpenInventory() && user.notRecentlyOpenedInventory(1000)))
{
this.getManagement().flag(Flag.of(user).setAddedVl(25).setCancelAction(cancelVl, () -> event.setCancelled(true)));
}
}
@Override
protected ViolationManagement createViolationManagement()
{
return ViolationLevelManagement.builder(this).loadThresholdsToManagement().withDecay(600, 25).build();
}
}
// NOTE (AI): The cancel threshold (default 75 VL) means repeated impossible chat eventually gets silenced.Flags chat messages sent while the player's client settings declare chat visibility as hidden.
Tracks the chat-visibility value from inbound client settings (FULL, SYSTEM or HIDDEN). When a chat message arrives and the tracked visibility is HIDDEN, the check fails; the first occurrence is used as an initial-flag grace so settings that arrive late do not cause false positives.
// ===== FILE: amnoah-BetterAnticheat, core/src/main/java/better/anticheat/core/check/impl/chat/HiddenChatCheck.java =====
package better.anticheat.core.check.impl.chat;
import better.anticheat.core.BetterAnticheat;
import better.anticheat.core.check.Check;
import better.anticheat.core.check.CheckInfo;
import better.anticheat.core.player.Player;
import com.github.retrooper.packetevents.event.simple.PacketPlayReceiveEvent;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientSettings;
/**
* This check looks for chatting with no chat box.
*/
@CheckInfo(name = "HiddenChat", category = "chat")
public class HiddenChatCheck extends Check {
private boolean canChat = true, initalFlag = false;
public HiddenChatCheck(BetterAnticheat plugin, Player player) {
super(plugin, player);
}
@Override
public void handleReceivePlayPacket(PacketPlayReceiveEvent event) {
/*
* In Minecraft, there are three chat modes:
* FULL - Full access to the chat with other players.
* SYSTEM - You should only be able to interact with the Minecraft server, not other players.
* HIDDEN - You cannot interact with anything.
* So, if a player interacts with the chat on Hidden, they're cheating!
*/
switch (event.getPacketType()) {
case CLIENT_SETTINGS:
try {
WrapperPlayClientSettings wrapper = new WrapperPlayClientSettings(event);
switch (wrapper.getChatVisibility()) {
case FULL:
case SYSTEM:
canChat = true;
break;
case HIDDEN:
canChat = false;
break;
}
} catch (final Exception e) {
player.getChecks().remove(this);
return;
}
break;
case CHAT_MESSAGE:
if (!canChat) {
// Settings aren't always sent to update this until after chats are sent.
if (initalFlag) fail();
else initalFlag = true;
}
break;
}
}
}
// NOTE (AI): The initial-flag grace exists because the client does not always re-send settings before the first chat message.Related Packets
Wiki Cross-Reference
Position 2 (above the hotbar action bar) is the overlay-style message, while position 0 goes to the chat box.
MCP 1.8.9 S02PacketChat implements Packet
1.8.9 callers: EntityPlayerMP.displayGUIChest sends new S02PacketChat (line 780) +2 more: https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/entity/player/EntityPlayerMP.java
Cross-checked against minecraft.wiki (CC BY-SA 3.0) for 1.8.9 accuracy.
Vanilla Internals
Full 1.8.9 logic-class sources that send or handle this packet, stored verbatim.
Module Analyses Using S02PacketChat
Full source walkthroughs of the modules and anti-cheats that use this packet.