Solved Scoreboard Teams

Discussion in 'Spigot Plugin Development' started by plarsootje, Nov 14, 2017.

  1. Hello,

    Im working on a plugin but i have some trouble with my scoreboards.

    I creating a scoreboard for all players that are in a custom game. The problem is i only see the player himself on the scoreboard not the others that are already in the game,

    If you need more information please ask

    Here some of the code:
    Code (Text):

        public static void CreateScoreBoard(Player player) {
            ScoreboardManager manager = Bukkit.getScoreboardManager();
            Scoreboard board = manager.getNewScoreboard();
         
            Objective objective = board.registerNewObjective("game", "dummy");
            objective.setDisplaySlot(DisplaySlot.SIDEBAR);
            objective.setDisplayName("§0[§bGame§0]");
         
            Team team = board.registerNewTeam(player.getName());
            team.setPrefix(IS_ALIVE_SYMBOL);
            team.addPlayer(player);
            list.add(player.getName());
         
            Score score = objective.getScore(player.getName());
            score.setScore(0);
         
            scoreboard.put(player.getName(), board);
        }
     
        public static void loadOnJoin(SArena arena) {
            for(String p : GameMain.GameMain.pdata.getArenaPlayers(arena)) {
                Player player = Bukkit.getPlayerExact(p);
                CreateScoreBoard(player);
                Scoreboard sb = scoreboard.get(player.getName());
                player.setScoreboard(sb);
        }
     
     
  2. Nevermind figured it out myself.
     

Share This Page