I have created a quick class, allowing you to display information on a scoreboard with ease! Basicly, this can display information really easily. It sets the score in the order you set it in, so it reads from up to down. The actually score (number in read) will be oblivious, I wouldn't change it. Its men't to make an easy board like Mineplex's, that don't actually use the score numbers. To make this: All we have to do is: Code: FunctionalBoard board = new FunctionalBoard("My Scoreboard", "Welcome player", "Have fun player", "Enjoy! :P"); FunctionalBoard.setBoard(player, board); Heres basically how it works: Code: //Create a FunctionalBoard object FunctionalBoard board = new FunctionalBoard("SB Name", "Unlimited scores"); //This creates a new board, with the name "SB Name" and adds 1 score //We can also add scores to the board, not when we make it: board.addLine("My line"); //If we wanted to get a Line to change the score or something, we can do: board.getLine("line"); //And finally to show the board, use the static method: FunctionalBoard.setBoard(player, board); And the code: Code: package me.jpg.testplugin; import java.util.ArrayList; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.Objective; import org.bukkit.scoreboard.Score; import org.bukkit.scoreboard.Scoreboard; /** * * @Author Jake */ public class FunctionalBoard { private static Scoreboard board; private ArrayList<Score> score; private Objective o; public FunctionalBoard() { } public FunctionalBoard(String name, String... lines) { board = Bukkit.getScoreboardManager().getNewScoreboard(); score = new ArrayList<Score>(); o = board.registerNewObjective("objective", "dummy"); o.setDisplayName(name); o.setDisplaySlot(DisplaySlot.SIDEBAR); int counter = lines.length; for (String s : lines) { score.add(o.getScore(Bukkit.getOfflinePlayer(s))); o.getScore(Bukkit.getOfflinePlayer(s)).setScore(counter); counter--; } } public Score getLine(String line) { return o.getScore(Bukkit.getOfflinePlayer(line)); } public void addLine(String... lines) { for (String s : lines) { score.add(o.getScore(Bukkit.getOfflinePlayer(s))); } int counter = score.size(); for (Score s : score) { o.getScore(s.getPlayer()).setScore(counter); counter--; } } public ArrayList<Score> getScores() { return score; } public static void setBoard(Player player, FunctionalBoard fb) { player.setScoreboard(board); } } http://pastebin.com/pHhAMGT5 So to clear it up, its just basically an object you can make that you can easily set information on the board. I did a test, and with my class, I made a SB that took 2 lines of code. When I used the BukkitAPI's Scoreboard, it took me 18 lines of code. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
Garris0n Could you tell me how to make it 48 characters long (or any longer than 16 -,- )? Would be very helpful!
BeatCycle This is outdated, and uses old methods for scoreboards; please use a resource such as SimpleScoreboard