Skip to content

Modules

Scoreboard, nametags, menus and boss bars

Hide the sidebar or nametag for your minigame, open sofyCore menus and manage network boss bars from code.

Scoreboard and nametags (server thread)

Both services work with reasons: the element is hidden while at least one reason remains, so several plugins do not fight each other.

Java
api.service(ScoreboardService.class).ifPresent(sb -> sb.hide(uuid, "my-minigame"));
api.service(NametagService.class).ifPresent(tags -> tags.hide(uuid, "my-minigame"));
// when the game ends
api.service(ScoreboardService.class).ifPresent(sb -> sb.show(uuid, "my-minigame"));
api.service(NametagService.class).ifPresent(tags -> tags.show(uuid, "my-minigame"));
Java
api.service(MenuService.class).ifPresent(menus -> {
    boolean opened = menus.open(player.getUniqueId(), "vip-shop");
});

open returns false if the module is off, the menu is unknown or the arguments are wrong. menus() lists available IDs, including custom menus from menus.yml.

Boss bars

BossBarService reads the catalog and creates, edits or deletes bars and groups. Each write returns the new catalog in a CompletableFuture.