Skip to content

Conversation

@okx-code
Copy link
Contributor

@okx-code okx-code commented Oct 1, 2025

On 1.20.2, the Minecraft client started clearing boss bars after the login packet, which meant that the ProxyServer#showBossbar API would result in the player getting kicked if the boss bar they were previously shown was updated after switching servers.

Therefore, I have added BossBarManager which drops boss bar packets once the client enters the configure phase to ensure that they do not disconnect (if the client receives boss bar packets during the configure phase it seems to queue them up and then immediately disconnect at the end of the configure phase, leaving no opportunity to re-send the boss bar creation packet), and then re-adds the boss bar once the client logs in.

This ensures that clients do not receive boss bar updates for boss bars that they don't exist causing them to disconnect. I have also taken care to ensure that this logic only applies on 1.20.2 and up, as it is not necessary for older clients.

In addition, I removed boss bar tracking for backend servers for 1.20.2 and up clients - as it is no longer necessary for them to be manually removed due to the aforementioned change.

Fixes #1529

@okx-code okx-code changed the title Fix 1.20.2+ clients disconnecting when updating boss bars Fix players disconnecting when updating boss bars Oct 1, 2025
On 1.20.2, the Minecraft client started clearing boss bars after the login packet, which meant that the ProxyServer#showBossbar API would result in the player getting kicked if the boss bar they were previously shown was updated after switching servers.

Therefore, I have added BossBarManager which drops boss bar packets once the client enters the configure phase to ensure that they do not disconnect, and then re-adds the boss bar once the client enters the login phase.

This ensures that clients do not receive boss bar updates for boss bars that they don't exist and causing them to disconnect. I have also taken care to ensure that this logic only applies on 1.20.2 and up, as it is not necessary for older clients.
@okx-code okx-code requested a review from R00tB33rMan October 3, 2025 05:19
Copy link
Contributor

@R00tB33rMan R00tB33rMan left a comment

Choose a reason for hiding this comment

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

Not sure if you intended to have me re-review but I gave this a whirl on a test and production instance without issues on versions even below 1.20.2/3. Should be all set as far as I’m concerned!

@4drian3d 4drian3d merged commit 4cd3b68 into PaperMC:dev/3.0.0 Oct 17, 2025
1 check passed
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.

"Network Protocol Error" disconnect when using BossBar API

3 participants