-
Notifications
You must be signed in to change notification settings - Fork 19
Scoreboard
Hakan Kargın edited this page Jun 2, 2022
·
3 revisions
With this feature you can create scoreboards and shows scoreboards to players without any flick.
public void createScoreboard(Player player) {
HScoreboard scoreboard = HCore.createScoreboard(player); //we created a HScoreboard object for player
scoreboard.setTitle("Scoreboard"); //sets title of scoreboard
scoreboard.expire(10, TimeUnit.MINUTES); //this scoreboard will delete in 10 minutes
scoreboard.setUpdateInterval(2); //when we use update method, it will recall itself every 2 ticks
scoreboard.show(); //this will shows scoreboard to player
scoreboard.update(hScoreboard -> { //every 2 tick, this consumer runs.
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"
});
}