Scoreboard doesn't show.

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

  1. Hello, Developers!
    Today I tried to make a Scoreboard on PlayerJoinEvent, but it doesn't work.
    Code (Text):
    public void gameListScoreboard(PlayerJoinEvent event) {
    ScoreboardManager manager = Bukkit.getScoreboardManager();
    Scoreboard gamelist = manager.getNewScoreboard();
    Objective list = gamelist.registerNewObjective("gamelist", "dummy");
    list.setDisplaySlot(DisplaySlot.SIDEBAR);
    list.setDisplayName("Servers");
    event.getPlayer().setScoreboard(gamelist);
    }
    Does someone know why it doesn't display? It doesn't give error in console or anything.
     
  2. This is for Minecraft 1.8, right?
     
  3. Yes, 1.8.3 R2
     
  4. You need to add a tick delay. You can't set directly on join. You have to schedule a tick before setting it.
     
  5. And how would I do, can you give me an example please?
     
  6. I understand how Scheduler Progamming works but I don't understand your solution.
     
  7. Schedule a tick delay on playerJoinEvent and on the second tick, show the scoreboard.
     
  8. Uhmm what? You only need to schedule a tick delay and inside there you set the scoreboard....