Skip to content

bedrock: fix camera_instruction fade structure (time_data/color_rgb optional prefixes) 1.20.30+ - #1246

Open
AnonymoDGH wants to merge 1 commit into
PrismarineJS:masterfrom
AnonymoDGH:fix/mcd-1109
Open

bedrock: fix camera_instruction fade structure (time_data/color_rgb optional prefixes) 1.20.30+#1246
AnonymoDGH wants to merge 1 commit into
PrismarineJS:masterfrom
AnonymoDGH:fix/mcd-1109

Conversation

@AnonymoDGH

Copy link
Copy Markdown
Contributor

Fixes #1109

Root cause: In packet_camera_instruction, the fade instruction was defined without the optional prefixes that each of its fields has on the wire. Per pmmp/BedrockProtocol, CameraFadeInstruction is: Optional<CameraFadeTimeData> (bool + 3×f32) followed by Optional<CameraFadeInstructionColor> (bool + 3×f32 RGB).

minecraft-data had:

fade?:
   fade_in_duration: lf32
   wait_duration: lf32
   fade_out_duration: lf32
   color_rgb: vec3f

which misses the two per-field presence booleans, so any real-world packet using both time and color fails to parse (PartialReadError on all versions from 1.20.30).

Fix (all versions 1.20.30 → latest):

fade?:
   time_data?:
      fade_in_duration: lf32
      wait_duration: lf32
      fade_out_duration: lf32
   color_rgb?:
      red: lf32
      green: lf32
      blue: lf32

Verification: the reporter's 34-byte sample (rAIAAAEBAAAAPwAAwD8AAAA/AeHgYD3BwMA90dBQPgAAAA==, pid 300) previously failed with PartialReadError on every version; with this fix it decodes fully (34/34 bytes) via protodef:

{"name":"camera_instruction","params":{"fade":{"time_data":{"fade_in_duration":0.5,"wait_duration":1.5,"fade_out_duration":0.5},"color_rgb":{"red":0.05490196,"green":0.09411764,"blue":0.20392157}}}}

All affected protocol.json files regenerated via compileProtocol.js.

…rgb are optional with bool prefix (1.20.30+)
@extremeheat

extremeheat commented Aug 17, 2026

Copy link
Copy Markdown
Member

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failed to parse camera instruction packet in 1.21.111

2 participants