2 Scoreboards?

Discussion in 'Spigot Plugin Development' started by JackboyPlay, Feb 5, 2017.

Thread Status:
Not open for further replies.
  1. Hello folks, how is it possible to do it that I can 2 scoreboards at the same time? (One in the Tablist and one on the site)
     
  2. @JackboyPlay This can be accomplished through the use of two different objectives on the same scoreboard, but with different DisplaySlots.
    I'm drafting an amazing graphic up for you now
    Untitled.png
     
    • Winner Winner x 2
    • Like Like x 1
  3. Did you want to be my new designer?
     
  4. I'm dead [​IMG]
    But you understand yeah?
     
  5. No :/ have you an example ? :)
     
    #5 LucGamesHD, Feb 5, 2017
    Last edited: Feb 5, 2017
  6. Yeah xD I've understanded it
     

  7. I have this Code :
    Code (Text):
        private void registerScoreboard(){
            ScoreboardManager manager = Bukkit.getScoreboardManager();
            Scoreboard board = manager.getNewScoreboard();
            Objective objective = board.registerNewObjective("ccc", "ddd");
           
            b = objective.getScoreboard();
           
            b.registerNewTeam("00000Admin");
            b.registerNewTeam("00001SrMod");
            b.registerNewTeam("00002Mod");
            b.registerNewTeam("00003Sup");
            b.registerNewTeam("00004Dev");
            b.registerNewTeam("00005Builder");
            b.registerNewTeam("00006YouTuber");
            b.registerNewTeam("00007Premium");
            b.registerNewTeam("00008Spieler");
           
            b.getTeam("00000Admin").setPrefix("§4Admin §7| §4");
            b.getTeam("00001SrMod").setPrefix("§cSrMod §7| §c");
            b.getTeam("00002Mod").setPrefix("§cMod §7| §c");
            b.getTeam("00003Sup").setPrefix("§9Sup §7| §9");
            b.getTeam("00004Dev").setPrefix("§bDev §7| §b");
            b.getTeam("00005Builder").setPrefix("§eBuilder §7| §e");
            b.getTeam("00006YouTuber").setPrefix("§5");
            b.getTeam("00007Premium").setPrefix("§6");
            b.getTeam("00008Spieler").setPrefix("§a");
           
        }
       
    and this code :

    Code (Text):
            ScoreboardManager manager = Bukkit.getScoreboardManager();
            Scoreboard board = manager.getNewScoreboard();
            Objective objective = board.registerNewObjective("aaa", "bbb");
           
            objective.setDisplaySlot(DisplaySlot.SIDEBAR);
            objective.setDisplayName(serverName);
           
            Score Score12 = objective.getScore("§b§r ");
            Score12.setScore(12);
           
            Score Score11 = objective.getScore(level);
            Score11.setScore(11);
           
            Score Score10 = objective.getScore("§6" + String.valueOf(Level.getLevel(p)));
            Score10.setScore(10);
           
            Score Score9 = objective.getScore("§c§r ");
            Score9.setScore(9);
           
            Score Score8 = objective.getScore(kills);
            Score8.setScore(8);
           
            Score Score7 = objective.getScore("§e" + String.valueOf(Stats.getKills(p)));
            Score7.setScore(7);
           
            Score Score6 = objective.getScore("§a§r");
            Score6.setScore(6);
           
            Score Score5 = objective.getScore(map);
            Score5.setScore(5);
           
            Score Score4 = objective.getScore("§d" + Config.cfg.getString("MapName").replace("&", "§"));
            Score4.setScore(4);
           
            Score Score3 = objective.getScore(" ");
            Score3.setScore(3);
           
            Score Score2 = objective.getScore(levelRecord);
            Score2.setScore(2);
           
            Score Score1 = objective.getScore("§c" + String.valueOf(Stats.getLevelRecord(p)));
            Score1.setScore(1);
           
            p.setScoreboard(board);
    but its not working :/ sry my english
     
  8. @Drkmaster83 can you correct his code?
     
  9. @LucGamesHD
    Try this. Not exactly sure what your implementations are, kinda having to assume a lot, can't guarantee a fix without having "b", "p". Also, "not working" isn't specific. Any errors in the console, what specifically stops working? How does it stop working?
    Code (Text):
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard board = manager.getNewScoreboard();
    Objective objective = board.registerNewObjective("ccc", "dummy");
       
    b = objective.getScoreboard();
       
    b.registerNewTeam("00000Admin");
    b.registerNewTeam("00001SrMod");
    b.registerNewTeam("00002Mod");
    b.registerNewTeam("00003Sup");
    b.registerNewTeam("00004Dev");
    b.registerNewTeam("00005Builder");
    b.registerNewTeam("00006YouTuber");
    b.registerNewTeam("00007Premium");
    b.registerNewTeam("00008Spieler");
       
    b.getTeam("00000Admin").setPrefix("§4Admin §7| §4");
    b.getTeam("00001SrMod").setPrefix("§cSrMod §7| §c");
    b.getTeam("00002Mod").setPrefix("§cMod §7| §c");
    b.getTeam("00003Sup").setPrefix("§9Sup §7| §9");
    b.getTeam("00004Dev").setPrefix("§bDev §7| §b");
    b.getTeam("00005Builder").setPrefix("§eBuilder §7| §e");
    b.getTeam("00006YouTuber").setPrefix("§5");
    b.getTeam("00007Premium").setPrefix("§6");
    b.getTeam("00008Spieler").setPrefix("§a");
    Code (Text):
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    if(p.getScoreboard().equals(manager.getMainScoreboard())) p.setScoreboard(manager.getNewScoreboard());
    Scoreboard board = p.getScoreboard();
    Objective objective = board.registerNewObjective("aaa", "dummy");

    objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    objective.setDisplayName(serverName);
    Score Score12 = objective.getScore("§b§r ");
    Score12.setScore(12);
    Score Score11 = objective.getScore(level);
    Score11.setScore(11);
    Score Score10 = objective.getScore("§6" + String.valueOf(Level.getLevel(p)));
    Score10.setScore(10);
    Score Score9 = objective.getScore("§c§r ");
    Score9.setScore(9);
    Score Score8 = objective.getScore(kills);
    Score8.setScore(8);
    Score Score7 = objective.getScore("§e" + String.valueOf(Stats.getKills(p)));
    Score7.setScore(7);
    Score Score6 = objective.getScore("§a§r");
    Score6.setScore(6);
    Score Score5 = objective.getScore(map);
    Score5.setScore(5);
    Score Score4 = objective.getScore("§d" + Config.cfg.getString("MapName").replace("&", "§"));
    Score4.setScore(4);
    Score Score3 = objective.getScore(" ");
    Score3.setScore(3);
    Score Score2 = objective.getScore(levelRecord);
    Score2.setScore(2);
    Score Score1 = objective.getScore("§c" + String.valueOf(Stats.getLevelRecord(p)));
    Score1.setScore(1);
    p.setScoreboard(board);
     
  10. Use packets to make the tablist
     
  11. And wich packets ? Have you an code ?
     
  12. I suggest you go learn to code it instead of asking to have it done for you. It's completely pointless to make your own plugin if someone else is just going to give you all the code.
     
  13. This here is a help forum! -.-
     
  14. I suggest you looking up tutorials on bukkit and spigotmc, just search "packets tutorial development" or something like that.
     
  15. Maybe you are blind but he have 3 resources...
     
  16. Yes, help. Not giving code. You are asking for code.

    Yeah I must be so blind dude!!111 That's how I'm viewing this forum!!! I don't give a shit what he has for resources so I didn't check his resources. Not sure what your relevance is and why you even bothered responding to me but he is asking for people to give him code on your thread and I just suggested he learn to do it himself, people giving you code and you copy and pasting doesn't help you learn at all. It's about trial and error.
     
    • Agree Agree x 1
Thread Status:
Not open for further replies.