ScoreboardAPI
ScoreboardAPI 是为Nukkit/PowerNukkit编写的一个简单的库, 它可以帮助你更简单的去创建自定义计分板
用法
Java:
Scoreboard scoreboard = new Scoreboard("Test Scoreboard", DisplaySlot.SIDEBAR, 20);
//更新时间(以刻度为单位)(20 个刻度 = 1 秒)或跳过此选项以禁用自动更新计分板
scoreboard.setHandler(pl -> {
scoreboard.addLine(pl.getName());
scoreboard.addLine("§1"); //用于间隔栏
scoreboard.addLine("random: " + Math.random());
scoreboard.addLine("random: " + Math.random());
scoreboard.addLine("random: " + Math.random());
scoreboard.addLine("random: " + Math.random());
scoreboard.addLine("random: " + Math.random());
scoreboard.addLine("§2"); //用于间隔栏
scoreboard.addLine("Online: " + Server.getInstance().getOnlinePlayers().size());
});
scoreboard.show(player);
Maven
仓库
XML:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
依赖
XML:
<dependency>
<groupId>com.github.IWareQ</groupId>
<artifactId>ScoreboardAPI</artifactId>
<version>Tag</version>
</dependency>