Interface Sidebar

All Known Implementing Classes:
WrappedSidebar

public interface Sidebar
  • Method Details

    • addLine

      void addLine(SidebarLine sidebarLine)
      Add a new line to the scoreboard.
      Parameters:
      sidebarLine - content.
    • setLine

      void setLine(SidebarLine sidebarLine, int line)
      Set a line content. Ignored if not exists. It will send the update to players automatically.
      Parameters:
      sidebarLine - content.
      line - position. 0 bottom.
    • setTitle

      void setTitle(SidebarLine title)
      Set scoreboard title. It will send the update to players automatically.
      Parameters:
      title - content.
    • refreshPlaceholders

      void refreshPlaceholders()
      Refresh scoreboard placeholders where line is not animated. Can be used async. Does not refresh instances of SidebarLineAnimated, use refreshAnimatedLines() instead.
    • refreshTitle

      void refreshTitle()
      Refresh scoreboard title. Useful when you have an animated title. Can be used async.
    • remove

      void remove(org.bukkit.entity.Player player)
      It is very important to call this when a player logs out or before deleting a scoreboard.
      Parameters:
      player - uuid.
    • add

      void add(org.bukkit.entity.Player player)
      Apply scoreboard to a player.
      Parameters:
      player - user.
    • refreshAnimatedLines

      void refreshAnimatedLines()
      Refresh animated lines. Title excluded. Can be used async.
    • removeLine

      void removeLine(int line)
      Remove a line from the scoreboard. Ignored if line does not exist. Line 0 is the first from bottom. It will send the update to players automatically.
      Parameters:
      line - position. 0 is bottom.
    • clearLines

      void clearLines()
    • lineCount

      int lineCount()
      Returns:
      lines amount.
    • getPlaceholders

      Collection<PlaceholderProvider> getPlaceholders()
      Get placeholder providers list.
      Returns:
      placeholder providers list.
    • setPlayerHealth

      void setPlayerHealth(org.bukkit.entity.Player player, int health)
      Update player health if shown with showPlayersHealth(SidebarLine, boolean).
      Parameters:
      player - subject.
      health - amount.
    • hidePlayersHealth

      void hidePlayersHealth()
      Hide players health previously shown with showPlayersHealth(SidebarLine, boolean).
    • showPlayersHealth

      void showPlayersHealth(SidebarLine displayName, boolean list)
      Show players name.
      Parameters:
      displayName - text under player name.
      list - show health scale on tab.
    • playerTabCreate

      default PlayerTab playerTabCreate(String identifier, @Nullable @Nullable org.bukkit.entity.Player player, SidebarLine prefix, SidebarLine suffix, PlayerTab.PushingRule pushingRule)
      Create a new tab list layout group. Players added to this group will have the same prefix-suffix.
      Parameters:
      identifier - group identifier.
      player - initial member. PAPI subject.
      prefix - prefix text or animation.
      suffix - suffix text or animation.
      pushingRule - how to manage pushing.
      Returns:
      tab group instance.
    • playerTabCreate

      PlayerTab playerTabCreate(String identifier, @Nullable @Nullable org.bukkit.entity.Player player, SidebarLine prefix, SidebarLine suffix, PlayerTab.PushingRule pushingRule, @Nullable @Nullable Collection<PlaceholderProvider> placeholders)
      Create a new tab list layout group. Players added to this group will have the same prefix-suffix.
      Parameters:
      identifier - group identifier.
      player - initial member. PAPI subject.
      prefix - prefix text or animation.
      suffix - suffix text or animation.
      pushingRule - how to manage pushing.
      placeholders - placeholders.
      Returns:
      tab group instance.
    • removeTab

      void removeTab(String identifier)
      Remove tab group form tab list by identifier.
      Parameters:
      identifier - name.
    • removeTabs

      void removeTabs()
      Remove all tab lists.
    • playerTabRefreshAnimation

      void playerTabRefreshAnimation()
      Refresh tab-list animations (if making use of SidebarLineAnimated).
    • playerHealthRefreshAnimation

      void playerHealthRefreshAnimation()
      Refresh bellow player-name animations (if making use of SidebarLineAnimated) and if health is displayed via showPlayersHealth(SidebarLine, boolean).
    • addPlaceholder

      void addPlaceholder(PlaceholderProvider placeholderProvider)
      Add a new placeholder provider for sidebar lines.
      Parameters:
      placeholderProvider - placeholder.
    • removePlaceholder

      void removePlaceholder(String placeholder)
      Remove a placeholder.
      Parameters:
      placeholder - placeholder to be removed.