Solved Lagless timer

Discussion in 'Spigot Plugin Development' started by Vylerion, Apr 27, 2017.

  1. Hi,

    At our server we have an minigame, and an timer on the scoreboard But we have one bug: its very laggy when viewed in the timings. We tried fixing this by nestling sync in an async. But that kinda does work, it counts down with 5 steps.
    Can anyone help us make an timer that is laggless, by the way. We can't use async because we are opening an scoreboard.
  2. A Lagless Timer, easy, show us what you've got and we can help you ;)
    • Agree Agree x 2
  3. I guess you are creating a new scoreboard for each update?.
    A few tips when updating a scoreboard constantly are:

    - Share a scoreboard when possible
    - Instead of creating a new one to write changes try to get the objective which has the changing value and then update it
    • Agree Agree x 1
  4. I dont know but we tried:
    Timertasks, schedulers (sync and async), bukkitrunnable, ScheduledExecutorService.

    We fixed it. Just by tweaking.
  5. Consider looking into my wiki. It's in my signature. Would help you saving a lot of stuff for scoreboard :)