Skip to content

Multi-Block Update

Packet IDDirectionMojang NameMCP Name
0x34ClientboundChunkTilesUpdatePacketPacket52MultiBlockChange

This is used to update multiple blocks in one go. If only a single block is being updated, consider using the Block Update packet.

The format for the coordinates is slightly obtuse but boils down to using one 16-bit Short to store the 4-bit X, 4-bit Z and 8-bit Y value of the block coordinate within the chunk.

Bit 15 - 12Bit 11 - 8Bit 7 - 0
XZY

Some example code to demonstrate how to convert to and from this format.

c
int16_t format_multi_block(int8_t x, int8_t y, int8_t z) {
    return (
        ((int16_t(x) & 0x0F) << 12) |
        ((int16_t(z) & 0x0F) << 8 ) |
        ((int16_t(y) & 0xFF)      )
    );
}
c
Int3 unformat_multi_block(int16_t value) {
    return {
        ((value >> 12) & 0x0F),
        ((value >> 8 ) & 0x0F),
        ((value      ) & 0xFF)
    }
}

Clientbound

FieldTypeDescription
XIntegerThe X position of the chunk
ZIntegerThe Z position of the chunk
Number of BlocksShortThe number of changed blocks
Block CoordinatesShort ArrayArray of Block coordinates in the format described above
BlocktypesByte ArrayArray of Block types those coordinates change to
MetadataByte ArrayArray of Block metadata those coordinates change to

Example Packet

FieldValue
X-9
Z12
Number of Blocks1
Block Coordinates0101 0111 01111111* (x: 5, z: 7, y: 127)
Blocktypes1 (Stone)
Metadata0

* Binary value is spaced out to be more readable.