Scoreboard with Kills and Death Stats Per Player

Discussion in 'Plugin Development' started by LordVakar, Apr 18, 2014.

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

    LordVakar

    So I have a scoreboard:
    Code:java
    1. public static void Scoreboard()
    2. {
    3. ScoreboardManager manager = Bukkit.getScoreboardManager();
    4. Scoreboard board = manager.getNewScoreboard();
    5. Objective statsboard = board.registerNewObjective("Stats", "dummy");
    6. statsboard.setDisplaySlot(DisplaySlot.SIDEBAR);
    7. statsboard.setDisplayName("Stats:");
    8. Score deaths = statsboard.getScore(Bukkit.getOfflinePlayer(ChatColor.RED + "Deaths:"));
    9. Score kills = statsboard.getScore(Bukkit.getOfflinePlayer(ChatColor.GREEN + "Kills:"));
    10. Score killstreak = statsboard.getScore(Bukkit.getOfflinePlayer(ChatColor.GOLD + "Killstreaks:"));
    11. }


    How would I make it so on the PlayerDeathEvent, the killer gets one kill added to his score and the victim gets one death added to their score?
    Also, how would I make it so the scoreboard is per player? Like Player1's kills and deaths would be different from Player2's.

    Also how would I save the deaths and kills in an efficient way under a player's UUID? Config?
     
  2. Offline

    Glumpz

    For my plugin I make a folder called "Players" with a file that is the players UUID.yml so an example would be <UUID>.yml. Then I just open the correct one per player.
     
  3. Offline

    LordVakar

    Glumpz

    Er yes, but from my first post, do you know how to:
     
  4. Offline

    Glumpz

    LordVakar I do, in the events just add to their specific score. 'Nuff said.
     
Thread Status:
Not open for further replies.

Share This Page