Scoreboard Tutorial

Scoreboards are a nice tool, but often frustrating to work with due to their requirement for the numerical values along the side, their limited size per line, and the need to manually update custom stats. With this tutorial and the help of MCCore, hopefully these issues can be resolved!

Making A Scoreboard

If you want to use one of the two default implementations, it is very simple! Each one of the two scoreboards requires different parameters:


  • String title - this will be the header for the scoreboard over the messages that are added
  • String plugin - simply your plugin name for sorting purposes
  • boolean seperateMessages - Whether or not to separate messages with a line


  • String title - this will be the header for the scoreboard over the stats
  • String plugin - simply your plugin name for sorting purposes

The statboard won't show anything at first if you don't add stats to it. To add stats, simply do:
The statBoard is the scoreboard you constructed above and the statHolder is whatever you use for your stats. statHolder should implement the StatHolder interface.

A stat holder for a StatBoard

public class ExampleStats implements StatHolder {
    private int level;
    private int exp;
    public Map<String, Integer> getStats() {
        HashMap<String, Integer> stats = new HashMap<String, Integer>();
        stats.put("Level", level);
        stats.put("Exp", exp);
        return stats;

And then creating the StatBoard for these stats

        StatBoard statBoard = new StatBoard("Example", plugin.getName());
        ExampleStats stats = new ExampleStats();

If you would like to create a different kind of scoreboard, then you have to create a new class and extend the class Board. Board requires the same things as StatBoard for its constructor (you just pass it into the super constructor). Here's a basic example of making a player kill counter scoreboard:

public class KillBoard extends Board {

    public KillBoard(String plugin, String title) {
        super(plugin, "playerKillCount", title);

You would create this in the same way with the StatBoard, just without the need for the StatHolder

Once you have that, you are ready to assign the scoreboards to players!

PlayerBoards playerData = BoardManager.getPlayerBoards(player.getName());

And then you're done! Cycling will now include your scoreboard and players can switch to it when they want by using the title you entered as the name in the /board show command!


Posts Quoted:
Clear All Quotes