Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Network Protocol Error" disconnect when using BossBar API #1529

Open
NEZNAMY opened this issue Mar 16, 2025 · 0 comments
Open

"Network Protocol Error" disconnect when using BossBar API #1529

NEZNAMY opened this issue Mar 16, 2025 · 0 comments
Labels
type: bug Something isn't working

Comments

@NEZNAMY
Copy link

NEZNAMY commented Mar 16, 2025

Expected Behavior

Since 1.20.2's configuration phase, server switching clears boss bars. This change should be reflected in the bossbar tracker in some way (ideally resending the bossbars on server switch).

Actual Behavior

Bossbar tracker does not reflect on these changes, thinking the client still can see bossbar(s) while it can not. As a result, using any kind of update action results in a null pointer in the client, disconnecting with Network Protocol Error since 1.20.5.

Steps to Reproduce

Run the following code and switch servers using /server command.

    private BossBar bossBar;

    @Subscribe
    public void a(ServerPostConnectEvent e) {
        if (e.getPreviousServer() == null) {
            bossBar = BossBar.bossBar(
                    Component.text("Server: " + e.getPlayer().getCurrentServer().get().getServer().getServerInfo().getName()),
                    1,
                    BossBar.Color.BLUE,
                    BossBar.Overlay.PROGRESS
            );
            bossBar.addViewer(e.getPlayer());
        } else {
            bossBar.name(Component.text("Server: " + e.getPlayer().getCurrentServer().get().getServer().getServerInfo().getName()));
        }
    }

Plugin List

Custom plugin for reproducing this issue.

Velocity Version

> velocity info
[08:32:57 INFO]: Velocity 3.4.0-SNAPSHOT (git-d9f1016b-b481)

Additional Information

There are basically 2 ways to solve this:

  • Resend bossbars on server switch
  • Remove player from tracked players

I would prefer the first solution. It will also be consistent with <1.20.2. If deciding for this solution, make sure it's resent at the right time, so there isn't a window during which a packet could slip through before bossbar is resent (just a tip).

@NEZNAMY NEZNAMY added the type: bug Something isn't working label Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant