Hello Everyone, I am creating a scoreboard plugin. I need the plugin to be compatible with PrisonRankup. I have no idea where to start, i have googled several times how to create a scoreboard but no tutorials helped If you could give me the code, or not, but explain in detail (Im a beginner) on how to create a scoreboard. Thanks in advanced Unique
Don't copy and paste. You won't learn. You can read my explaination or read chasechocolate's. https://forums.bukkit.org/threads/tutorial-scoreboards-teams-with-the-bukkit-api.139655/ Code:java final Player p = Bukkit.getPlayer("stormneo7");// Firstly we need to get a scoreboard. We could obviously use p.getScoreboard() but I'm just going to create a new one.final Scoreboard scoreboard = Bukkit.getScoreboardManager().getNewScoreboard();// Next we'll register a new objective, what the scoreboard is designed to do. We don't want it to do anything special so we'll name it something random like 'random' and 'scrub'.final Objective obj = scoreboard.registerNewObjective("random", "scrub");// We'll set the DisplayName of the board to "Your Stats".obj.setDisplayName("Your Stats"); // This could be colored as you desire.// Set where the scoreboard goes. In this case, the sidebar.obj.setDisplaySlot(DisplaySlot.SIDEBAR); // Now the scoring part. Remember, scores must be an Integer (I believe has to be above or equal to 0).// We'll create a score in the scoreboard named "PlayersOnline" and set it's score to the online players.final Score Online = obj.getScore(Bukkit.getOfflinePlayer("PlayersOnline")); // This too can be colored as you wish.Online.setScore(Bukkit.getOnlinePlayers().length); // Sets the player's scoreboard.p.setScoreboard(scoreboard); // You can create as many scores as you like but I believe 16 is the limit.// Please also note that scores are listed from the highest to the least.