[1.8-1.7] Scoreboard

Discussion in 'Spigot Plugin Development' started by iTweakz, May 31, 2017.

Thread Status:
Not open for further replies.
  1. So I tried to make scoreboard but it did not show fully for 1.7 players. Could someone show how to make it for 1.8 and 1.7 :)
     
  2. What's your code so far?
     
  3. I got this error with it, because I have almost scoreboard 10 lines o_O


    Errror.png
     
  4. I think you are using more than the limit of characters on a single line.
     
  5. A string can be a maximum of 16 characters. You are having 20.
     
  6. How I can use example "Bukkit.getOnlinePlayers().size());" on a string ?
     
  7. use toString() or String.valueOf(Bukkit.getOnlinePlayers().size());
     
  8. Could you show example for this because I did not get it work
    Code (Text):
    Team l9 = board.registerNewTeam("l9");
     
    sidebar.getScore("Online: ").setScore(9);
    l9.setPrefix("Online: ");
    l9.setSuffix(" " + Bukkit.getOnlinePlayers().size());
     
  9. You did not even do what I said....
     
  10. That is original code without it what you said...
     
  11. What is the problem?? You are having a line with more than 16 characters... We can't really help without full code...
     
  12. Could you show example how to use it on this, piggysaw's code
    Code (Text):
        private void createScoreboard(Player p) {
            Scoreboard board = Bukkit.getScoreboardManager().getNewScoreboard();
            Objective sidebar = board.registerNewObjective("sidebar", "dummy");
            sidebar.setDisplaySlot(DisplaySlot.SIDEBAR);
            String title = color("&6&lPotPvP &r| Practice");
            sidebar.setDisplayName(title);
            String prefix;
            String sufix;
       
            prefix = color("Online: ");
            sufix = color(" ") + Bukkit.getOnlinePlayers().size());
            Team l4 = board.registerNewTeam("l4");
            l4.addEntry(prefix);
            l4.setSuffix(sufix);
            sidebar.getScore(prefix).setScore(4);
       
     
            p.setScoreboard(board);

        }
     
  13. Please post your full UP TO DATE code and the UP TO DATE error.
     
  14. No buddy, no...
     
    • Optimistic Optimistic x 1
Thread Status:
Not open for further replies.