Welcome to the Hangar Open Beta. Please report any issue you encounter on GitHub!
Avatar for TureBentzin

Coreboard - The simple scoreboard utility for the PaperCore

Report Scoreboard?

Scoreboard

This Plugin for 1.18.2, requiers PaperCore to be executed.

This system provides a simple "bridge" between the MessageSystem of the Core to the String based Scoreboards of Bukkit. With this you are able to set messageKeys as text in the scores. You can compute the scoreboard for every player individualy using the provided Service.

This plugin will not do anything on his own. Simple installation will provide the service, but no scoreboard will be displayed. This is just a dependency for other Plugins!

Currently this plugin is still in developement and not fully tested, i do not recommend running it out of the box on a production enviroment. If you encounter issues or wrong behavior, please let me know and open an issue!

API Examples:

import com.google.common.base.Preconditions;
import net.juligames.core.addons.scoreboard.service.ScoreboardProvider;
import net.juligames.core.addons.scoreboard.service.ScoreboardService;
import net.juligames.core.addons.scoreboard.service.ScoreboardServiceProvider;
import org.bukkit.Bukkit;
import org.bukkit.GameMode;
   @TestOnly
   public void demo() {

       //Access the Service via Bukkit ServiceManager
       ScoreboardService service =
               Preconditions.checkNotNull(Bukkit.getServicesManager().load(ScoreboardService.class));

       //Set your ScoreboardProvider
       service.setScoreboardProvider((player, line) ->
               new ScoreboardProvider.ScoreboardReturn("demokey.for.all.players." + line,
               new ScoreboardServiceProvider.EmptyReplacementSupplier()));

       //Ensure all players are enabled (you need to manually disable them if you want - no automatic removal)
       Bukkit.getOnlinePlayers().forEach(player -> service.enable(true,player));

       //Ensure the Service is enabled
       service.enable(true);

       //update the scoreboards
       service.update();

       //update only for players whose name ends with "ator" (just as an example)
       service.update(player -> player.getName().endsWith("ator"));

       //update first two lines for all players
       service.updateI(integer -> integer < 2);

       //update line six for all players in adventure mode (just as an example)
       service.update(player -> player.getGameMode().equals(GameMode.ADVENTURE),
                  integer -> integer == 5);
   }

Information

CategoryDeveloper Tools
Published onFebruary 20, 2023
LicenseApache 2.0
Downloads30
Stars0
Watchers0
Library
Addon

Pinned Versions

Members