Solved Multiple scoreboard's registering one team

Discussion in 'Plugin Development' started by Zombieghost_391, Nov 13, 2014.

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

    Zombieghost_391

    I'm try to make a new scoreboard register a scoreboard every time a player gets so scoreboard.
    Any help would be nice and appreciated
    Code:java
    1. public static HashMap<Player, Objective> getScoreboardList() {
    2. return scoreboardList;
    3. }
    4.  
    5. static HashMap<Player, Objective> scoreboardList = new HashMap<Player, Objective>();
    6. public static Team team;
    7.  
    8. public static void test(){
    9. for (Player player : Bukkit.getOnlinePlayers()){
    10. Scoreboard scoreboards = getScoreboardList().get(player).getScoreboard();
    11. if (!scoreboards.getTeams().contains(team)) {
    12. scoreboards.registerNewTeam("team");
    13. team.setPrefix("Test ");
    14. }
    15. }
    16. }
    17.  
    18. public static void setManager(Player player) {
    19. ScoreboardManager manager = Bukkit.getScoreboardManager();
    20. Scoreboard board = manager.getNewScoreboard();
    21.  
    22. Objective objective = board.registerNewObjective("this", "that");
    23. objective.setDisplayName("§2§lZGMC");
    24. objective.setDisplaySlot(DisplaySlot.SIDEBAR);
    25.  
    26. {
    27. Score score = objective.getScore("§6§lCredits§8:");
    28. score.setScore(CreditAPI.getCredits(player));
    29. }
    30.  
    31. scoreboardList.put(player, objective);
    32. test();
    33. team.addPlayer(player);
    34. player.setScoreboard(board);
    35. }
     
  2. Offline

    mrkirby153

    Zombieghost_391

    Can you please explain in a bit more detail what you are trying to accomplish?
     
  3. Offline

    Zombieghost_391

    I'm trying to use the team prefix to give color to players names but how I have everything set to show the players stats like credits I must make a new scoreboard every time a player joins. I'm trying to add the new scoreboard to a arraylist and set the teams to the arraylist's objects that has not yet registered the team

    Never mind I'm now using NameTagAPI

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 13, 2016
Thread Status:
Not open for further replies.

Share This Page