Skip to content

Conversation

@HenkjanvDiermen
Copy link

@HenkjanvDiermen HenkjanvDiermen commented Dec 15, 2025

Summary

Adds support for Minecraft 1.21.9 (protocol version 773) to node-minecraft-protocol.

Changes

  • Fixed chat packet handling crash in 1.21+ where senderName can be null when networkName is an empty NBT tag
  • Added null checks in test/clientTest.js for the player_chat packet
  • Updated minecraft-data dependency from ^3.78.0 to ^3.101.0

Problem Solved

In Minecraft 1.21+, the networkName field in player_chat packets can be an empty NBT tag ({type: "end"}). When this happens, processMessage(networkName) returns null, causing tests to crash when trying to access properties on the null value.

Testing

✅ All 6262 tests passing
✅ Chat test specifically fixed for 1.21.9

Dependencies

This PR includes changes to node-minecraft-protocol. Corresponding changes are needed in PrismarineJS/minecraft-data:

  • Make name, prefix, suffix fields optional in packet_teams protocol definition
  • Add loginPacket.json for 1.21.9
  • Register 1.21.9 in data.js

Related

Part of the 1.21.9 support effort for the PrismarineJS ecosystem.

- Add null checks for senderName field in player_chat packets
- Handle empty NBT tags (type: end) in 1.21+ where networkName can be null
- Fixes crash when accessing properties on null senderName
@HenkjanvDiermen HenkjanvDiermen changed the title Fix chat packet handling for 1.21+ versions Add support for Minecraft 1.21.9 Dec 15, 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.

1 participant