0x21 S21PacketChunkData
Sends a chunk section (16x16x16 blocks) with compressed block data, light values, and biome info.
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
MCP
NetHandlerPlayClient.handleChunkData()Handler Interface
HND
INetHandlerPlayClientNotes
Each section in the bitmask contains: 4096 block IDs (2 bytes each), 2048 block light (4 bits per block), 2048 sky light (4 bits per block). For groundUp=true: 256 biome bytes at end. Data is zlib-compressed. XRay modules intercept this to replace block IDs or prevent chunk updates.
implementation Implementation Cases
XRay
(Tenacity 6.0, Sigma 3.9)
XRay cancels chunk data and sends only desired blocks. Search tracks blocks in chunks. ChestESP reads chest positions.
if (event.getPacket() instanceof S21PacketChunkData) {
S21PacketChunkData s21 = (S21PacketChunkData) event.getPacket();
// XRay: modify block data
// Search: scan for target blocks
}Search
(Tenacity 6.0, Sigma 3.9)
XRay cancels chunk data and sends only desired blocks. Search tracks blocks in chunks. ChestESP reads chest positions.
if (event.getPacket() instanceof S21PacketChunkData) {
S21PacketChunkData s21 = (S21PacketChunkData) event.getPacket();
// XRay: modify block data
// Search: scan for target blocks
}ChestESP
(Tenacity 6.0, Sigma 3.9)
XRay cancels chunk data and sends only desired blocks. Search tracks blocks in chunks. ChestESP reads chest positions.
if (event.getPacket() instanceof S21PacketChunkData) {
S21PacketChunkData s21 = (S21PacketChunkData) event.getPacket();
// XRay: modify block data
// Search: scan for target blocks
}AntiChunkBan
(Tenacity 6.0, Sigma 3.9)
XRay cancels chunk data and sends only desired blocks. Search tracks blocks in chunks. ChestESP reads chest positions.
if (event.getPacket() instanceof S21PacketChunkData) {
S21PacketChunkData s21 = (S21PacketChunkData) event.getPacket();
// XRay: modify block data
// Search: scan for target blocks
}