Development Assistance Tablist Issues

Discussion in 'Plugin Help/Development/Requests' started by Darkpicasa, Dec 2, 2014.

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


    So I heard that in the Spigot 1.7 - 1.8 crossjar, the tablist code is edited.
    How can I edit the tablist with this version of Spigot?
  2. I know there are a few of them over at the spigot forums, you should ask there due to your running an alternative to bukkit, I had a simple google search and found three, should be pretty simile for you.

        public static void sendTabTitle(Player player, String header, String footer) {
            if (header == null) header = "";
            header = ChatColor.translateAlternateColorCodes('&', header);
            if (footer == null) footer = "";
            footer = ChatColor.translateAlternateColorCodes('&', footer);
            header = header.replaceAll("%player%", player.getDisplayName());
            footer = footer.replaceAll("%player%", player.getDisplayName());
            PlayerConnection connection = ((CraftPlayer) player).getHandle().playerConnection;
            IChatBaseComponent tabTitle = ChatSerializer.a("{\"text\": \"" + header + "\"}");
            IChatBaseComponent tabFoot = ChatSerializer.a("{\"text\": \"" + footer + "\"}");
            PacketPlayOutPlayerListHeaderFooter headerPacket = new PacketPlayOutPlayerListHeaderFooter(tabTitle);
            try {
                Field field = headerPacket.getClass().getDeclaredField("b");
                field.set(headerPacket, tabFoot);
            } catch (Exception e) {
            } finally {
    There you go, just because I'm a nice guy xD

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

Share This Page