Interface ScoreboardLibrary

All Known Implementing Classes:
NoopScoreboardLibrary

@NonExtendable public interface ScoreboardLibrary
Entrypoint of the library. To create an instance of this interface, use loadScoreboardLibrary(org.bukkit.plugin.Plugin). For unit testing, take a look at NoopScoreboardLibrary. Note: this class is thread-safe, meaning you can safely use it from multiple threads at a time.
  • Method Details

    • loadScoreboardLibrary

      @NotNull static @NotNull ScoreboardLibrary loadScoreboardLibrary(@NotNull @NotNull org.bukkit.plugin.Plugin plugin) throws NoPacketAdapterAvailableException
      Creates an instance of ScoreboardLibrary.
      Parameters:
      plugin - your plugin instance
      Throws:
      NoPacketAdapterAvailableException - if there is no packet adapter available for the current server version
    • createSidebar

      @NotNull default @NotNull Sidebar createSidebar()
      Creates a new Sidebar;
      Returns:
      newly created sidebar
    • createSidebar

      @NotNull default @NotNull Sidebar createSidebar(@org.jetbrains.annotations.Range(from=1L, to=2147483647L) int maxLines)
      Creates a new Sidebar.
      Parameters:
      maxLines - max amount of lines the sidebar will have. Note that vanilla clients can only display at most 15
      Returns:
      newly created sidebar
    • createSidebar

      @NotNull @NotNull Sidebar createSidebar(@org.jetbrains.annotations.Range(from=1L, to=2147483647L) int maxLines, @Nullable @Nullable Locale locale)
      Creates a new Sidebar.
      Parameters:
      maxLines - max amount of lines the sidebar will have. Note that vanilla clients can only display at most 15
      locale - locale which will be used for translating TranslatableComponents, or null if the locale should depend on the player
      Returns:
      newly created sidebar
    • createTeamManager

      @NotNull @NotNull TeamManager createTeamManager()
      Creates a new TeamManager.
      Returns:
      newly created team manager
    • createObjectiveManager

      @NotNull @NotNull ObjectiveManager createObjectiveManager()
      Creates a new ObjectiveManager.
      Returns:
      newly created objective manager
    • close

      void close()
      Closes this scoreboard library instance. You should call this in JavaPlugin.onDisable().
    • closed

      boolean closed()
      Returns:
      whether this scoreboard library instance is closed