0x15 C15PacketClientSettings
Client sends its locale, view distance, chat mode, chat colors, difficulty preference, and cape visibility.
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| locale | String | Client language (en_US, zh_CN, etc.) |
| viewDistance | byte | Client render distance in chunks (2-32) |
| chatVisibility | byte | 0=full, 1=commandsOnly, 2=hidden |
| chatColors | boolean | Enable chat color/formatting codes |
| difficulty | byte | Client difficulty preference (0-3) |
| showCape | boolean | Show player capes |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Locale | String | en_US, zh_CN, etc. |
| View Distance | byte | 2-32 chunks |
| Chat Mode | byte | 0=shown, 1=commandsOnly, 2=hidden |
| Chat Colors | bool | |
| Difficulty | unsigned byte | Client-side preference |
| Show Cape | bool |
MCP References
NetHandlerPlayServer.processClientSettings()Handler Interface
INetHandlerPlayServerNotes
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 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
Deobfuscated MCP 1.8.9 source of C15PacketClientSettings, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/client/C15PacketClientSettings.java) at build time and verified present.
Deep Dive
Role in the protocol
C15 declares client preferences: locale string, render distance byte, chat visibility enum, chat colors flag and a model-part bitmask. Vanilla re-sends it from GameSettings whenever any of those settings change, and the server stores the values on the player. It is the only serverbound packet that carries the client's locale, which makes it the hook for server-side language detection.
Vanilla handling
processClientSettings delegates to EntityPlayerMP.handleClientSettings, which stores translator (locale), chatVisibility and chatColours on the player and pushes the model-part flags into DataWatcher slot 10. The render distance byte is parsed but not stored by the bundled 1.8.9 handler; chunk streaming distance stays server-configured. The locale is what language-detection plugins read.
Why clients touch it
None of the clients ships a locale-spoof module; the corpus hits are indirect. Rise 6.x PingSpoofComponent lists C15 in its blink tuple so settings packets are held and replayed during blink spoofs, and the script PacketAPI exposes sendSettings(). November Recode 2.0 maps C15PacketClientSettings to wire id 0x15 in its LuaEventPacket wrapper so Lua scripts can recognize the packet by id. Spicy's Bhop imports C15 without using it. Clients known to cancel C15 for locale bypasses exist outside this corpus.
Exploit surface
The packet is informational and server-validated trivially, so abuse is limited to two corners: re-sending it to reset the server's stored locale after a language change (defeating per-locale chat filters), and the blink interaction, where holding C15 for the blink window freezes the server's view of client settings. The model-part bitmask is the only field that reaches other players (via DataWatcher), so a corrupted mask is the only client-visible side effect.
Server-Side Handling
processClientSettings -> EntityPlayerMP.handleClientSettings: stores locale, chat visibility and colors; model-part flags go to DataWatcher slot 10 (broadcast to other players). Render distance is parsed and discarded in the bundled 1.8.9 sources. No validation beyond String length.
Protocol Analysis
String locale + byte viewDistance + byte chatVisibility enum + bool colors + byte modelPartFlags (bitmask for cape/jacket/sleeves/pants/hat). Re-sent on every settings change, so a settings GUI session naturally emits several. The locale is a plain String and is never matched against a known list.
Anti-Cheat Landscape
No anti-cheat measures C15. Language-detection and anti-spam plugins key off the locale string; spoofing it changes plugin behavior, not server physics. The blink-hold interaction matters to anti-cheats only insofar as the same component also holds C03 and C0F packets, which is where the actual detection signal lives.
implementation Implementation Cases
The settings declaration packet. No locale-spoof module exists in the corpus; C15 shows up only inside Rise 6.x's blink-hold component, the script PacketAPI, November Recode 2.0's Lua packet-id map, plus dead imports in Spicy Bhop.
Hold C15 (with C13, C17, C18, C19 and movement packets) while the client blinks, then replay it in order.
C15 is in the blink class tuple. When blink() enables the regular and blink tuples, onPacket cancels matching packets and parks them with a timestamp; PostMotionEvent replays entries whose delay elapsed and dispatch() flushes the rest on world change.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/component/impl/player/PingSpoofComponent.java =====
package com.alan.clients.component.impl.player;
import com.alan.clients.component.Component;
import com.alan.clients.event.CancellableEvent;
import com.alan.clients.event.Listener;
import com.alan.clients.event.annotations.EventLink;
import com.alan.clients.event.impl.motion.PostMotionEvent;
import com.alan.clients.event.impl.other.WorldChangeEvent;
import com.alan.clients.event.impl.packet.PacketReceiveEvent;
import com.alan.clients.event.impl.packet.PacketSendEvent;
import com.alan.clients.util.packet.PacketUtil;
import net.minecraft.client.gui.GuiDownloadTerrain;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.*;
import net.minecraft.network.play.server.*;
import net.minecraft.util.Tuple;
import rip.vantage.commons.util.time.StopWatch;
import java.util.Arrays;
import java.util.concurrent.ConcurrentLinkedQueue;
public final class PingSpoofComponent extends Component {
public static ConcurrentLinkedQueue<PacketUtil.TimedPacket> packets = new ConcurrentLinkedQueue<>();
static StopWatch enabledTimer = new StopWatch();
public static boolean enabled;
static long amount;
static Tuple<Class[], Boolean> regular = new Tuple<>(new Class[]{C0FPacketConfirmTransaction.class, C00PacketKeepAlive.class, S1CPacketEntityMetadata.class}, false);
static Tuple<Class[], Boolean> velocity = new Tuple<>(new Class[]{S12PacketEntityVelocity.class, S27PacketExplosion.class}, false);
static Tuple<Class[], Boolean> teleports = new Tuple<>(new Class[]{S08PacketPlayerPosLook.class, S39PacketPlayerAbilities.class, S09PacketHeldItemChange.class}, false);
static Tuple<Class[], Boolean> players = new Tuple<>(new Class[]{S13PacketDestroyEntities.class, S14PacketEntity.class, S14PacketEntity.S16PacketEntityLook.class, S14PacketEntity.S15PacketEntityRelMove.class, S14PacketEntity.S17PacketEntityLookMove.class, S18PacketEntityTeleport.class, S20PacketEntityProperties.class, S19PacketEntityHeadLook.class}, false);
static Tuple<Class[], Boolean> blink = new Tuple<>(new Class[]{C02PacketUseEntity.class, C0DPacketCloseWindow.class, C0EPacketClickWindow.class, C0CPacketInput.class, C0BPacketEntityAction.class, C08PacketPlayerBlockPlacement.class, C07PacketPlayerDigging.class, C09PacketHeldItemChange.class, C13PacketPlayerAbilities.class, C15PacketClientSettings.class, C16PacketClientStatus.class, C17PacketCustomPayload.class, C18PacketSpectate.class, C19PacketResourcePackStatus.class, C03PacketPlayer.class, C03PacketPlayer.C04PacketPlayerPosition.class, C03PacketPlayer.C05PacketPlayerLook.class, C03PacketPlayer.C06PacketPlayerPosLook.class, C0APacketAnimation.class}, false);
static Tuple<Class[], Boolean> movement = new Tuple<>(new Class[]{C03PacketPlayer.class, C03PacketPlayer.C04PacketPlayerPosition.class, C03PacketPlayer.C05PacketPlayerLook.class, C03PacketPlayer.C06PacketPlayerPosLook.class}, false);
public static Tuple<Class[], Boolean>[] types = new Tuple[]{regular, velocity, teleports, players, blink, movement};
@EventLink
public final Listener<PacketSendEvent> send = event -> event.setCancelled(onPacket(event.getPacket(), event).isCancelled());
@EventLink
public final Listener<PacketReceiveEvent> receive = event -> event.setCancelled(onPacket(event.getPacket(), event).isCancelled());
public CancellableEvent onPacket(Packet<?> packet, CancellableEvent event) {
if (!event.isCancelled() && enabled && Arrays.stream(types).anyMatch(tuple -> tuple.getSecond() && Arrays.stream(tuple.getFirst()).anyMatch(regularpacket -> regularpacket == packet.getClass()))) {
event.setCancelled();
packets.add(new PacketUtil.TimedPacket(packet));
}
return event;
}
public static void dispatch() {
if (!packets.isEmpty()) {
// Stops the packets from being called twice
boolean enabled = PingSpoofComponent.enabled;
PingSpoofComponent.enabled = false;
packets.forEach(timedPacket -> PacketUtil.queue(timedPacket.getPacket()));
PingSpoofComponent.enabled = enabled;
packets.clear();
}
}
public static void disable() {
enabled = false;
enabledTimer.setMillis(enabledTimer.millis - 999999999);
}
@EventLink
public final Listener<WorldChangeEvent> onWorldChange = event -> dispatch();
@EventLink
public final Listener<PostMotionEvent> onPostMotion = event -> {
if (!(enabled = !enabledTimer.finished(100) && !(mc.currentScreen instanceof GuiDownloadTerrain))) {
dispatch();
} else {
// Stops the packets from being called twice
enabled = false;
packets.forEach(packet -> {
if (packet.getTime() + amount < System.currentTimeMillis()) {
PacketUtil.queue(packet.getPacket());
packets.remove(packet);
}
});
enabled = true;
}
};
public static void spoof(int amount, boolean regular, boolean velocity, boolean teleports, boolean players) {
spoof(amount, regular, velocity, teleports, players, false);
}
public static void spoof(int amount, boolean regular, boolean velocity, boolean teleports, boolean players, boolean blink, boolean movement) {
enabledTimer.reset();
PingSpoofComponent.regular.setSecond(regular);
PingSpoofComponent.velocity.setSecond(velocity);
PingSpoofComponent.teleports.setSecond(teleports);
PingSpoofComponent.players.setSecond(players);
PingSpoofComponent.blink.setSecond(blink);
PingSpoofComponent.movement.setSecond(movement);
PingSpoofComponent.amount = amount;
}
public static void spoof(int amount, boolean regular, boolean velocity, boolean teleports, boolean players, boolean blink) {
spoof(amount, regular, velocity, teleports, players, blink, false);
}
public static void blink() {
spoof(9999999, true, false, false, false, true);
}
}
// NOTE (AI): PingSpoofComponent is the Rise 6.x packet-hold engine. C15 sits in the 'blink' tuple, one of six packet class lists. The tuples' boolean flags are flipped by spoof(amount, regular, velocity, teleports, players, blink, movement); blink() calls spoof(9999999, true, false, false, false, true), so during a blink every packet in the regular and blink tuples, C15 included, is cancelled and parked in the timed queue, then replayed by dispatch() or the PostMotionEvent flush when the hold window elapses. C13, C17, C18 and C19 share the same tuple, which is why this component reappears on their impl pages.Expose a settings re-declaration to the scripting layer.
sendSettings() constructs a default C15PacketClientSettings and sends it via PacketUtil.send.
// ===== FILE: Rise 6.2.4, Client-release2/Client/src/main/java/com/alan/clients/script/api/PacketAPI.java =====
package com.alan.clients.script.api;
import com.alan.clients.Client;
import com.alan.clients.component.impl.player.Slot;
import com.alan.clients.script.api.wrapper.impl.ScriptEntity;
import com.alan.clients.script.api.wrapper.impl.ScriptItemStack;
import com.alan.clients.script.api.wrapper.impl.vector.ScriptVector3d;
import com.alan.clients.util.packet.PacketUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.PlayerCapabilities;
import net.minecraft.network.play.client.*;
import net.minecraft.util.BlockPos;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.Vec3;
public class PacketAPI extends API {
public void sendKeepAlive(final int key) {
PacketUtil.send(new C00PacketKeepAlive(key));
}
public void sendMessage(final String message) {
PacketUtil.send(new C01PacketChatMessage(message));
}
public void sendUseEntity(final ScriptEntity entity, final String action) {
sendUseEntity(entity.getEntityId(), action);
}
public void sendUseEntity(final int entityID, final String action) {
PacketUtil.send(new C02PacketUseEntity(Minecraft.getMinecraft().theWorld.getEntityByID(entityID),
C02PacketUseEntity.Action.valueOf(action)));
}
public void sendUseEntity(final int entityID, ScriptVector3d vector) {
PacketUtil.send(new C02PacketUseEntity(Minecraft.getMinecraft().theWorld.getEntityByID(entityID),
new Vec3(vector.getX(), vector.getY(), vector.getZ())));
}
public void sendUseEntity(final ScriptEntity entity, ScriptVector3d vector) {
sendUseEntity(entity.getEntityId(), vector);
}
public void sendPosition(boolean ground) {
PacketUtil.send(new C03PacketPlayer(ground));
}
public void sendPosition(double x, double y, double z, boolean ground) {
PacketUtil.send(new C03PacketPlayer.C04PacketPlayerPosition(x, y, z, ground));
}
public void sendPosition(double x, double y, double z, float yaw, float pitch, boolean ground) {
PacketUtil.send(new C03PacketPlayer.C06PacketPlayerPosLook(x, y, z, yaw, pitch, ground));
}
public void sendDigging(String status, ScriptVector3d vector3d, String facing) {
PacketUtil.send(new C07PacketPlayerDigging(C07PacketPlayerDigging.Action.valueOf(status),
new BlockPos(vector3d.getX(), vector3d.getY(), vector3d.getZ()), EnumFacing.valueOf(facing)));
}
public void sendPlacement() {
PacketUtil.send(new C08PacketPlayerBlockPlacement(Client.INSTANCE.getComponentManager().get(Slot.class).getItemStack()));
}
public void sendPlacement(ScriptVector3d vector3d, int direction, float x, float y, float z) {
PacketUtil.send(new C08PacketPlayerBlockPlacement(new BlockPos(vector3d.getX(), vector3d.getY(), vector3d.getZ()),
direction, Client.INSTANCE.getComponentManager().get(Slot.class).getItemStack(), x, y, z));
}
public void sendPlacement(ScriptVector3d vector3d, int direction, ScriptItemStack itemStack, float x, float y, float z) {
PacketUtil.send(new C08PacketPlayerBlockPlacement(new BlockPos(vector3d.getX(), vector3d.getY(), vector3d.getZ()),
direction, itemStack.getWrapped(), x, y, z));
}
public void sendChangeItem(int slot) {
PacketUtil.send(new C09PacketHeldItemChange(slot));
}
public void sendAnimation(int entityID, String animation) {
PacketUtil.send(new C0APacketAnimation());
}
public void sendEntityAction(int entityID, String action) {
PacketUtil.send(new C0BPacketEntityAction(Minecraft.getMinecraft().theWorld.getEntityByID(entityID),
C0BPacketEntityAction.Action.valueOf(action)));
}
public void sendInput(final float strafeSpeed, final float forwardSpeed, final boolean jumping, final boolean sneaking) {
PacketUtil.send(new C0CPacketInput(strafeSpeed, forwardSpeed, jumping, sneaking));
}
public void sendCloseWindow(int windowId) {
PacketUtil.send(new C0DPacketCloseWindow(windowId));
}
public void sendCloseWindow() {
PacketUtil.send(new C0DPacketCloseWindow(Minecraft.getMinecraft().thePlayer.openContainer.windowId));
}
public void sendEnchantItem(int windowId, int enchantment) {
PacketUtil.send(new C11PacketEnchantItem(windowId, enchantment));
}
public void sendEnchantItem(int enchantment) {
PacketUtil.send(new C11PacketEnchantItem(Minecraft.getMinecraft().thePlayer.openContainer.windowId, enchantment));
}
public void sendTransaction(int windowId, short actionNumber, boolean accepted) {
PacketUtil.send(new C0FPacketConfirmTransaction(windowId, actionNumber, accepted));
}
public void sendAbilities() {
PacketUtil.send(new C13PacketPlayerAbilities(Minecraft.getMinecraft().thePlayer.capabilities));
}
public void sendAbilities(boolean flying, boolean allowFlying, boolean creativeMode) {
PlayerCapabilities capabilities = new PlayerCapabilities();
capabilities.isFlying = flying;
capabilities.allowFlying = allowFlying;
capabilities.isCreativeMode = creativeMode;
PacketUtil.send(new C13PacketPlayerAbilities(capabilities));
}
public void sendTabComplete(String message) {
PacketUtil.send(new C14PacketTabComplete(message));
}
public void sendTabComplete(String message, ScriptVector3d vector3d) {
PacketUtil.send(new C14PacketTabComplete(message, new BlockPos(vector3d.getX(), vector3d.getY(), vector3d.getZ())));
}
public void sendStatus(String status) {
PacketUtil.send(new C16PacketClientStatus(C16PacketClientStatus.EnumState.valueOf(status)));
}
public void sendSettings() {
PacketUtil.send(new C15PacketClientSettings());
}
}
// NOTE (AI): sendSettings() builds a default C15PacketClientSettings and pushes it through PacketUtil.send. The no-arg constructor leaves the fields at vanilla defaults (locale en_US, view distance and chat settings from the packet's field initializers), so the call is a settings re-declaration rather than a spoof.Expose the serverbound packet id space to the Lua scripting API: C15 resolves to id 0x15 so scripts can recognize settings declarations by id.
A static block maps every serverbound play packet class to its 1.8.9 wire id, C15PacketClientSettings to 0x15. The constructor resolves the id from the EventPacket payload via getOrDefault (falling back to -1) and stamps a direction string ('out' for EventPacket.Out, 'in' otherwise); Lua event wrappers then pass the id and direction to scripts. The map exists because runtime obfuscation would break reflection-based lookups.
// ===== FILE: November Recode 2.0, scripting/wrapper/event/LuaEventPacket.java =====
/* November.lol © 2023 */
package lol.november.scripting.wrapper.event;
import java.util.HashMap;
import java.util.Map;
import lol.november.listener.event.net.EventPacket;
import lol.november.protect.DontObfuscate;
import lombok.Getter;
import lombok.Setter;
import net.minecraft.network.Packet;
import net.minecraft.network.play.client.*;
/**
* @author Gavin
* @since 2.0.0
*/
@Getter
@Setter
@DontObfuscate
public class LuaEventPacket {
/**
* A map of each {@link Packet} to their id
*/
private static final Map<Class<? extends Packet<?>>, Integer> packetIds =
new HashMap<>();
static {
// you may ask: why not use reflection and just.. do a funny?
// obfuscation eventually happens so this aids has to happen
packetIds.put(C0APacketAnimation.class, 0x0A);
packetIds.put(C0BPacketEntityAction.class, 0x0B);
packetIds.put(C0CPacketInput.class, 0x0C);
packetIds.put(C0DPacketCloseWindow.class, 0x0D);
packetIds.put(C0EPacketClickWindow.class, 0x0E);
packetIds.put(C0FPacketConfirmTransaction.class, 0x0F);
packetIds.put(C00PacketKeepAlive.class, 0x00);
packetIds.put(C01PacketChatMessage.class, 0x01);
packetIds.put(C02PacketUseEntity.class, 0x02);
packetIds.put(C03PacketPlayer.class, 0x03);
packetIds.put(C03PacketPlayer.C04PacketPlayerPosition.class, 0x04);
packetIds.put(C03PacketPlayer.C05PacketPlayerLook.class, 0x05);
packetIds.put(C03PacketPlayer.C06PacketPlayerPosLook.class, 0x06);
packetIds.put(C07PacketPlayerDigging.class, 0x07);
packetIds.put(C08PacketPlayerBlockPlacement.class, 0x08);
packetIds.put(C09PacketHeldItemChange.class, 0x09);
packetIds.put(C10PacketCreativeInventoryAction.class, 0x10);
packetIds.put(C11PacketEnchantItem.class, 0x11);
packetIds.put(C12PacketUpdateSign.class, 0x12);
packetIds.put(C13PacketPlayerAbilities.class, 0x13);
packetIds.put(C14PacketTabComplete.class, 0x14);
packetIds.put(C15PacketClientSettings.class, 0x15);
packetIds.put(C16PacketClientStatus.class, 0x16);
packetIds.put(C17PacketCustomPayload.class, 0x17);
packetIds.put(C18PacketSpectate.class, 0x18);
packetIds.put(C19PacketResourcePackStatus.class, 0x19);
}
private final int packet;
private final String direction;
public LuaEventPacket(EventPacket event) {
packet = packetIds.getOrDefault(event.get().getClass(), -1);
direction = event.get() instanceof EventPacket.Out ? "out" : "in";
}
}
// NOTE (AI): Same wrapper as the C11 and C12 entries: C15PacketClientSettings maps to 0x15 in the hard-coded id table. The wrapper is read-only visibility for scripts; the actual settings emission still runs through the vanilla GameSettings change path.
anticheat Anti-Cheat Checks
The client-settings packet carries locale, view distance, chat visibility and the skin-parts bitmask, so anticheats read it for two purposes: enforcing protocol limits (Grim CrashE, BetterAnticheat SmallRender) and tying chat visibility to chat activity (Grim ChatD, BetterAnticheat HiddenChat). Photon reads the skin bitmask to catch skinblinker mods that toggle parts while sprinting or that set the unused 0x80 bit.
Stop chat messages from clients that set chat visibility to hidden.
Tracks the chatVisibility flag from CLIENT_SETTINGS in both the play and configuration protocol states, then cancels any CHAT_MESSAGE or CHAT_COMMAND sent while the flag is HIDDEN, flagging each attempt.
// ===== FILE: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/checks/impl/chat/ChatD.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.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.common.client.WrapperCommonClientSettings;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientSettings;
@CheckData(name = "ChatD", stableKey = "grim.exploit.chat_while_hidden", description = "Chatting while chat is hidden")
public class ChatD extends Check implements PreViaPacketReceiveListener {
private boolean hidden;
public ChatD(GrimPlayer player) {
super(player);
}
@Override
public void onPreViaPacketReceive(PacketReceiveEvent event) {
if (event.getPacketType() == PacketType.Play.Client.CHAT_MESSAGE
|| event.getPacketType() == PacketType.Play.Client.CHAT_COMMAND_UNSIGNED
|| event.getPacketType() == PacketType.Play.Client.CHAT_COMMAND) {
if (hidden && flag() && shouldModifyPackets()) {
event.setCancelled(true);
player.onPacketCancel();
}
}
if (event.getPacketType() == PacketType.Play.Client.CLIENT_SETTINGS || event.getPacketType() == PacketType.Configuration.Client.CLIENT_SETTINGS) {
hidden = new WrapperPlayClientSettings(event).getChatVisibility() == WrapperCommonClientSettings.ChatVisibility.HIDDEN;
}
}
}
// NOTE (AI): Grim also handles the configuration-state variant of CLIENT_SETTINGS, which matters on 1.20.2+ where settings move into the configuration phase.Enforce the minimum view distance the client may advertise.
On CLIENT_SETTINGS, wraps the packet and if the view distance is below 2, flags the value and rewrites it to 2 before the server processes the packet.
// ===== FILE: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/checks/impl/crash/CrashE.java =====
package ac.grim.grimac.checks.impl.crash;
import ac.grim.grimac.api.storage.verbose.Verbose;
import ac.grim.grimac.checks.Check;
import ac.grim.grimac.checks.CheckData;
import ac.grim.grimac.checks.type.PacketReceiveListener;
import ac.grim.grimac.player.GrimPlayer;
import com.github.retrooper.packetevents.event.PacketReceiveEvent;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientSettings;
@CheckData(name = "CrashE", stableKey = "grim.crash.low_view_distance", description = "Sent a client view distance below the minimum allowed value")
public class CrashE extends Check implements PacketReceiveListener {
private static final Verbose V = Verbose.of("distance={sint}");
public CrashE(GrimPlayer playerData) {
super(playerData);
}
@Override
public void onPacketReceive(final PacketReceiveEvent event) {
if (event.getPacketType() == PacketType.Play.Client.CLIENT_SETTINGS) {
WrapperPlayClientSettings wrapper = new WrapperPlayClientSettings(event);
int viewDistance = wrapper.getViewDistance();
if (viewDistance < 2) {
flag(V.write(verbose()).sint(viewDistance));
wrapper.setViewDistance(2);
}
}
}
}
// NOTE (AI): The check rewrites the packet in place rather than cancelling it, so the client connection stays healthy while the impossible value is neutralized.Catch skin-part toggles that happen while the player is sprinting or sneaking.
On CLIENT_SETTINGS, reads the skin-parts bitmask and compares it to the last saved mask. If the player is sprinting or sneaking and the mask changed, the module flags with a violation level of 50. An unmodified client can only change settings from the menu, where sprint and sneak are impossible.
// ===== FILE: Photon-GitHub-AntiCheatAddition, src/main/java/de/photon/anticheataddition/modules/checks/skinblinker/SkinBlinkerSprinting.java =====
package de.photon.anticheataddition.modules.checks.skinblinker;
import com.github.retrooper.packetevents.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientSettings;
import de.photon.anticheataddition.modules.ModuleLoader;
import de.photon.anticheataddition.modules.ViolationModule;
import de.photon.anticheataddition.user.User;
import de.photon.anticheataddition.util.protocol.PacketAdapterBuilder;
import de.photon.anticheataddition.util.violationlevels.Flag;
import de.photon.anticheataddition.util.violationlevels.ViolationLevelManagement;
import de.photon.anticheataddition.util.violationlevels.ViolationManagement;
import java.util.OptionalInt;
public final class SkinBlinkerSprinting extends ViolationModule
{
public static final SkinBlinkerSprinting INSTANCE = new SkinBlinkerSprinting();
private SkinBlinkerSprinting() {super("Skinblinker.parts.Sprinting");}
@Override
protected ModuleLoader createModuleLoader()
{
return ModuleLoader.builder(this)
.addPacketListeners(PacketAdapterBuilder.of(this, PacketType.Play.Client.CLIENT_SETTINGS).onReceiving((event, user) -> {
/*
* An unmodified client can only send such packets if the player is in the menu
* -> They obviously cannot sprint or sneak while doing this.
* -> They can move, especially in MC 1.9+ because of entity-collision, etc.
* -> As of the render-debug-cycle which can be done in the game (F3 + F) I need to check for the change of the skin.
*/
final WrapperPlayClientSettings settings = new WrapperPlayClientSettings(event);
final byte skinMask = settings.getSkinMask();
// Sprinting or sneaking (detection)
if ((user.getPlayer().isSprinting() || user.getPlayer().isSneaking())
// The skin mask has been changed
&& handleSentSkinMask(user, skinMask)) {
getManagement().flag(Flag.of(user)
.setAddedVl(50)
.setDebug(() -> "SkinBlinkerSprinting: Skin changed while sprinting or sneaking. New skinmask is %x".formatted(skinMask)));
}
}).build())
.build();
}
/**
* Updates the saved skin components.
*
* @return true if there was already a skin mask saved before, and it differs from the new skin mask.
*/
public boolean handleSentSkinMask(User user, int skinMask)
{
final OptionalInt oldSkin = user.getData().object.skinComponents;
final boolean skinChange = oldSkin.isPresent() && oldSkin.getAsInt() != skinMask;
// Update the skin components.
user.getData().object.skinComponents = OptionalInt.of(skinMask);
return skinChange;
}
@Override
protected ViolationManagement createViolationManagement()
{
return ViolationLevelManagement.builder(this)
.emptyThresholdManagement()
.withDecay(200, 25).build();
}
}
// NOTE (AI): Photon stores the last mask per user and only flags on a real change, so a player who re-opens settings without toggling anything is not flagged.Catch players who hide the chat but keep chatting.
Tracks chatVisibility from CLIENT_SETTINGS (FULL and SYSTEM set canChat true, HIDDEN sets it false). When a CHAT_MESSAGE arrives while hidden, the check fails, with a one-message grace period because the settings packet can lag behind the chat packet.
// ===== 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 check disables itself if the settings wrapper throws, since the wrapper is known to be unstable on some protocol versions.Flag impossibly small render distances.
On CLIENT_SETTINGS, fails when the view distance is below 2, the lowest value an unmodified modern client can select.
// ===== FILE: amnoah-BetterAnticheat, core/src/main/java/better/anticheat/core/check/impl/misc/SmallRenderCheck.java =====
package better.anticheat.core.check.impl.misc;
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.protocol.packettype.PacketType;
import com.github.retrooper.packetevents.wrapper.play.client.WrapperPlayClientSettings;
/**
* This check looks for excessively small render distance values.
*/
@CheckInfo(name = "SmallRender", category = "misc")
public class SmallRenderCheck extends Check {
public SmallRenderCheck(BetterAnticheat plugin, Player player) {
super(plugin, player);
}
@Override
public void handleReceivePlayPacket(PacketPlayReceiveEvent event) {
/*
* In modern clients, the lowest value that the render distance can be set to without modification is 2.
* There's some issue right now with the Settings wrapper throwing exceptions. This try catch is a quick patch
* until that can be investigated fully.
*/
if (event.getPacketType() != PacketType.Play.Client.CLIENT_SETTINGS) return;
try {
WrapperPlayClientSettings wrapper = new WrapperPlayClientSettings(event);
if (wrapper.getViewDistance() < 2) fail();
} catch (final Exception e) {
return;
}
}
}
// NOTE (AI): The try-catch around the wrapper is a known workaround for a PacketEvents settings-wrapper exception on some versions.Related Packets
Wiki Cross-Reference
1.8.9 wire is lang max 7 chars, byte view, byte chat visibility, bool colors, unsigned byte model-part mask.
Has no separate difficulty or cape bools; skin parts ride in the mask and reach others via DataWatcher.
Resent on settings change; server stores locale and chat prefs while chunk radius stays server-side.
MCP 1.8.9 C15PacketClientSettings implements Packet
1.8.9 callers: GameSettings.sendSettingsToServer sends new C15PacketClientSettings (line 1214): https://github.com/Marcelektro/MavenMCP-1.8.9/blob/master/src/main/java/net/minecraft/client/settings/GameSettings.java
Cross-checked against minecraft.wiki (CC BY-SA 3.0) for 1.8.9 accuracy.