Skip to content

Scoreboard(Sidebar) Utils

DarthBoomerPlay edited this page Mar 28, 2020 · 1 revision

Scoreboard(Sidebar) Utils

This utility will help to create a sidebar. Version support: 1.8 - 1.15.1

void setDisplayName(String name) // set Display Name

void addLine(int index, String text) // add line
void removeLine(int index) // remove line

void addUpdater(long time, SidebarUpdater boardUpdater) // update scoreboard(sidebar)

void remove(Player player)  // remove player from scoreboard(sidebar)

void show(Player player) // show scoreboard(sidebar) to player

// Example to usage:
ChatColor[] displayNameColors = { ChatColor.AQUA, ChatColor.BLUE };
ThreadLocalRandom random = ThreadLocalRandom.current();

DarthSidebar.newBuilder().setDisplayName("§6§lDARTHCORE")
       .addLine(4, "&7".concat(DateUtil.getDate("Date: dd/MM/yy, Time: HH:mm")))
       .addLine(3, "")
       .addLine(2, "&fDeveloper: &cDarthBoomerPlay_")
       .addLine(1, "")
       .addLine(0, "&ewww.peercloud.ru").addUpdater(20L, update -> {
              update.setDisplayName(displayNameColors[random.nextInt(displayNameColors.length)] + "§lDARTHCORE");  
              update.addLine(4, "&7".concat(DateUtil.getDate("Date: dd/MM/yy, Time: HH:mm")));
       }).build().show(player);
Clone this wiki locally