1.8.8 Team prefix and scoreboard colliding

Discussion in 'Spigot Plugin Development' started by M4tt_H4wk, Mar 24, 2020.

  1. So I am trying to create a scoreboard that implements custom player prefixs, health under their name and a sidebar. This is what I have:
    Code (Text):
    public class Test implements Listener {
        public void onJoin(PlayerJoinEvent e) {

        public void create(Player p) {
            //create scoreboard for every player who joins so everyone can have a different scoreboard
            ScoreboardManager manager = Bukkit.getScoreboardManager();
            Scoreboard board = manager.getNewScoreboard();
            //register teams
            Team red = board.registerNewTeam("Red");
            Team blue = board.registerNewTeam("blue");
            //Add prefixs to teams
            red.setPrefix(ChatColor.RED + "[Red] ");
            blue.setPrefix(ChatColor. BLUE + "[Blue] ");
            //get health to put above head
            Objective o = board.registerNewObjective("showhealth", "health");
            o.setDisplayName(ChatColor.RED + "❤");
            //Get which team to put player in to
            if(p.hasPermission("red")) {
            } else {
            if(p.hasPermission("blue")) {
            } else {
            //Add sidebar scoreboard
            Objective objective = board.registerNewObjective("Scoreboard", "dummy");
            objective.setDisplayName(ChatColor.AQUA + "test");
            //add stuff to scoreboard
            Score score = objective.getScore("kills");
            //add player to the scoreboard
    So when a player joins, a scoreboard is created which gives them a personal sidebar and health. However, in the tab playerlist, it only shows your own name. I understand this is due to having multiple scoreboards for different people however I need a way to implement both player prefixs and a sidebar in my plugin.

    I would appreciate any help :)