bedrock: fix voxel_shapes deserialization - VoxelShape.cells is a single VoxelCells, not an array - #1233
Merged
extremeheat merged 1 commit intoAug 16, 2026
Conversation
The voxel_shapes packet (0x151) on bedrock 1.26.0-1.26.30 defines VoxelShape.cells as an array of VoxelCells, but the real packet contains a single VoxelCells record. This caused a PartialReadError when deserializing the packet (bedrock-protocol#753). Verified against the two raw packet captures from that issue: the fixed schema decodes all 7173 bytes, all 1062 voxel coordinates fall in [0,1], and re-serialization is byte-identical. 1.26.40/latest already used the correct single-VoxelCells form.
Contributor
Author
|
Note on the failing The |
extremeheat
approved these changes
Aug 16, 2026
Contributor
Author
|
Thanks for reviewing and re-running the CI, @extremeheat — glad it's confirmed to be the reverted-PR issue and not this change. Appreciate it! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a deserialization failure for the bedrock
voxel_shapespacket (0x151 / 337) on versions 1.26.0 through 1.26.30.Fixes PrismarineJS/bedrock-protocol#753
The bug
On bedrock 1.26.30.5, connecting to a server crashes with:
The
VoxelShapetype definedcellsas an array ofVoxelCells:but the actual packet contains a single
VoxelCellsrecord. This is confirmed by the 1.26.40 /latestschema, which correctly uses a singleVoxelCells:Verification
I decoded the two raw packet captures attached to bedrock-protocol#753 (7173 bytes each) using
protodefagainst both schemas:Before (array):
PartialReadError— the exact error from the issue.After (single):
All 1062 voxel coordinates fall in the valid [0,1] range, the 59 name-map entries are valid block identifiers, and re-serializing the decoded value reproduces the original packet byte-for-byte.
Changes
Changed
cells: VoxelCells[]varint→cells: VoxelCellsin theVoxelShapetype oftypes.ymlfor the four affected versions, and regenerated eachprotocol.jsonwithnode compileProtocol.js bedrock <version>:data/bedrock/1.26.0data/bedrock/1.26.10data/bedrock/1.26.20data/bedrock/1.26.301.26.40 (generated from
bedrock/latest) already had the correct single-VoxelCellsdefinition and is unchanged. TheprotocolSynctest passes for all versions.