- 资源类型
- 转载
- API版本
- 1.0.11
ScoreboardAPI
ScoreboardAPI 是为Nukkit/PowerNukkit编写的一个简单的库, 它可以帮助你更简单的去创建自定义计分板
用法
Java:
Scoreboard scoreboard = new Scoreboard("Test Scoreboard", DisplaySlot.SIDEBAR, 20);
// Update time in ticks (20 ticks = 1 second) or skip this option to disable automatic updates
scoreboard.setHandler(pl -> {
scoreboard.addLine(pl.getName());
scoreboard.addLine("§1"); // used for skip line
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"); // used for skip line
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>