Scoreboards
hCore also provides you to create your custom scoreboard.
Creating
public void createScoreboard(Player player) {
HScoreboard scoreboard = HCore.createScoreboard(player, "id"); // we created a HScoreboard object for player with id "id"
scoreboard.setTitle("Scoreboard"); //sets title of scoreboard
scoreboard.expire(10, TimeUnit.MINUTES); //this scoreboard will delete in 10 minutes
scoreboard.show(); //this will shows scoreboard to player
scoreboard.update(2, hScoreboard -> { //every 2 tick, this consumer runs and automaticly will run show method.
scoreboard.setLine(0, "test"); //sets line 0 of scoreboard as "test"
scoreboard.setLine(1, "this is a test scoreboard"); //sets line 1 of scoreboard as "this is a test scoreboard"
scoreboard.setLine(2, "this is 3th line of scoreboard!");
});
}HScoreboard#delete()
HScoreboard#getPlayer()
HScoreboard#setTitle(String title)
HScoreboard#setLine(int line, String content)
HScoreboard#setLines(String... lines)
HScoreboard#expire(int ticks)
HScoreboard#update(int interval, Consumer<HScoreboard> consumer)
HScoreboard#show()
Last updated