Interface TabList
public interface TabList
Represents the tab list of a
Player
.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
addEntries
(TabListEntry... entries) Adds an array ofTabListEntry
's to thePlayer
's tab list.default void
addEntries
(Iterable<TabListEntry> entries) void
addEntry
(TabListEntry entry) Adds aTabListEntry
to thePlayer
's tab list.default TabListEntry
buildEntry
(GameProfile profile, @Nullable Component displayName, int latency, int gameMode) Deprecated.Internal usage.default TabListEntry
buildEntry
(GameProfile profile, @Nullable Component displayName, int latency, int gameMode, @Nullable IdentifiedKey key) Deprecated.Internal usage.default TabListEntry
buildEntry
(GameProfile profile, @Nullable Component displayName, int latency, int gameMode, @Nullable ChatSession chatSession) Deprecated.Internal usage.buildEntry
(GameProfile profile, @Nullable Component displayName, int latency, int gameMode, @Nullable ChatSession chatSession, boolean listed) Deprecated.Internal usage.void
clearAll()
Clears all entries from the tab list.void
Clears the tab list header and footer for the player.boolean
containsEntry
(UUID uuid) Determines if the specified entry exists in the tab list.Returns an immutableCollection
of theTabListEntry
s in the tab list.Retrieves the tab list entry associated with the given uuid.removeEntry
(UUID uuid) void
setHeaderAndFooter
(Component header, Component footer) Deprecated.
-
Method Details
-
addEntry
Adds aTabListEntry
to thePlayer
's tab list.- Parameters:
entry
- to add to the tab list
-
addEntries
- Parameters:
entries
- to add to the tab list
-
addEntries
Adds an array ofTabListEntry
's to thePlayer
's tab list.- Parameters:
entries
- to add to the tab list
-
removeEntry
- Parameters:
uuid
- of the entry- Returns:
Optional
containing the removedTabListEntry
if present, otherwiseOptional.empty()
-
containsEntry
Determines if the specified entry exists in the tab list.- Parameters:
uuid
- the UUID of the entry- Returns:
true
if it exists,false
if it does not
-
getEntry
Retrieves the tab list entry associated with the given uuid.- Parameters:
uuid
- The player'sUUID
theTabListEntry
is in reference to.- Returns:
Optional.empty()
if the player is not present in the provided player'sTabList
otherwise a presentTabListEntry
in relation to the player.
-
getEntries
Collection<TabListEntry> getEntries()Returns an immutableCollection
of theTabListEntry
s in the tab list.- Returns:
- immutable
Collection
of tab list entries
-
clearAll
void clearAll()Clears all entries from the tab list. -
buildEntry
@Deprecated default TabListEntry buildEntry(GameProfile profile, @Nullable Component displayName, int latency, int gameMode) Deprecated.Internal usage. UseTabListEntry.Builder
instead.Builds a tab list entry.- Parameters:
profile
- profiledisplayName
- display namelatency
- latencygameMode
- game mode- Returns:
- entry
-
buildEntry
@Deprecated default TabListEntry buildEntry(GameProfile profile, @Nullable Component displayName, int latency, int gameMode, @Nullable IdentifiedKey key) Deprecated.Internal usage. UseTabListEntry.Builder
instead.Builds a tab list entry.- Parameters:
profile
- profiledisplayName
- display namelatency
- latencygameMode
- game modekey
- the player key- Returns:
- entry
-
buildEntry
@Deprecated default TabListEntry buildEntry(GameProfile profile, @Nullable Component displayName, int latency, int gameMode, @Nullable ChatSession chatSession) Deprecated.Internal usage. UseTabListEntry.Builder
instead.Represents an entry in aPlayer
's tab list.- Parameters:
profile
- the profiledisplayName
- the display namelatency
- the latencygameMode
- the game modechatSession
- the chat session- Returns:
- the entry
-
buildEntry
@Deprecated TabListEntry buildEntry(GameProfile profile, @Nullable Component displayName, int latency, int gameMode, @Nullable ChatSession chatSession, boolean listed) Deprecated.Internal usage. UseTabListEntry.Builder
instead.Represents an entry in aPlayer
's tab list.- Parameters:
profile
- the profiledisplayName
- the display namelatency
- the latencygameMode
- the game modechatSession
- the chat sessionlisted
- the visible status of entry- Returns:
- the entry