1.16.5 Send PlayServerScoreboardTeam packet with HEX in suffix/prefix

Discussion in 'Spigot Plugin Development' started by shoker137, Jul 1, 2021.

  1. Hey. I'm using hex in teams prefix/suffix for my scoreboard, so using Bukkit methotds to update it works fine with HEX ChatColor, but not using packets.

    I send Team packet like this:

    Code (Java):
            WrapperPlayServerScoreboardTeam wrapper = new WrapperPlayServerScoreboardTeam();
            wrapper.setMode(WrapperPlayServerScoreboardTeam.Mode.TEAM_UPDATED);
            wrapper.setName(team);
            wrapper.setPrefix(WrappedChatComponent.fromText(prefix));
            wrapper.setSuffix(WrappedChatComponent.fromText(suffix));
            wrapper.sendPacket(p);
    How can I improve it to accept HEX ChatColor in prefix/suffix?