Block Event
Play 0x07, server → client.
play · 0x07 · clientbound (server → client)
Triggers a block-specific action at location, such as a note block playing, a piston extending or retracting, a chest lid opening, or a bell ringing. byte1 and byte2 are the action id and parameter; blockId identifies the block type. The client plays the matching animation or sound.
Sent by the server, read by the client. Listen for it with client.on("BlockEvent", (data) => …) on the receiving side.
Fields
| Field | Type | Notes |
|---|---|---|
location |
Position | also position |
byte1 |
UByte | |
byte2 |
UByte | |
blockId |
VarInt |
Send it
await client.sendPacket("BlockEvent", {
location: /* Position */,
byte1: /* UByte */,
byte2: /* UByte */,
blockId: /* VarInt */,
});
Field aliases listed under Notes are accepted as alternative keys when writing.
Source: src/Core/Versions/776/Packets/play/clientbound/BlockEvent.ts