1ScoreboardManager manager = Bukkit.getScoreboardManager();
2Scoreboard board = manager.getNewScoreboard();
3Objective objective = board.registerNewObjective("test", "dummy");
4
5 //Setting where to display the scoreboard/objective (either SIDEBAR, PLAYER_LIST or BELOW_NAME)
6 objective.setDisplaySlot(DisplaySlot.SIDEBAR);
7
8 //Setting the display name of the scoreboard/objective
9 objective.setDisplayName("Display Name");
10
11 Score score = objective.getScore(ChatColor.GREEN + "Kills:"); //Get a fake offline player
12 score.setScore(1);