Scoreboards ain't showing up?

Discussion in 'Plugin Development' started by nichiatu, Jan 8, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    nichiatu

    So I'm tinkering around with the scoreboards, they're old news to most of you by now, but to me brand new (haven't played minecraft for real since before it was released), and I am having some troubles getting them to actually show up.

    This code isn't throwing any errors, but there's probably some rookie mistake in here that I've overlooked.

    Code:java
    1. ScoreboardManager sm = Bukkit.getScoreboardManager();
    2. Scoreboard scoreboard = sm.getNewScoreboard();
    3.  
    4. Objective econ = scoreboard.registerNewObjective("test", "dummy");
    5.  
    6. econ.setDisplaySlot(DisplaySlot.SIDEBAR);
    7. econ.setDisplayName("Fun");
    8.  
    9. Team team = scoreboard.registerNewTeam("funteam");
    10. team.addPlayer(Bukkit.getOfflinePlayer(ChatColor.GRAY + "Thing 1:"));
    11. team.addPlayer(Bukkit.getOfflinePlayer(ChatColor.GOLD + "Thing 2:"));
    12.  
    13. Score score = econ.getScore(Bukkit.getOfflinePlayer(ChatColor.GRAY + "Thing 1:"));
    14. Score score2 = econ.getScore(Bukkit.getOfflinePlayer(ChatColor.GOLD + "Thing 2:"));
    15.  
    16. score.setScore(1);
    17. score2.setScore(1);


    I'm a bit baffled by the unreadableness of code this creates.
     
  2. Offline

    thepaperboy99

    player.setScoreboard(scoreboard);
     
    HeavyMine13 likes this.
  3. Offline

    nichiatu

    oh my god.
     
  4. Offline

    HeavyMine13

    you are not calling them into action, you are only setting them, use this: player.setScoreboard(Scoreboard);
     
  5. Offline

    nichiatu

    HeavyMine13

    yeah, I figured, which is why I said "oh my god".
     
Thread Status:
Not open for further replies.

Share This Page