Skip to content
mc-protocol
Esc
↑↓navigate↵open⌘Jpreview
On this page

Level Chunk With Light

Play 0x2D, server → client.

play · 0x2D · clientbound (server → client)

Sends the block data, heightmaps, block entities, and light data for one chunk column at chunkX, chunkZ. The server sends it for every chunk in the player’s view distance, usually inside a chunk batch. The client loads or replaces the chunk and renders it.

Sent by the server, read by the client. Listen for it with client.on("LevelChunkWithLight", (data) => …) on the receiving side.

Fields

Field Type Notes
chunkX Number
chunkZ Number
chunkData Byte[]
blockEntities Struct[] Optional. Shape: Array<{ x: number; z: number; y: number; type: number; nbtData: unknown }>.
heightmaps Struct[] Optional. Shape: Array<{ type: number; data: Array<bigint | number | string> }>.
skyLightMask Long[] Optional. Shape: Array<bigint | number | string>.
blockLightMask Long[] Optional. Shape: Array<bigint | number | string>.
emptySkyLightMask Long[] Optional. Shape: Array<bigint | number | string>.
emptyBlockLightMask Long[] Optional. Shape: Array<bigint | number | string>.
skyLight Byte[][] Optional.
blockLight Byte[][] Optional.

Send it

await client.sendPacket("LevelChunkWithLight", {
  chunkX: /* Number */,
  chunkZ: /* Number */,
  chunkData: /* Byte[] */,
  blockEntities: /* Struct[] */,
  heightmaps: /* Struct[] */,
  skyLightMask: /* Long[] */,
  blockLightMask: /* Long[] */,
  emptySkyLightMask: /* Long[] */,
  emptyBlockLightMask: /* Long[] */,
  skyLight: /* Byte[][] */,
  blockLight: /* Byte[][] */,
});

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: src/Core/Versions/776/Packets/play/clientbound/LevelChunkWithLight.ts

Was this page helpful?