Interface TabList
public interface TabList
Represents a
Player
's tab list.-
Method Summary
Modifier and TypeMethodDescriptionaddEntry
(TabListEntry entry) Adds an entry to the list.entries()
Gets the entries on the list.Gets aTabListEntry
matching the specified unique id.footer()
Gets this list's footer.header()
Gets this list's header.player()
removeEntry
(UUID uniqueId) Removes an entry from the list.Sets this list's footer.Sets this list's header.default TabList
setHeaderAndFooter
(@Nullable Component header, @Nullable Component footer) Sets this list's header and footer.
-
Method Details
-
player
ServerPlayer player()- Returns:
- The associated player
-
header
Gets this list's header.- Returns:
- The current header
-
setHeader
Sets this list's header.When
null
is passed, an emptyComponent
will be sent.- Parameters:
header
- The new header- Returns:
- This tab list, for chaining
-
entries
Collection<TabListEntry> entries()Gets the entries on the list.The returned collection should be immutable.
- Returns:
- The entries on the list
-
entry
Gets aTabListEntry
matching the specified unique id.- Parameters:
uniqueId
- The unique id to search for- Returns:
- The entry if present, otherwise
Optional.empty()
-
addEntry
Adds an entry to the list.- Parameters:
entry
- The entry to add- Returns:
- This tab list, for chaining
- Throws:
IllegalArgumentException
- if an entry already with the same unique id exists on the listIllegalStateException
- if the provided entry was not
-
removeEntry
Removes an entry from the list.Note that if this is used on a player, but they remain visible in-game, their skin will not work.
- Parameters:
uniqueId
- The unique id of the entry to remove- Returns:
- The entry that was associated with the unique id
-