Spigot MineBoard | FREE SCOREBOARD PLUGIN + CONFIG.YML 1.2

A Scoreboard plugin for free with tags ! :)

  1. MineDev submitted a new resource:

    MineBoard | FREE SCOREBOARD PLUGIN + CONFIG.YML - Scoreboard

    Read more about this resource...
     
    • Like Like x 1
    • Like Like x 1
  2. You can make your plugin clearer and more dynamic by looping a StringList instead of having fixed lines.
    Code (Java):
    public void setBoard(Player player) {

    Scoreboard scoreboard = new Scoreboard();

            ScoreboardObjective obj = scoreboard.registerObjective("zagd", IScoreboardCriteria.b);
            obj.setDisplayName(title);
            PacketPlayOutScoreboardObjective createPacket = new PacketPlayOutScoreboardObjective(obj, 0);
            PacketPlayOutScoreboardDisplayObjective display = new PacketPlayOutScoreboardDisplayObjective(1, obj);

            PacketPlayOutScoreboardObjective removePacket = new PacketPlayOutScoreboardObjective(obj, 1);

            sendPacket(removePacket, p);
            sendPacket(createPacket, p);
            sendPacket(display, p);

            List<String> lines = Arrays.asList("", "");
            for(int i = 0; i < lines.size(); i++) {
                String line = replacePlaceholders(lines.get(i), p);
                ScoreboardCore score = new ScoreboardCore(scoreboard, obj, line);
                score.setScore(lines.size() - i);

                PacketPlayOutScoreboardScore packet = new PacketPlayOutScoreboardScore(score);
                sendPacket(packet, p);
            }
    }

    private void replacePlaceholders(String line, Player player) {
                line = line.replace("%player%", player.getName());
                line = line.replace("%onlineplayers%", Bukkit.getOnlinePlayers().size());
                line = line.replace("%maxplayers%", Bukkit.getMaxPlayers());
            }
     
    • Like Like x 2
  3. [-------------------------]
    Nice :)
    [-------------------------]
     
  4. Anyone have ideas for updates?