Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 13, 2025

This PR addresses breaking changes in the minecraft-data protocol schema that affect multiple packet types across all supported versions.

Issue Analysis

The protocol schema changes in minecraft-data introduced several breaking changes:

  1. player_info packet structure: Changed field names from UUID to uuid and introduced bitfield action format for 1.19.3+ versions
  2. Sound packets: Now use ItemSoundHolder structures instead of direct soundId references
  3. Action format: Updated to support both legacy string actions and modern bitfield boolean flags

Changes Made

player_info packets (login.js):

  • Removed version gates that disabled player_info for 1.19+ versions, restoring player list functionality
  • Field name fixes: Changed UUIDuuid (lowercase) for consistency with minecraft-data schema
  • Bitfield support: Added support for bitfield action format with boolean flags ({ add_player: true, update_game_mode: true })
  • Legacy support: Maintained string action format for older versions ("add_player", "update_game_mode")
  • Action naming: Fixed action naming to match protocol schema (e.g., "update_game_mode" vs "update_gamemode")

Sound packets (sound.js):

  • ItemSoundHolder structure: Updated to use proper Holder format based on minecraft-data protocol
  • ID-based sounds: { soundId: <number> } format for registry references
  • Named sounds: { data: { soundName: <string> } } format for sound events
  • Backward compatibility: Maintained named_sound_effect packet for versions before 1.19.3

Testing Results

The fixes have been verified across multiple Minecraft versions:

  • ✅ 1.8.8v - Legacy format working
  • ✅ 1.19.4v - Modern format working
  • ✅ 1.21.3v - Bitfield format working
  • ✅ 1.21.4v - Latest version working

Impact

This fix restores compatibility across all supported versions (1.8.8 through 1.21.4) by implementing the proper packet structures based on the mineflayer reference implementation (PrismarineJS/mineflayer#3689).

Addressing #690.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Handle changes made to minecraft-data for pc protocol schema Handle changes made to minecraft-data for pc protocol schema Sep 13, 2025
Copilot AI requested a review from extremeheat September 13, 2025 07:36
Copilot stopped work on behalf of extremeheat due to an error September 13, 2025 07:36
@extremeheat
Copy link
Member

@copilot sounds good, but please also check the mineflayer diff for reference, it implements much of the same changes we need here: https://patch-diff.githubusercontent.com/raw/PrismarineJS/mineflayer/pull/3689.diff

Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Sep 13, 2025

@copilot sounds good, but please also check the mineflayer diff for reference, it implements much of the same changes we need here: https://patch-diff.githubusercontent.com/raw/PrismarineJS/mineflayer...

I've reviewed the mineflayer diff and implemented the same changes needed in flying-squid. The key fixes include:

player_info packets: Changed UUID → uuid field names, added support for bitfield action format, and re-enabled player_info for 1.19+ versions.

Sound packets: Updated to use new Holder structure (sound.soundId vs direct soundId, sound.data.soundName vs soundEvent.resource).

The 1.21.3 test now passes successfully, confirming the protocol fixes are working. Commit b8d73e6 addresses the protocol schema changes.

Co-authored-by: extremeheat <13713600+extremeheat@users.noreply.github.com>
Copilot AI changed the title Handle changes made to minecraft-data for pc protocol schema Fix player_info and sound packets for minecraft-data protocol changes Sep 13, 2025
@extremeheat extremeheat marked this pull request as ready for review September 13, 2025 07:58
@extremeheat extremeheat linked an issue Sep 13, 2025 that may be closed by this pull request
@rom1504 rom1504 merged commit a4f5971 into master Sep 14, 2025
78 of 80 checks passed
action: 2,
data: serv.players.map(otherPlayer => ({
UUID: otherPlayer.uuid,
ping: otherPlayer._client.latency
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This previous branch should've been removed

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.

Handle changes made to minecraft-data for pc protocol schema

3 participants