Scoreboard Help

Discussion in 'Plugin Development' started by Darkpicasa, Feb 14, 2015.

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

    Darkpicasa

    Hey,

    I'm wondering - whenever I try to create a scoreboard with more than 16 characters to a line, it gives an IllegalArgumentException - that the provided string is > 16 characters in length, which isn't allowed with scoreboards. My immediate solution to that was that I would use scrolling text, which I easily can do. However, I saw that plugins like http://dev.bukkit.org/bukkit-plugins/customscoreboard/ and http://dev.bukkit.org/bukkit-plugins/ezrankslite/ have more than 16 characters. In fact, when I decompiled EZRanks to see how they did it, I found that they had a cap of 48 characters. I was wondering how they managed to do that? I was unable to find anything special in either of their codes.

    Thanks for all help :)
     
  2. Offline

    Timbals

    They are using teams. with that you can set a prefix and suffix.

    Example:
    this is a message with more than 16 characters__
    bold text is the player you add to the team and then you add the prefix and suffix
    Code:
            Scoreboard scoreboard = whatever;
            Team team = scoreboard.registerNewTeam("e with more than"); // name the team the same as the message so there are no duplicates
            team.addEntry("e with more than"); // this is like the "player"
            team.setPrefix("this is a messag");
            team.setSuffix("16 characters__");
     
  3. Offline

    Darkpicasa

    Thanks :) How do I apply this time to the Sidebar Scoreboard objective?

    Meant teams, not time.

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

Share This Page