0x21 S21PacketChunkData
Sends a chunk section (16x16x16 blocks) with compressed block data, light values, and biome info.
Published 2026-06-18 · Updated 2026-10-14
Fields
| Field | Type | Description |
|---|---|---|
| chunkX | int | Chunk X coordinate |
| chunkZ | int | Chunk Z coordinate |
| groundUpContinuous | boolean | True if this is a fresh chunk (sends biome + skylight) |
| bitmask | unsigned short | Which 16-block sections are present (bit 0 = bottom section) |
| dataLength | VarInt | Size of compressed data |
| data | byte[] | Zlib-compressed chunk data (block IDs + block light + sky light + biomes) |
Wire Encoding
| Field | Type | Notes |
|---|---|---|
| Chunk X | int | |
| Chunk Z | int | |
| Ground-Up | bool | Full chunk vs partial update |
| Primary Bitmask | unsigned short | Which sections are included |
| Data Size | VarInt | Compressed data length |
| Data | byte[] | Compressed NBT-like block data |
MCP References
NetHandlerPlayClient.handleChunkData()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 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | |
| 89 | |
| 90 | |
| 91 | |
| 92 | |
| 93 | |
| 94 | |
| 95 | |
| 96 | |
| 97 | |
| 98 | |
| 99 | |
| 100 | |
| 101 | |
| 102 | |
| 103 | |
| 104 | |
| 105 | |
| 106 | |
| 107 | |
| 108 | |
| 109 | |
| 110 | |
| 111 | |
| 112 | |
| 113 | |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | |
| 126 | |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 | |
| 147 | |
| 148 | |
| 149 | |
| 150 | |
| 151 | |
| 152 | |
| 153 | |
| 154 | |
| 155 | |
| 156 | |
| 157 | |
| 158 | |
| 159 | |
| 160 | |
| 161 | |
Deobfuscated MCP 1.8.9 source of S21PacketChunkData, fetched directly from Marcelektro/MavenMCP-1.8.9 (net/minecraft/network/play/server/S21PacketChunkData.java) at build time and verified present.
Deep Dive
Role in the protocol
S21PacketChunkData carries one chunk's block, light and biome data. Server send sites: PlayerManager sends a ground-up chunk on initial load (line 365 in the corpus) and section updates with a bitmask on the chunk update tick (line 447), EntityPlayerMP sends the player's spawn chunk with bitmask 65535, and S26PacketMapChunkBulk is the multi-chunk variant. Wire layout: chunkX int, chunkZ int, groundUpContinuous bool, bitmask unsigned short, dataLength VarInt, then zlib-compressed bytes holding per-section block IDs, block light, sky light and 256 biome bytes for ground-up chunks.
Vanilla handling
NetHandlerPlayClient.handleChunkData first handles unloads: a ground-up packet with bitmask 0 calls doPreChunk(false). Otherwise it invalidates the block receive region, fetches the chunk (loading it if missing), applies the extracted sections through chunk.func_177439_a, marks the range for render update, and resets relight checks for non-surface dimensions. This is the heaviest decompression and block-write path in the play state, and it runs on the client thread.
Why clients touch it
None of the 8 reference clients hook S21 in a module. The only non-vanilla corpus hit is Rise 6.1.30/6.2.4 NetworkAPI, which registers the class (clientbound index 76) so scripts can synthesize chunk packets. The XRay/Search/ChestESP entries from older docs reference Sigma 3.9, which is not in the reference set. Modules that want block data read the loaded Chunk object after vanilla applies it; rewriting chunk content would force them to decompress and re-encode the packed sections, which none of these clients does.
Exploit surface
Cancelling S21 empties the client's view of the world while the player stays in the server world, the core of chunk-void behavior; the server never notices because there is no acknowledgement. The heavier abuse is bandwidth: PlayerManager caps per-tick chunk traffic server-side, but a plugin that floods S21 can stall a client's single-threaded handler. On the client side, Rise 6.x scripts can call receivePacket with a fabricated S21 to draw fake terrain locally, which is render-only and has no server effect.
Server-Side Handling
PlayerManager sends ground-up S21 (bitmask 0, line 365) when a player enters a chunk's watch range, and section updates (groundUp=false, line 447) on the per-chunk update tick, batching changed sections into the bitmask. EntityPlayerMP sends the spawn chunk with all 16 sections (65535). Chunk data is extracted and zlib-compressed at send time; there is no inbound handler because the packet is clientbound.
Protocol Analysis
Each section in the bitmask contributes 4096 block IDs at 2 bytes each plus 2048 block-light and 2048 sky-light nibbles; ground-up chunks append 256 biome bytes. The data field is zlib-compressed as a whole, so the client must inflate it before touching any block. A ground-up packet with bitmask 0 means chunk unload, not empty data. S26PacketMapChunkBulk reuses S21PacketChunkData.Extracted for the bulk variant.
Anti-Cheat Landscape
Anti-cheats never measure S21; the server cannot tell what the client rendered. Chunk-based cheats (XRay, cave finder) are undetectable server-side in principle, which is why they are banned by staff rather than flagged. The client-side risk is stability: malformed or flooded chunk data crashes the vanilla handler, the basis of chunk-ban exploits that server plugins mitigate by validating senders.
implementation Implementation Cases
Chunk payload delivery with zero module usage in the 8 reference clients: block-aware features read the loaded world instead of hooking the packet, and the only non-vanilla reference is the Rise 6.x script registry entry.
anticheat Anti-Cheat Checks
S21 delivers a full chunk column to the client, and it is the transport that makes xray and world-downloader cheating possible. Server-side anticheats approach it from two directions: xray checks score ore-breaking behavior (BAC XRayCheck, AntiCheatPlus XRayListener, Negativity XRayProtocol), sentinel modules neutralize world downloaders at the plugin-message level (Photon WorldDownloaderSentinel), and simulation anticheats parse the chunk bytes into a compensated world so their movement and phase checks see the same blocks the client sees (Grim PacketWorldReaderEight, Hydro WorldTracker, Truthful CompensatedWorld, Kauri Chunk and World, Intave block caches). The corpus for S21 is dominated by the replication side, because every block-based check depends on it.
Ghost-block xray heuristic: spawn fake ore blocks in front of the player and flag anyone who breaks them.
On BlockBreakEvent, when the player breaks an ore, the check walks up to 9 blocks in the player's facing direction and replaces a buried stone block with the same ore type, recording it as a ghost block with a proximity counter. On PlayerMoveEvent, ghost blocks that the player approaches too often and then breaks (5 or more close encounters) fail the check; sneaking while standing over a block also registers it. The check is marked as heavy beta in the config.
// ===== FILE: MC-Jinky-BasicAntiCheat, src/me/jinky/checks/world/XRayCheck.java =====
package me.jinky.checks.world;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.event.player.PlayerMoveEvent;
import me.jinky.checks.Check;
import me.jinky.checks.CheckResult;
import me.jinky.logger.User;
import me.jinky.util.UtilBlock;
public class XRayCheck extends Check {
public static Map<Player, HashMap<Block, Long>> ghostblocks = new HashMap<Player, HashMap<Block, Long>>();
public static Map<Player, HashMap<Block, Integer>> ghostblocks_closecount = new HashMap<Player, HashMap<Block, Integer>>();
public static Map<Player, Long> lastcheck = new HashMap<Player, Long>();
public static Map<Player, HashMap<Block, Double>> ghostblocks_lastcheckloc = new HashMap<Player, HashMap<Block, Double>>();
@Override
public String getName() {
return "XRay";
}
@Override
public String getEventCall() {
return "PlayerMoveEvent";
}
@Override
public String getSecondaryEventCall() {
return "BlockBreakEvent";
}
@Override
public CheckResult performCheck(User u, Event ev) {
Player p = u.getPlayer();
if (ev.getEventName().equalsIgnoreCase("PlayerMoveEvent")) {
if (!lastcheck.containsKey(p)) {
lastcheck.put(p, 1L);
}
PlayerMoveEvent e = (PlayerMoveEvent) ev;
Long math = System.currentTimeMillis() - lastcheck.get(p);
if (e.getTo().getWorld() != e.getFrom().getWorld()) {
if (ghostblocks.containsKey(p)) {
for (Block b : ghostblocks.get(p).keySet()) {
b.setType(Material.STONE);
}
ghostblocks.remove(p);
}
if (ghostblocks_closecount.containsKey(p))
ghostblocks_closecount.remove(p);
if (ghostblocks_lastcheckloc.containsKey(p))
ghostblocks_lastcheckloc.remove(p);
lastcheck.put(p, System.currentTimeMillis());
return new CheckResult("XRay", true, "WorldChange");
}
if (math > 1750 && ghostblocks_closecount.containsKey(p) && e.getFrom().distance(e.getTo()) > 0.1) {
Iterator<Block> i = ghostblocks_closecount.get(p).keySet().iterator();
List<Block> remove = new ArrayList<Block>();
while (i.hasNext()) {
Block b = i.next();
if (b != null && b.getType() != null && !b.getType().toString().contains("ORE")) {
remove.add(b);
return new CheckResult("XRay", true, "pass");
}
Integer count = ghostblocks_closecount.get(p).get(b);
if (b.getLocation().getWorld() != e.getTo().getWorld()) {
return new CheckResult("XRay", true, "WorldChange");
}
if (e.getTo().distance(b.getLocation()) < ghostblocks_lastcheckloc.get(p).get(b)) {
count++;
ghostblocks_closecount.get(p).put(b, count);
} else {
count--;
if (count < 0) {
remove.add(b);
b.setType(Material.STONE);
} else {
ghostblocks_closecount.get(p).put(b, count);
}
}
}
if (remove.size() > 0) {
for (Block b : remove) {
ghostblocks_closecount.get(p).remove(b);
ghostblocks.get(p).remove(b);
ghostblocks_lastcheckloc.get(p).remove(b);
}
}
lastcheck.put(p, System.currentTimeMillis());
}
} else {
if (!ghostblocks.containsKey(p)) {
ghostblocks.put(p, new HashMap<Block, Long>());
}
if (!ghostblocks_closecount.containsKey(p)) {
ghostblocks_closecount.put(p, new HashMap<Block, Integer>());
}
if (p.isSneaking()) {
ghostblocks.get(p).put(p.getLocation().getBlock().getRelative(BlockFace.DOWN),
System.currentTimeMillis());
}
BlockBreakEvent e = (BlockBreakEvent) ev;
if (e.getBlock().getType().toString().contains("ORE")) {
if (ghostblocks.get(p).containsKey(e.getBlock())) {
Integer count = ghostblocks_closecount.get(p).get(e.getBlock());
ghostblocks.get(p).remove(e.getBlock());
ghostblocks_closecount.get(p).remove(e.getBlock());
if (count > 4) {
return new CheckResult("XRay", false, "broke ghostblocks 5+ blocks ret");
}
} else {
BlockFace opposite = getopposite(p);
Block target = e.getBlock();
Integer g = 0;
for (int i = 0; i < 9; i++) {
target = target.getRelative(opposite);
if (i > 4) {
if (UtilBlock.xraysafe(target, target.getType()).size() == 0) {
g++;
if (g == 2 && target.getLocation().getWorld().equals(p.getLocation().getWorld())) {
target.setType(e.getBlock().getType());
ghostblocks.get(p).put(target, System.currentTimeMillis());
ghostblocks_closecount.get(p).put(target, 4);
if (!ghostblocks_lastcheckloc.containsKey(p)) {
ghostblocks_lastcheckloc.put(p, new HashMap<Block, Double>());
}
ghostblocks_lastcheckloc.get(p).put(target,
p.getLocation().distance(target.getLocation()));
break;
}
}
}
}
}
return new CheckResult("XRay", true, "pass");
}
return new CheckResult("XRay", true, "pass");
}
return new CheckResult("XRay", true, "pass");
}
public static BlockFace getopposite(Player player) {
float yaw = player.getLocation().getYaw();
if (yaw < 0) {
yaw += 360;
}
if (yaw >= 315 || yaw < 45) {
return BlockFace.NORTH;
} else if (yaw < 135) {
return BlockFace.EAST;
} else if (yaw < 225) {
return BlockFace.SOUTH;
} else if (yaw < 315) {
return BlockFace.WEST;
}
return BlockFace.NORTH;
}
}
// NOTE (AI): The check is event-based (PlayerMoveEvent and BlockBreakEvent), so the S21 hit is a domain match: the chunk data packet is what makes the buried ores visible to the cheater in the first place.Ore-ratio xray detection: players who mine far more ores per total blocks than the server average are flagged.
BlockBreakEvent feeds per-ore counters (diamond, iron, gold, lapis, redstone) and a total block counter into XRayTracker for every checked player; creative players are skipped unless checkCreativeXRay is enabled. XRayStats snapshots the counts and the scheduled XRay checker compares ratios against the server baseline at the configured alert interval.
// ===== FILE: m1enkrafftman-AntiCheatPlus, src/main/java/net/dynamicdev/anticheat/xray/XRayListener.java =====
/*
* AntiCheat for Bukkit.
* Copyright (C) 2012-2014 AntiCheat Team | http://gravitydevelopment.net
*
* 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 net.dynamicdev.anticheat.xray;
import net.dynamicdev.anticheat.AntiCheat;
import net.dynamicdev.anticheat.check.CheckType;
import net.dynamicdev.anticheat.config.Configuration;
import net.dynamicdev.anticheat.manage.CheckManager;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;
public class XRayListener implements Listener {
private XRayTracker tracker = AntiCheat.getManager().getXRayTracker();
private Configuration config = AntiCheat.getManager().getConfiguration();
private CheckManager checkManager = AntiCheat.getManager().getCheckManager();
@EventHandler
public void onBlockBreak(BlockBreakEvent event) {
if (config.getConfig().checkXRay.getValue()) {
Player p = event.getPlayer();
if (p.getGameMode() == GameMode.CREATIVE && !config.getConfig().checkCreativeXRay.getValue()) {
return;
}
String player = p.getName();
if (checkManager.willCheck(p, CheckType.XRAY)) {
Material m = event.getBlock().getType();
if (m == Material.DIAMOND_ORE) {
tracker.addDiamond(player);
} else if (m == Material.IRON_ORE) {
tracker.addIron(player);
} else if (m == Material.GOLD_ORE) {
tracker.addGold(player);
} else if (m == Material.LAPIS_ORE) {
tracker.addLapis(player);
} else if (m == Material.REDSTONE_ORE || m == Material.GLOWING_REDSTONE_ORE) {
tracker.addRedstone(player);
} else if (m == Material.GOLD_ORE) {
tracker.addGold(player);
} else {
tracker.addBlock(player);
}
tracker.addTotal(player);
}
}
}
}
// NOTE (AI): The S21 corpus hit for this file is the XRay keyword family; the chunk data packet is what makes the ores visible to the cheater, and the check scores the resulting behavior.Parse the raw S21 chunk data bytes into Grim's compensated world so simulation checks see the exact blocks the client received.
BasePacketWorldReader dispatches the outbound chunk packets: handleMapChunk reads the chunk x/z, ground-up flag, section mask and size, decodes each 16-section column with the 1.8 endian-flipped palette reader, skips biome and light arrays, and merges the result into the compensated world cache with the transaction id. The 1.9+ and 1.18 readers are separate implementations; unloads are queued via removeChunkLater.
// ===== FILE: GrimAnticheat-Grim, common/src/main/java/ac/grim/grimac/events/packets/worldreader/PacketWorldReaderEight.java =====
package ac.grim.grimac.events.packets.worldreader;
import ac.grim.grimac.player.GrimPlayer;
import com.github.retrooper.packetevents.event.PacketSendEvent;
import com.github.retrooper.packetevents.protocol.world.chunk.impl.v1_16.Chunk_v1_9;
import com.github.retrooper.packetevents.protocol.world.chunk.palette.DataPalette;
import com.github.retrooper.packetevents.protocol.world.chunk.palette.ListPalette;
import com.github.retrooper.packetevents.protocol.world.chunk.palette.PaletteType;
import com.github.retrooper.packetevents.protocol.world.chunk.storage.BitStorage;
import com.github.retrooper.packetevents.wrapper.PacketWrapper;
import io.netty.buffer.ByteBuf;
import java.util.BitSet;
public class PacketWorldReaderEight extends BasePacketWorldReader {
@Override
public void handleMapChunkBulk(final GrimPlayer player, final PacketSendEvent event) {
PacketWrapper<?> wrapper = new PacketWrapper<>(event);
ByteBuf buffer = (ByteBuf) wrapper.getBuffer();
boolean skylight = wrapper.readBoolean();
int columns = wrapper.readVarInt();
int[] x = new int[columns];
int[] z = new int[columns];
int[] mask = new int[columns];
for (int column = 0; column < columns; column++) {
x[column] = wrapper.readInt();
z[column] = wrapper.readInt();
mask[column] = wrapper.readUnsignedShort();
}
for (int column = 0; column < columns; column++) {
BitSet bitset = BitSet.valueOf(new long[]{mask[column]});
Chunk_v1_9[] chunkSections = new Chunk_v1_9[16];
readChunk(buffer, chunkSections, bitset);
// 256 is the biome data at the end of the array
// 2048 is blocklight
// 2048 is skylight, which is determined by the first boolean sent
int chunks = Integer.bitCount(mask[column]);
buffer.readerIndex(buffer.readerIndex() + 256 + (chunks * 2048) + (skylight ? (chunks * 2048) : 0));
addChunkToCache(event, player, chunkSections, true, x[column], z[column], null);
}
}
@Override
public void handleMapChunk(final GrimPlayer player, final PacketSendEvent event) {
PacketWrapper<?> wrapper = new PacketWrapper<>(event);
final int chunkX = wrapper.readInt();
final int chunkZ = wrapper.readInt();
boolean groundUp = wrapper.readBoolean();
BitSet mask = BitSet.valueOf(new long[]{(long) wrapper.readUnsignedShort()});
int size = wrapper.readVarInt(); // Ignore size
final Chunk_v1_9[] chunks = new Chunk_v1_9[16];
this.readChunk((ByteBuf) event.getByteBuf(), chunks, mask);
this.addChunkToCache(event, player, chunks, groundUp, chunkX, chunkZ, null);
event.setLastUsedWrapper(null); // Make sure this incomplete packet isn't sent
}
private void readChunk(final ByteBuf buf, final Chunk_v1_9[] chunks, final BitSet set) {
for (int ind = 0; ind < 16; ++ind) {
if (set.get(ind)) {
chunks[ind] = readChunk(buf);
}
}
}
public Chunk_v1_9 readChunk(final ByteBuf in) {
ListPalette palette = new ListPalette(4);
BitStorage storage = new BitStorage(4, 4096);
DataPalette dataPalette = new DataPalette(palette, storage, PaletteType.CHUNK);
palette.stateToId(0); // Make sure to init chunk as air
int lastNext = -1;
int lastID = -1;
int blockCount = 0;
for (int i = 0; i < 4096; ++i) {
int next = in.readShort();
if (next != 0) { // If not air, doesn't need any endian flip
blockCount++;
}
// 0111 0000 0000 0000
// First byte of block type, followed by data, followed by second and third byte of block data
//
// This is bedrock
//
// Due to endian weirdness, it must be turned into
// 0000 0000 01110 0000
if (next != lastNext) { // If same, then couldn't have changed palette size, optimization
lastNext = next;
next = (short) (((next & 0xFF00) >> 8) | (next << 8)); // Flip endian bytes, computations are cheap compared to memory access
dataPalette.set(i & 15, (i >> 8) & 15, (i >> 4) & 15, next); // Allow it to resize
lastID = dataPalette.storage.get(i); // Get stored ID
continue;
}
dataPalette.storage.set(i, lastID);
}
return new Chunk_v1_9(blockCount, dataPalette);
}
}
// NOTE (AI): This is the 1.8 protocol reader; the sibling PacketWorldReaderEighteen handles 1.18 chunk sections, and the dispatch lives in BasePacketWorldReader.Detect WorldDownloader mods and disable their chunk caching, entity saving and container saving over the wdl plugin-message channel.
Registers the wdl/init and wdl/control plugin-message channels. When a client announces itself on wdl|INIT, the module answers on wdl|CONTROL with two packets that disable future functionality, general saving, chunk caching, entity and tile-entity saving and container saving per config, then runs the standard sentinel detection. Chunk data (S21 and S26) is the mod's raw material, so the module closes the hole at the channel handshake.
// ===== FILE: Photon-GitHub-AntiCheatAddition, src/main/java/de/photon/anticheataddition/modules/sentinel/mods/WorldDownloaderSentinel.java =====
package de.photon.anticheataddition.modules.sentinel.mods;
import com.google.common.io.ByteStreams;
import de.photon.anticheataddition.AntiCheatAddition;
import de.photon.anticheataddition.modules.ModuleLoader;
import de.photon.anticheataddition.modules.sentinel.SentinelModule;
import de.photon.anticheataddition.util.pluginmessage.MessageChannel;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;
import org.jetbrains.annotations.NotNull;
public final class WorldDownloaderSentinel extends SentinelModule implements PluginMessageListener
{
public static final WorldDownloaderSentinel INSTANCE = new WorldDownloaderSentinel();
private static final MessageChannel WDL_CONTROL_CHANNEL = MessageChannel.of("wdl", "control", "WDL|CONTROL");
public static final MessageChannel WDL_INIT_CHANNEL = MessageChannel.of("wdl", "init", "WDL|INIT");
private final boolean disable = loadBoolean(".disable.general", true);
private final boolean disableFuture = loadBoolean(".disable.future", true);
private final int saveRadius = loadInt(".disable.save_radius", 0);
private final boolean disableChunkCaching = loadBoolean(".disable.chunk_caching", true);
private final boolean disableEntitySaving = loadBoolean(".disable.entity_saving", true);
private final boolean disableTileEntitySaving = loadBoolean(".disable.tile_entity_saving", true);
private final boolean disableContainerSaving = loadBoolean(".disable.container_saving", true);
private WorldDownloaderSentinel()
{
super("WorldDownloader");
}
@Override
public void onPluginMessageReceived(@NotNull final String channel, @NotNull final Player player, final byte[] message)
{
// This must not be empty as we defined our channel with both a full key and a legacy string.
final var sendChannel = WDL_CONTROL_CHANNEL.getChannel().orElseThrow();
/*Documentation:
* https://github.com/Pokechu22/WorldDownloader-Serverside-Companion/blob/master/src/main/java/wdl/WDLPackets.java
*
* and
*
* https://wiki.vg/User:Pokechu22/World_downloader
*
* The first packet specifies, whether new functions are allowed, the second what current functions are allowed.*/
final var packetZero = ByteStreams.newDataOutput();
packetZero.writeInt(0);
packetZero.writeBoolean(!disableFuture);
player.sendPluginMessage(AntiCheatAddition.getInstance(), sendChannel, packetZero.toByteArray());
final var packetOne = ByteStreams.newDataOutput();
packetOne.writeInt(1);
packetOne.writeBoolean(!disable);
packetOne.writeInt(saveRadius);
packetOne.writeBoolean(!disableChunkCaching);
packetOne.writeBoolean(!disableEntitySaving);
packetOne.writeBoolean(!disableTileEntitySaving);
packetOne.writeBoolean(!disableContainerSaving);
player.sendPluginMessage(AntiCheatAddition.getInstance(), sendChannel, packetOne.toByteArray());
detection(player);
}
@Override
protected ModuleLoader createModuleLoader()
{
return ModuleLoader.builder(this)
.addIncomingMessageChannel(WDL_INIT_CHANNEL)
.addOutgoingMessageChannel(WDL_CONTROL_CHANNEL)
.build();
}
}
// NOTE (AI): The S21 and S26 corpus hits are the disableChunkCaching flags and the isChunkLoaded helpers in WorldUtil; the module itself is channel-based, not packet-based.Related Packets
Wiki Cross-Reference
Clientbound 0x21: chunkX and chunkZ ints, groundUp bool, bitmask short, data byte array.
Each set bit adds one 16x16x16 section: 8192 block bytes plus 2048 blocklight and 2048 skylight.
Ground-up true appends 256 biome bytes; ground-up with bitmask 0 unloads the chunk.
MCP 1.8.9 S21PacketChunkData implements Packet
1.8.9 callers: EntityPlayerMP.? sends new S21PacketChunkData (line 340) +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 S21PacketChunkData
Full source walkthroughs of the modules and anti-cheats that use this packet.