hi i use this code for my scoreboard: Code (Text): void ScoreBoard () { ScoreboardManager manager = Bukkit.getScoreboardManager(); Scoreboard board = manager.getNewScoreboard(); Objective objective = board.registerNewObjective("test", "dummy"); objective.setDisplaySlot(DisplaySlot.SIDEBAR); objective.setDisplayName("§a§llevel §b§lplayer §c§lStreak"); for(Player allPlayers : Bukkit.getOnlinePlayers()) { (objective.getScore("§a§l" + (cfg.getInt("stats."+allPlayers.getUniqueId()+".level" )) + " §b" + allPlayers.getName())).setScore(cfg.getInt("stats."+allPlayers.getUniqueId()+".killstreak" )); allPlayers.setScoreboard(board); } } It does work i use it in PlayerDeathEvent but when i try to use it on the join/quit event it doesn't show for the person that joined or update for the others. Code (Text): @EventHandler public void onQuit(PlayerQuitEvent event){ ScoreBoard(); }
Sending spawn entity packets, UI updates, etc, just won't work until the client can see chunks. When PlayerJoinEvent is called, the user is still download the terrain.
Maybe healthbar or some other plugin isn't set to compatibility mode. Some other things interfere with the sidebar. Show us your other plugins
Try to do it with Player p then Code (Text): public void onquit(PlayerQuitEvent e){ ScoreBoard(); e.getPlayer.setScoreboard(manager) } Also your code is on Quit you must do it with On PlayerJoinEvent
public void onPlayerJoin(PlayerJoinEvent e) { Player p = e.getPlayer(); p.setScoreboard(nameofthescoreboard);