Solved Scoreboard Stacktrace

Discussion in 'Spigot Plugin Development' started by Futurize, May 22, 2017.

  1. Hello guys, I have encountered a bit of a problem with making teams. I can get this error when the teams are being made:
    Code (Text):
    [17:40:43] [Craft Scheduler Thread - 4/WARN]: org.apache.commons.lang.UnhandledException: Plugin TeamTags v1.0 generated an exception while executing task 84
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.IllegalStateException: Unregistered scoreboard component
        at org.bukkit.craftbukkit.v1_8_R3.scoreboard.CraftTeam.checkState(CraftTeam.java:217)
        at org.bukkit.craftbukkit.v1_8_R3.scoreboard.CraftTeam.hasEntry(CraftTeam.java:172)
        at me.futurize.nametags.scoreboard.PlayerBoard$3.run(PlayerBoard.java:177)
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
        ... 3 more

    [17:40:43] [Craft Scheduler Thread - 6/WARN]: Exception in thread "Craft Scheduler Thread - 6"
    [17:40:43] [Craft Scheduler Thread - 6/WARN]: org.apache.commons.lang.UnhandledException: Plugin TeamTagsv1.0 generated an exception while executing task 83
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:56)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.IllegalStateException: Unregistered scoreboard component
        at org.bukkit.craftbukkit.v1_8_R3.scoreboard.CraftTeam.checkState(CraftTeam.java:217)
        at org.bukkit.craftbukkit.v1_8_R3.scoreboard.CraftTeam.hasEntry(CraftTeam.java:172)
        at me.futurize.nametags.scoreboard.PlayerBoard$3.run(PlayerBoard.java:177)
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftTask.run(CraftTask.java:71)
        at org.bukkit.craftbukkit.v1_8_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:53)
        ... 3 more
    Anyone have anything to help me out with this? Thanks!
     
  2. Did you try to update a scoreboard team with a team that doesn't exist?
     
  3. Says Unregistered Scoreboard component, so, look for anything that may give that error, you didn't post any code so how should I know? All I see is that I think your running a bukkit task or scheduler that involves the scoreboard.
     
  4. It is pointing towards PlayerBoard line 177. This is the code:
    Code (Text):
                        if (members.hasEntry(update.getName()))
                            members.removeEntry(update.getName());
    It is being registered though.
    Code (Text):
        public PlayerBoard(Main plugin, Player player) {
            this.plugin = plugin;
            this.player = player;

            this.scoreboard = plugin.getServer().getScoreboardManager().getNewScoreboard();
            this.bufferedObjective = new BufferedObjective(scoreboard);

            this.members = scoreboard.registerNewTeam("members");
            this.members.setPrefix(ChatColor.GREEN;
            this.members.setCanSeeFriendlyInvisibles(true);
     
  5. I suggest you use an API known as SimpleScoreboard. It would be much easier than just using the default Bukkit methods as those can be buggy without good knowledge. Or you can make your own. It's your choice!

    NOTE If you need it, just good search "Simple Scoreboard API Bukkit" and you should find it. Any errors are probably false.

    Hope I helped!
    - funkemunky
     
  6. Not looking for an API. I need help with solving this problem. I already have it all working besides this one error.
     
  7. Anyone have any input?