Resource Scoreboards! (Intermediate)

Discussion in 'Plugin Help/Development/Requests' started by MattTek, Apr 2, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    MattTek

    Hello all! This is my first tutorial so... here it goes! Now on the forums you may see a bunch of scoreboard help. But some do not fulfill peoples requests, so this may only be helpful to some users. So here it is!
    If you need any help or have nay suggestions leave it in the comments below :cool:

    So first off you're going to want to create a function something like this:
    Code:
    public void updateScoreboard(Player p) {
    Now in this function we're going to create the scoreboard and set it to the player.
    Code:
    ScoreboardManager sbm = Bukkit.getScoreboardManager();
    Scoreboard sb = sbm.getNewScoreboard();
    Objective ob = sb.registerNewObjective("MyAwesomeScoreboard", "dummy");
    ob.setDisplayName("§7» §a" + Bukkit.getOnlinePlayers().size() + "§8/§a50 §7«");
    ob.setDisplaySlot(DisplaySlot.SIDEBAR);
    What we did there was created the main scoreboard, and named the header of the scoreboard something like: Scoreboardtitle.png


    Now, finally we're going to need to add a line under the header. This will make the scoreboard show up.

    Code:
    Score hi = hi.getScore(Bukkit.getOfflinePlayer("§aHello"));
            ol.setScore(1);
    Code:
    p.setScoreboard(sb);
    That's it! Expect updates in the future :D If you need help or any suggestions remember to leave them below :)



    This is working (1.7.x-1.8.x)
     
  2. Offline

    Mrgts

    Nice!
     
  3. Offline

    MattTek

    Thank you <3
     
    Mrgts likes this.
Thread Status:
Not open for further replies.

Share This Page