0x40 S40PacketDisconnect
Kicks the player from the server during gameplay with a JSON chat component reason message.
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| reason | IChatComponent (JSON) | Kick/disconnection reason displayed to the player |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Reason | Chat Component (JSON) | JSON-serialized IChatComponent |
MCP References
NetHandlerPlayClient.handleDisconnect()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 | |
Deobfuscated MCP 1.8.9 source of S40PacketDisconnect, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S40PacketDisconnect.java) at build time and verified present.
Deep Dive
Role in the protocol
The play-state kick. One IChatComponent reason, serialized as a chat component. Sent by NetHandlerPlayServer and NetworkSystem when the server closes a PLAY connection with a reason; the client's handleDisconnect closes the channel and the onDisconnect path unloads the world and shows GuiDisconnected with the reason. It is the play-state counterpart of the login-state S00PacketDisconnect, and it is the last packet on the wire before the server tears the connection down.
Vanilla handling
handleDisconnect calls netManager.closeChannel(reason), which triggers the disconnect cascade: world unload, then GuiDisconnected with the reason. The kick is one-way; there is no acknowledgement. Modules see the packet in PacketReceiveEvent before the vanilla handler runs, which is the only window for reacting to it.
Why clients touch it
Sigma 4.11 Ranking inspects the reason text: if it contains 'ban' and the player has been alive more than 15 seconds, it reports a ban stat into its kill and death ranking telemetry. Rise 5.99 StaffAlert imports S40PacketDisconnect but never branches on it; the module's real work polls the Hypixel punishment API over HTTPS. The classic AutoReconnect and AntiKick modules of the wider ecosystem (Tenacity 5.1, Gugustus) sit outside this corpus, so none of the 8 reference clients cancels the kick. Rise 6.x registers the class in the script API.
Exploit surface
The kick cannot be meaningfully cancelled: the server has already dropped the connection after sending the packet, so cancelling it only skips the disconnect screen and leaves a dead connection. The real value is reading the reason: ban detection for telemetry (Ranking) and staff-ban awareness. Reason parsing is the only client-side logic, and it is invisible to the server. Anti-cheats use S40 as the enforcement channel, not as a measurable signal.
Server-Side Handling
NetHandlerPlayServer and NetworkSystem both send S40 with a GenericFutureListener that closes the channel after the packet flushes, so the kick is fire-and-forget. The reason is built from translated chat components. The server removes the player from its world state regardless of whether the client ever processes the packet.
Protocol Analysis
Single field: a chat component serialized via writeChatComponent, which embeds the full JSON chat tree including formatting and translations. The reason string is attacker-controlled, so clients parsing it must handle arbitrary text. Registered clientbound in PLAY state; the login-state equivalent is S00PacketDisconnect at id 0x00.
Anti-Cheat Landscape
Anti-cheats use S40 as the enforcement channel: a flagged player receives one and is gone, so there is nothing to bypass inside the packet. Client-side modules can only observe it. Ranking's use is the only corpus example of reacting to the reason text, and it is telemetry, not evasion.
implementation Implementation Cases
The play-state kick. Sigma's Ranking reads the reason text for ban telemetry; Rise 5.99's StaffAlert imports the class but never uses it. None of the 8 clients cancels the kick, because the connection is already dead by the time the packet arrives.
Track kills and deaths and report ban kicks to the client's ranking telemetry.
onEvent handles EventPacket; for S40PacketDisconnect it checks func_149165_c().getUnformattedText().toLowerCase().contains("ban") and ticksExisted greater than 15*20, then calls sendStat("ban", ""). The module also correlates S0B animations, S02 chat, S06 health, and S13 destroy-entity packets to attribute kills and deaths.
// ===== FILE: Sigma 4.11, info/sigmaclient/module/impl/other/Ranking.java =====
package info.sigmaclient.module.impl.other;
import info.sigmaclient.Client;
import info.sigmaclient.event.Event;
import info.sigmaclient.event.RegisterEvent;
import info.sigmaclient.event.impl.EventAttack;
import info.sigmaclient.event.impl.EventPacket;
import info.sigmaclient.event.impl.EventUpdate;
import info.sigmaclient.management.users.TTSystem;
import info.sigmaclient.module.Module;
import info.sigmaclient.module.data.ModuleData;
import info.sigmaclient.util.Timer;
import info.sigmaclient.util.misc.ChatUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.EntityPlayerSP;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.*;
import java.io.IOException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.ConcurrentModificationException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.UUID;
public class Ranking extends Module {
private HashMap<Integer, HitEntity> hitEntities = new HashMap<>();
private HashMap<Integer, HitEntity> prosecutorEntities = new HashMap<>();
private HashMap<Integer, Long> lastAnimationTimestamp = new HashMap<>();
private info.sigmaclient.util.Timer delay = new Timer();
public Ranking(ModuleData data) {
super(data);
setHidden(true);
if (!isEnabled()) {
toggle();
}
}
@Override
@RegisterEvent(events = {EventAttack.class, EventPacket.class, EventUpdate.class})
public void onEvent(Event e) {
if (e instanceof EventAttack) {
EventAttack ea = (EventAttack) e;
if (ea.getEntity() instanceof EntityPlayer) {
EntityPlayer ep = (EntityPlayer) ea.getEntity();
if (!ep.getName().isEmpty()) {
if (!hitEntities.containsKey(ep.getEntityId())) {
hitEntities.put(ep.getEntityId(), new HitEntity(ep));
} else {
hitEntities.get(ep.getEntityId()).refresh();
}
}
}
} else if (e instanceof EventPacket) {
EventPacket ep = (EventPacket) e;
Packet packet = ep.getPacket();
if (packet instanceof S0BPacketAnimation) {
S0BPacketAnimation packetAnimation = (S0BPacketAnimation) packet;
lastAnimationTimestamp.put(packetAnimation.func_148978_c(), System.currentTimeMillis());
}
if (packet instanceof S06PacketUpdateHealth) {
S06PacketUpdateHealth packetUpdateHealth = (S06PacketUpdateHealth) packet;
if (packetUpdateHealth.getHealth() <= Minecraft.getMinecraft().thePlayer.getHealth()) {
try{
for (Object o : mc.theWorld.getLoadedEntityList()) {
if (o instanceof EntityPlayer) {
EntityPlayer entityPlayer = (EntityPlayer) o;
if (!(entityPlayer instanceof EntityPlayerSP) && lastAnimationTimestamp.containsKey(entityPlayer.getEntityId())) {
if (lastAnimationTimestamp.get(entityPlayer.getEntityId()) > System.currentTimeMillis() - 70 && entityPlayer.getPositionVector().squareDistanceTo(Minecraft.getMinecraft().thePlayer.getPositionVector()) < 9 * 9) {
if (!prosecutorEntities.containsKey(entityPlayer.getEntityId())) {
prosecutorEntities.put(entityPlayer.getEntityId(), new HitEntity(entityPlayer, true));
} else {
prosecutorEntities.get(entityPlayer.getEntityId()).refresh();
}
}
}
}
}
}catch(ConcurrentModificationException ee){};
}
if (packetUpdateHealth.getHealth() <= 0) {
onDeath();
}
}
if (packet instanceof S02PacketChat) {
S02PacketChat packetChat = (S02PacketChat) packet;
String message = packetChat.func_148915_c().getUnformattedText();
Iterator it = hitEntities.entrySet().iterator();
while (it.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000 && message.contains(hitEntity.getName())) {
if (hitEntity.onChatMessage()) {
it.remove();
}
}
}
Iterator it2 = prosecutorEntities.entrySet().iterator();
while (it2.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it2.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000 && message.contains(hitEntity.getName()) && message.contains(Minecraft.getMinecraft().thePlayer.getName())) {
if (hitEntity.onChatMessage()) {
it2.remove();
}
}
}
} else if (packet instanceof S18PacketEntityTeleport) {
S18PacketEntityTeleport packetTeleport = (S18PacketEntityTeleport) packet;
int entityId = packetTeleport.func_149451_c();
onEntityRemoved(entityId);
} else if (packet instanceof S08PacketPlayerPosLook) {
onDeath();
} else if (packet instanceof S13PacketDestroyEntities) {
S13PacketDestroyEntities packetDestroyEntities = (S13PacketDestroyEntities) packet;
for (int entityId : packetDestroyEntities.func_149098_c()) {
onEntityRemoved(entityId);
}
} else if (packet instanceof S40PacketDisconnect) {
S40PacketDisconnect packetDisconnect = (S40PacketDisconnect) packet;
if (packetDisconnect.func_149165_c().getUnformattedText().toLowerCase().contains("ban") && Minecraft.getMinecraft().thePlayer != null && Minecraft.getMinecraft().thePlayer.ticksExisted > 15 * 20) {
sendStat("ban", "");
}
}
} else if (e instanceof EventUpdate) {
if (delay.delay(1000 * 60 * 10)) {
delay.reset();
sendStat("tick", "");
}
}
}
private void onDeath() {
Iterator it2 = prosecutorEntities.entrySet().iterator();
while (it2.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it2.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000) {
if (hitEntity.onRemoved()) {
it2.remove();
}
}
}
}
private void onEntityRemoved(int entityId) {
Iterator it = hitEntities.entrySet().iterator();
while (it.hasNext()) {
HitEntity hitEntity = ((Map.Entry<Integer, HitEntity>) it.next()).getValue();
if (hitEntity.getTime() > System.currentTimeMillis() - 3000 && entityId == hitEntity.getEntityId()) {
if (hitEntity.onRemoved()) {
it.remove();
}
}
}
}
public void sendStat(String type, String data) {
}
private class HitEntity {
private long time = System.currentTimeMillis();
private UUID uuid;
private String name;
private int entityId;
private boolean removed = false;
private boolean chatMessage = false;
private boolean prosecutor = false;
public HitEntity(EntityPlayer ep) {
uuid = ep.getUniqueID();
name = ep.getName();
entityId = ep.getEntityId();
}
public HitEntity(EntityPlayer ep, boolean prosecutor) {
uuid = ep.getUniqueID();
name = ep.getName();
entityId = ep.getEntityId();
this.prosecutor = prosecutor;
}
public boolean onRemoved() {
removed = true;
if (chatMessage) {
if (prosecutor) {
prosecuted();
} else {
killed();
}
return true;
}
return false;
}
public boolean onChatMessage() {
chatMessage = true;
if (removed) {
if (prosecutor) {
prosecuted();
} else {
killed();
}
return true;
}
return false;
}
private void killed() {
//ChatUtil.printChat("Kill (" + name + ") " + uuid.toString());
sendStat("kill", "&uuid=" + uuid.toString().replaceAll("-", ""));
}
public void refresh() {
time = System.currentTimeMillis();
}
public String getName() {
return name;
}
public long getTime() {
return time;
}
public int getEntityId() {
return entityId;
}
public void prosecuted() {
//ChatUtil.printChat("Prosecuted (" + name + ") " + uuid.toString());
sendStat("death", "&uuid=" + uuid.toString().replaceAll("-", ""));
}
}
}
// NOTE (AI): The S40PacketDisconnect branch on lines 126-131 fires ban telemetry when the kick reason contains 'ban' and the player has been alive for more than 15 seconds. The rest of the module attributes kills and deaths from S0B, S02, S06, and S13 packets.Alert when staff ban players on Hypixel by polling the punishment API. The S40 import is unused.
Imports S40PacketDisconnect at the top of the file, but the shipped handlers only process S02PacketChat (API key capture) and a periodic HTTPS poll of api.hypixel.net/punishmentstats that shows a notification when staff_total grows. The import is leftover from a planned disconnect-aware feature.
// ===== 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 S40PacketDisconnect import on line 21 is never referenced in the shipped body. The module's actual logic is the S02PacketChat API-key capture and the punishmentstats HTTP poll in onUpdate.Expose the packet class to Rise's JavaScript scripting API.
S40PacketDisconnect is listed in the clientbound Class array of NetworkAPI.java (line 107).
// ===== FILE: Rise 6.1.30, com/alan/clients/script/api/NetworkAPI.java =====
package com.alan.clients.script.api;
import com.alan.clients.util.chat.ChatUtil;
import lombok.SneakyThrows;
import net.minecraft.network.EnumPacketDirection;
import net.minecraft.network.Packet;
import net.minecraft.network.play.INetHandlerPlayClient;
import net.minecraft.network.play.INetHandlerPlayServer;
import net.minecraft.network.play.client.*;
import net.minecraft.network.play.server.*;
import javax.script.ScriptException;
import java.util.Arrays;
public class NetworkAPI extends API {
public final static Class<Packet<INetHandlerPlayServer>>[] serverbound = new Class[]{
C00PacketKeepAlive.class,
C01PacketChatMessage.class,
C02PacketUseEntity.class,
C03PacketPlayer.class,
C03PacketPlayer.C04PacketPlayerPosition.class,
C03PacketPlayer.C05PacketPlayerLook.class,
C03PacketPlayer.C06PacketPlayerPosLook.class,
C07PacketPlayerDigging.class,
C08PacketPlayerBlockPlacement.class,
C09PacketHeldItemChange.class,
C0APacketAnimation.class,
C0BPacketEntityAction.class,
C0CPacketInput.class,
C0DPacketCloseWindow.class,
C0EPacketClickWindow.class,
C0FPacketConfirmTransaction.class,
C10PacketCreativeInventoryAction.class,
C11PacketEnchantItem.class,
C12PacketUpdateSign.class,
C13PacketPlayerAbilities.class,
C14PacketTabComplete.class,
C15PacketClientSettings.class,
C16PacketClientStatus.class,
C17PacketCustomPayload.class,
C18PacketSpectate.class,
C19PacketResourcePackStatus.class,
};
public final static Class<Packet<INetHandlerPlayClient>>[] clientbound = new Class[]{
S00PacketKeepAlive.class,
S01PacketJoinGame.class,
S02PacketChat.class,
S03PacketTimeUpdate.class,
S04PacketEntityEquipment.class,
S05PacketSpawnPosition.class,
S06PacketUpdateHealth.class,
S07PacketRespawn.class,
S08PacketPlayerPosLook.class,
S09PacketHeldItemChange.class,
S0APacketUseBed.class,
S0BPacketAnimation.class,
S0CPacketSpawnPlayer.class,
S0DPacketCollectItem.class,
S0EPacketSpawnObject.class,
S0FPacketSpawnMob.class,
S10PacketSpawnPainting.class,
S11PacketSpawnExperienceOrb.class,
S12PacketEntityVelocity.class,
S13PacketDestroyEntities.class,
S14PacketEntity.class,
S18PacketEntityTeleport.class,
S19PacketEntityHeadLook.class,
S19PacketEntityStatus.class,
S1BPacketEntityAttach.class,
S1CPacketEntityMetadata.class,
S1DPacketEntityEffect.class,
S1EPacketRemoveEntityEffect.class,
S1FPacketSetExperience.class,
S20PacketEntityProperties.class,
S21PacketChunkData.class,
S22PacketMultiBlockChange.class,
S23PacketBlockChange.class,
S24PacketBlockAction.class,
S25PacketBlockBreakAnim.class,
S26PacketMapChunkBulk.class,
S27PacketExplosion.class,
S28PacketEffect.class,
S29PacketSoundEffect.class,
S2APacketParticles.class,
S2BPacketChangeGameState.class,
S2CPacketSpawnGlobalEntity.class,
S2DPacketOpenWindow.class,
S2EPacketCloseWindow.class,
S2FPacketSetSlot.class,
S30PacketWindowItems.class,
S31PacketWindowProperty.class,
S32PacketConfirmTransaction.class,
S33PacketUpdateSign.class,
S34PacketMaps.class,
S35PacketUpdateTileEntity.class,
S36PacketSignEditorOpen.class,
S37PacketStatistics.class,
S38PacketPlayerListItem.class,
S39PacketPlayerAbilities.class,
S3APacketTabComplete.class,
S3BPacketScoreboardObjective.class,
S3CPacketUpdateScore.class,
S3DPacketDisplayScoreboard.class,
S3EPacketTeams.class,
S3FPacketCustomPayload.class,
S40PacketDisconnect.class,
S41PacketServerDifficulty.class,
S42PacketCombatEvent.class,
S43PacketCamera.class,
S44PacketWorldBorder.class,
S45PacketTitle.class,
S46PacketSetCompressionLevel.class,
S47PacketPlayerListHeaderFooter.class,
S48PacketResourcePackSend.class,
S49PacketUpdateEntityNBT.class
};
@SneakyThrows
private static Packet<?> instantiatePacket(final EnumPacketDirection direction, final int id, final Object... params) {
Packet<?> packet = null;
try {
if (direction == EnumPacketDirection.CLIENTBOUND) {
packet = (Packet<?>) Arrays.stream(clientbound[id].getConstructors()).filter(x -> x.getParameterCount() == params.length).findFirst().get().newInstance(params);
} else if (direction == EnumPacketDirection.SERVERBOUND) {
packet = (Packet<?>) Arrays.stream(serverbound[id].getConstructors()).filter(x -> x.getParameterCount() == params.length).findFirst().get().newInstance(params);
}
} catch (Exception ex) {
ChatUtil.display("Failed to instantiate packet!");
throw new ScriptException(ex);
}
return packet;
}
public void sendPacket(final int id, final Object... params) {
final Packet<?> packet = instantiatePacket(EnumPacketDirection.SERVERBOUND, id, params);
MC.getNetHandler().addToSendQueue(packet);
}
public void receivePacket(final int id, final Object... params) {
final Packet<?> packet = instantiatePacket(EnumPacketDirection.CLIENTBOUND, id, params);
MC.getNetHandler().addToReceiveQueue(packet);
}
public boolean isSingleplayer() {
return MC.isSingleplayer();
}
public boolean isMultiplayer() {
return !MC.isSingleplayer() && MC.getCurrentServerData() != null;
}
public String getServerIP() {
return MC.getCurrentServerData() != null
? MC.getCurrentServerData().serverIP
: null;
}
public String getServerName() {
return MC.getCurrentServerData() != null
? MC.getCurrentServerData().serverName
: null;
}
public String getServerMOTD() {
return MC.getCurrentServerData() != null
? MC.getCurrentServerData().serverMOTD
: null;
}
}
// NOTE (AI): The clientbound array lists S40PacketDisconnect at line 107. Identical file ships in Rise 6.2.4 under Client-release2/Client/src/main/java.anticheat Anti-Cheat Checks
No anticheat parses the play-state disconnect packet. The only real packet references are plumbing: Artemis registers PacketPlayServerKickDisconnect (PacketRepository SERVER_PLAY+39, the GPacketPlayServerKickDisconnect wrapper, ProtocolGeneratorDirect and HardcodeMap) and Negativity declares the KICK_DISCONNECT PacketType constant. The rest of the corpus is the anticheats' own kick enforcement matched on the Kick keyword: NCP KickCommand and DenyLoginCommand, intave FaultKicks, Arc PunishmentManager and PlayerPendingKickEvent, Negativity KickCommand and PlayerCheatKickEvent, Peyang Kick, KickUtil and BanAnalyzer, CheaterDeleter TeleportVerifierCheck, Rammelkast and AntiCheatPlus PlayerListener, NESS MiscEvents, proton Kick, ThotPatrol, Daedalus, Kauri JoinListener, AutoEye AutoEyePlayerList, network-dev AlarmUtil and MenuUtil, and Bubble bubble.sk. All of them kick through Bukkit's player.kickPlayer; the server crafts S40 itself when it flushes the connection, so the packet is the enforcement channel, never a measured signal.
Related Packets
Wiki Cross-Reference
Play-state kick: a single JSON chat component reason. Client closes the channel, unloads the world and shows the disconnect screen.
Fire-and-forget last packet before teardown; no acknowledgement. Login-state kicks use S00 instead.
MCP 1.8.9 S40PacketDisconnect implements Packet
1.8.9 callers: NetHandlerPlayServer.kickPlayerFromServer sends new S40PacketDisconnect (line 184) +1 more: https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/network/NetHandlerPlayServer.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.