Different objectives showing to players

Discussion in 'Spigot Plugin Development' started by Oberdiah, May 3, 2015.

  1. Hello, I have filled the main scoreboard with multiple "objectives", and I would like to allow some players to see some objectives, and others to see others. Currently, setting the location of the objective to "SIDEBAR" forces everyone on the server to have that objective on their sidebar, and I would only like to select a few players.

    I would not like to rewrite my entire plugin so I have an objective per scoreboard, if that can be helped.

    Thanks, Oberdiah.
  2. I'm sorry but you have to use packets there or "rotate" through your obj. :(
  3. What do you mean by "Rotate" through my objective?

    I didn't know that was possible?
  4. I meant:
    Show every scoreboard five seconds.. then next... then next.. etc...
  5. I have made an enderpearl cooldown plugin a few days ago, where a sidebar with time would appear after you throw an enderpearl. The only way I found to make it per-player was by creating multiple scoreboards.
  6. You can use Bukkit.getNewScoreboard(); to create a new scoreboard for each player. There are tutorials on how to ensure the scoreboard does not flicker too! Just a little warning, when you add players to teams on another scoreboard, the teams do not work as if they did on the main scoreboard.
  7. So how do I do teams then? Do I have to have all of the teams on a main scoreboard, but the actual objectives on different ones?

    Also, if I create a bunch of scoreboards, one per player, how do I cycle through them? Bukkit.getScoreboardManager().getScoreboards() doesn't exist.