Solved Scoreboard skips score at the very top

Discussion in 'Spigot Plugin Development' started by KonTux, Feb 6, 2020.

  1. Hi there,
    so I was just designing some scoreboards and noticed that whenever the score at the very top is something that is not actual text, it will just be ignored. I am trying to create straight lines with the following String
    "&m--------". That works but it doesn't show if it is the last score (so the one below the title).

    That the code:
    Code (Java):
    Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
            Objective objective = board.registerNewObjective("abcd", "abcd");

            objective.setDisplayName(prefix.getHighlightColour() + "§lPRACTICE");

            objective.getScore("Your ping: " + prefix.getHighlightColour() + new PlayerInfo().getPing(player)).setScore(6);
            objective.getScore("Online " + prefix.getHighlightColour() + Bukkit.getOnlinePlayers().size()).setScore(5);
            objective.getScore("Playing: " + prefix.getHighlightColour() + MatchRegistry.getInstance().getPlayersInMatch()).setScore(4);
            objective.getScore(" ").setScore(3);
            objective.getScore(prefix.getHighlightColour() + "").setScore(2);
    And that's the result:
    (see the image)

    It should be possible somehow because a lot of servers do that as well.
    If I set the 7th score to some actual text, it works. But making it a blank line doesn't and inserting a line there doesn't either.

    Am I doing anything wrong or is it an issue with Bukkit?
    Thanks in advance: )

    I've been playing around with this and it seems like the last score(so at the very top) needs to be actual text so any empty lines below show up. Somehow servers still manage to have the first line blank.

    Attached Files:

    #1 KonTux, Feb 6, 2020
    Last edited: Feb 7, 2020
  2. Hey,
    if two scores have the exact same string, one of them will not be displayed. You can simply add a color code at the end of the string for one score like "§f§m---------------§6" and it will work.
    I hope this will help you! :)
    • Useful Useful x 1
  3. Thank you so much :))
    That's helpful!
    Thanks :)))
    • Like Like x 1