Skip to content

Conversation

@micahstubbs
Copy link

Summary

The original protocol.json was generated from an earlier version and was missing
4 new debug packets added in 1.21.10 (protocol 773):

  • 0x1A: debug_block_value
  • 0x1B: debug_chunk_value
  • 0x1C: debug_entity_value
  • 0x1D: debug_event

This caused all packet IDs from 0x1A onwards to be shifted by +4, resulting in
wrong parsers being applied to packets.

Changes

  • Updated packet ID mappings to match wiki (138 packets, 0x00-0x89)
  • Added placeholder structures (restBuffer) for 4 new debug packets

Testing

Tested connection to a 1.21.10 server - bot now successfully connects through login → configuration → play state.

Reference

https://minecraft.wiki/w/Java_Edition_protocol/Packets (protocol 773)

The original protocol.json was generated from an earlier version and was missing
4 new debug packets added in 1.21.10 (protocol 773):
- 0x1A: debug_block_value
- 0x1B: debug_chunk_value
- 0x1C: debug_entity_value
- 0x1D: debug_event

This caused all packet IDs from 0x1A onwards to be shifted by 4, resulting in
wrong parsers being applied to packets.

Changes:
- Updated packet ID mappings to match wiki (138 packets, 0x00-0x89)
- Added placeholder structures (restBuffer) for 4 new debug packets

Reference: https://minecraft.wiki/w/Java_Edition_protocol/Packets
@rom1504
Copy link
Member

rom1504 commented Dec 7, 2025 via email

micahstubbs added a commit to micahstubbs/minecraft-data that referenced this pull request Dec 7, 2025
Building on PR PrismarineJS#1118's packet ID mapping fixes, this commit addresses
additional packet structure issues discovered during testing:

1. spawn_entity: Remove velocity fields (velocityX/Y/Z)
   - Server packets are ~5 bytes shorter than expected
   - Velocity fields appear to be removed or sent differently in 1.21.10
   - Use restBuffer to handle any remaining data gracefully

2. entity_velocity: Same treatment for consistency
   - The i16 velocity fields cause parse errors
   - Replace with restBuffer to avoid PartialReadError

These fixes were discovered while debugging mineflayer/mindcraft bot
connectivity to a 1.21.10 server. Raw packet captures confirmed the
shorter packet sizes.

References:
- PR PrismarineJS#1118: Packet ID mapping fixes
- Tested with actual 1.21.10 server (protocol 773)
@micahstubbs micahstubbs closed this Dec 7, 2025
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.

2 participants