Console Error

Discussion in 'Spigot Plugin Development' started by MrFishCakes, Apr 28, 2017.

  1. Not going to lie about this, but you made a bunch of stuff wrong in java, so we start with some behavior issues,
    You create static fields in your scoreboard class that aren't beeing accessed from another class so its not required.
    You can't create a scoreboard on an async thread you can fix that by using a sync task.
    Also you may create a constructor of the scoreboard to handle everything ( so you also don't have to use static fields . )

    So lets start with your issue:

    Your error came up because you create a scoreboard on an async thread. ( Change that to sync or just start another task in your async task ( normally not necessary ))
    You Scoreboard won't update the values of the countdown ( only the health should be updated ) because you request the time from a config, but you don't update the value in the scoreboard class, because you just set the scoreboard on the countdown end.
    So you have to use another task to update the scoreboard values. But notice, don't spam the client with new scoreboards over and over, just use teams or the resetScores method to update the values.
     
    • Informative Informative x 1
  2. Alright, thanks for the help and tips.