Package com.andrei1058.spigot.sidebar
Interface Sidebar
- All Known Implementing Classes:
WrappedSidebar
public interface Sidebar
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(org.bukkit.entity.Player player) Apply scoreboard to a player.voidaddLine(SidebarLine sidebarLine) Add a new line to the scoreboard.voidaddPlaceholder(PlaceholderProvider placeholderProvider) Add a new placeholder provider for sidebar lines.voidGet placeholder providers list.voidHide players health previously shown withshowPlayersHealth(SidebarLine, boolean).intvoidRefresh bellow player-name animations (if making use ofSidebarLineAnimated) and if health is displayed viashowPlayersHealth(SidebarLine, boolean).default PlayerTabplayerTabCreate(String identifier, @Nullable org.bukkit.entity.Player player, SidebarLine prefix, SidebarLine suffix, PlayerTab.PushingRule pushingRule) Create a new tab list layout group.playerTabCreate(String identifier, @Nullable org.bukkit.entity.Player player, SidebarLine prefix, SidebarLine suffix, PlayerTab.PushingRule pushingRule, @Nullable Collection<PlaceholderProvider> placeholders) Create a new tab list layout group.voidRefresh tab-list animations (if making use ofSidebarLineAnimated).voidRefresh animated lines.voidRefresh scoreboard placeholders where line is not animated.voidRefresh scoreboard title.voidremove(org.bukkit.entity.Player player) It is very important to call this when a player logs out or before deleting a scoreboard.voidremoveLine(int line) Remove a line from the scoreboard.voidremovePlaceholder(String placeholder) Remove a placeholder.voidRemove tab group form tab list by identifier.voidRemove all tab lists.voidsetLine(SidebarLine sidebarLine, int line) Set a line content.voidsetPlayerHealth(org.bukkit.entity.Player player, int health) Update player health if shown withshowPlayersHealth(SidebarLine, boolean).voidsetTitle(SidebarLine title) Set scoreboard title.voidshowPlayersHealth(SidebarLine displayName, boolean list) Show players name.
-
Method Details
-
addLine
Add a new line to the scoreboard.- Parameters:
sidebarLine- content.
-
setLine
Set a line content. Ignored if not exists. It will send the update to players automatically.- Parameters:
sidebarLine- content.line- position. 0 bottom.
-
setTitle
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 ofSidebarLineAnimated, userefreshAnimatedLines()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 withshowPlayersHealth(SidebarLine, boolean).- Parameters:
player- subject.health- amount.
-
hidePlayersHealth
void hidePlayersHealth()Hide players health previously shown withshowPlayersHealth(SidebarLine, boolean). -
showPlayersHealth
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
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 ofSidebarLineAnimated). -
playerHealthRefreshAnimation
void playerHealthRefreshAnimation()Refresh bellow player-name animations (if making use ofSidebarLineAnimated) and if health is displayed viashowPlayersHealth(SidebarLine, boolean). -
addPlaceholder
Add a new placeholder provider for sidebar lines.- Parameters:
placeholderProvider- placeholder.
-
removePlaceholder
Remove a placeholder.- Parameters:
placeholder- placeholder to be removed.
-