How would i make a scoreboard show an individual player his/her stats like Deaths? I know how to make it global but i cant make it player specific. Can someone help?
An easy way I did this was I created a new object that handled the scoreboard and passed the player in the constructor. I had a method called setup in the class which set the scores for all objectives and just created an instance of the object and called the setup method in the PlayerJoinEvent listener.
ibWill You can save the player's data through a listener to the config and retrieve that data for your scoreboard method that may be invoked in the onEnable() method.
https://forums.bukkit.org/threads/tutorial-scoreboards-teams-with-the-bukkit-api.139655/ From that I got this: Code: ScoreboardManager manager = Bukkit.getScoreboardManager(); org.bukkit.scoreboard.Scoreboard board = manager.getNewScoreboard(); Objective objective = board.registerNewObjective("deaths", "dummy"); objective.setDisplayName("Player Info"); objective.setDisplaySlot(DisplaySlot.SIDEBAR); Score score = objective.getScore(Bukkit.getOfflinePlayer(ChatColor.RED + "Deaths:")); / score.setScore(this.deathCount); player.setScoreboard(board); Then just make deathCount increase everytime the player dies.
StrangeOne101 If you're going to assist someone, make sure you show all fields; deathCount is not displayed in your snippet.
Compressions What do you mean it's not displayed in the snippet? I didn't show it being initialized, I know, but it should be fairly obvious. If I'm no help, then fine.
StrangeOne101 Still, the Bukkit Forums is full of beginners that need every piece of the puzzle to grasp knowledge.