1.15.2 -

Discussion in 'Spigot Plugin Development' started by GGGEDRSRO, Jan 22, 2020.

  1. *-
     
    #1 GGGEDRSRO, Jan 22, 2020
    Last edited: Jul 20, 2021 at 12:12 PM
  2. You can get a new scoreboard by calling ScoreboardManager#getNewScoreboard.
     
  3. First start out with creating the sidebar:
    Code (Java):
    scoreboard = plugin.getServer().getScoreboardManager().getNewScoreboard();
    Then you create a scoreboard objective:
    Code (Java):
    objective = scoreboard.registerNewObjective("SidebarName", "dummy");
    the "dummy" is important here!

    And then you decide where you want to put the scoreboard:
    Code (Java):
    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    You can give your sidebar a title using:
    Code (Java):
    objective.setDisplayName("Your title");
    Let me know if you run into any trouble
     
    • Informative Informative x 1