Scoreboard (Not API)

Mar 14, 2020
Scoreboard (Not API)
  • BungeeCord Scoreboard (Not API)

    How to use BungeeCord to create a scoreboard

    @md_5 & @Thinkofdeath created the Bungeecord Scoreboard API (net.md_5.bungee.api.score.*) a long time ago. But it isn't ready to use yet. Nevertheless, they already made the packets. So we can use them to create scoreboards! In the following code examples, p stands for some ProxiedPlayer.

    How do scoreboards work?(top)

    Very important for creating a scoreboard via Bungeecord is to understand how scoreboards work. The best way to figure that out is by taking a look at the scoreboard objective packet on the Protocol page on

    Creating an objective(top)

    So now we know how scoreboards work. First we have to create an objective.
    Code (Java):
    ScoreboardObjective objective = new ScoreboardObjective("test", "Test", "integer", (byte) 0);
    "test" is a unique name for the scoreboard
    "Test" is the name which should be displayed
    "integer" this could be replaced to "hearts" - more info
    0 - 0 to create the scoreboard. 1 to remove the scoreboard. 2 to update the display text.

    Creating and removing a score(top)

    Code (Java):
    ScoreboardScore score = new ScoreboardScore("Hallo", (byte) 0, "test", 0);
    "Hallo" is the name of the score to be updated or removed
    0 - 0 to create/update an item. 1 to remove an item.
    "test" is the name of the objective the score belongs to
    0 - The score to be displayed next to the entry.

    Displaying the scoreboard(top)

    Now the client knows all about the scoreboard, but we have to tell the client to display the scoreboard.
    Code (Java):
    ScoreboardDisplay display = new ScoreboardDisplay((byte) 1, "test");
    1 - The position of the scoreboard. 0: list, 1: sidebar, 2: below name.
    "test" - The unique name for the scoreboard to be displayed.

    And that's it. It is obviously very simple. And if you did everything right it should look like this:


    The Client will only accept these packets if they are ingame. That means that if you want to send a scoreboard to some player when they join, you can at the earliest send it to them during the ServerSwitchEvent (which also gets send the first time you join a server). All earlier events (like PostLogin or ServerConnected) are posted before the Client is ready.
  • Loading...
  • Loading...