rank under nametag

Discussion in 'Spigot Plugin Development' started by William029, May 29, 2017.

  1. So far I have
    Code (Text):
    @EventHandler
        public void onEvent(PlayerJoinEvent e) {
            Player player = e.getPlayer();
           
            String playersprefix = MainClass.getChat().getPlayerPrefix(player);
            ScoreboardManager manager = Bukkit.getScoreboardManager();
            Scoreboard board = manager.getNewScoreboard();
            Team team = board.registerNewTeam(player.getName().toString());
            Objective objective = board.registerNewObjective("test", "dummy");
            team.setPrefix(playersprefix);
            team.addPlayer(e.getPlayer());
            objective.setDisplaySlot(DisplaySlot.BELOW_NAME);
           
           

        }
    but its not working any reason why?
     
  2. You have to set the player's scoreboard to that scoreboard.
     
  3. team.addPlayer(e.getPlayer());
     
  4. I am on my phone right now but I believe it is e.getPlayer().setScoreboard(board);
     
  5. im trying to set there team
     
  6. go
    got it working but i want to set there prefix under but it has color codes and just shows &6 and stuff u know how to fix?
     
  7. Not sure what you mean. Can you provide a screenshot?
     
  8. Perhaps? Chatcolor? or Color?, not sure how it used in scoreboard not used once.
     
  9. im getting it from vault group manager
     
  10. is it possible to have someones prefix floating over there head without score board?
     
  11. some people said ChatColor is supported anyhow, how about you use ChatColor#translateAlternateColorCode.
     
  12. yea i got it thanks