Interface TabListEntry
-
public interface TabListEntry
Represents a single entry in aTabList
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TabListEntry.Builder
Represents a builder which createsTabListEntry
s.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description static TabListEntry.Builder
builder()
Returns aTabListEntry.Builder
to create aTabListEntry
.Optional<net.kyori.text.Component>
getDisplayName()
Deprecated.UsegetDisplayNameComponent()
insteadOptional<Component>
getDisplayNameComponent()
ReturnsOptional
textComponent
, which if present is the text displayed forthis
entry in theTabList
, otherwiseGameProfile.getName()
is shown.int
getGameMode()
Gets the game modethis
entry has been set to.int
getLatency()
Returns the latency forthis
entry.GameProfile
getProfile()
Returns theGameProfile
of the entry, which uniquely identifies the entry with the containingUUID
, as well as deciding what is shown as the player head in the tab list.TabList
getTabList()
TabListEntry
setDisplayName(@Nullable Component displayName)
TabListEntry
setDisplayName(net.kyori.text.Component displayName)
Deprecated.UsesetDisplayName(Component)
insteadTabListEntry
setGameMode(int gameMode)
Sets the game mode forthis
entry to the specified value.TabListEntry
setLatency(int latency)
Sets the latency forthis
entry to the specified value.
-
-
-
Method Detail
-
getProfile
GameProfile getProfile()
Returns theGameProfile
of the entry, which uniquely identifies the entry with the containingUUID
, as well as deciding what is shown as the player head in the tab list.- Returns:
GameProfile
of the entry
-
getDisplayName
@Deprecated Optional<net.kyori.text.Component> getDisplayName()
Deprecated.UsegetDisplayNameComponent()
insteadReturnsOptional
textComponent
, which if present is the text displayed forthis
entry in theTabList
, otherwiseGameProfile.getName()
is shown.- Returns:
Optional
textComponent
of name displayed in the tab list
-
getDisplayNameComponent
Optional<Component> getDisplayNameComponent()
ReturnsOptional
textComponent
, which if present is the text displayed forthis
entry in theTabList
, otherwiseGameProfile.getName()
is shown.- Returns:
Optional
textComponent
of name displayed in the tab list
-
setDisplayName
@Deprecated TabListEntry setDisplayName(net.kyori.text.Component displayName)
Deprecated.UsesetDisplayName(Component)
insteadSets the textComponent
to be displayed forthis
TabListEntry
. Ifnull
,GameProfile.getName()
will be shown.- Parameters:
displayName
- to show in theTabList
forthis
entry- Returns:
this
, for chaining
-
setDisplayName
TabListEntry setDisplayName(@Nullable Component displayName)
Sets the textComponent
to be displayed forthis
TabListEntry
. Ifnull
,GameProfile.getName()
will be shown.- Parameters:
displayName
- to show in theTabList
forthis
entry- Returns:
this
, for chaining
-
getLatency
int getLatency()
Returns the latency forthis
entry.The icon shown in the tab list is calculated by the latency as follows:
- A negative latency will display the no connection icon
- 0-150 will display 5 bars
- 150-300 will display 4 bars
- 300-600 will display 3 bars
- 600-1000 will display 2 bars
- A latency move than 1 second will display 1 bar
- Returns:
- latency set for
this
entry
-
setLatency
TabListEntry setLatency(int latency)
Sets the latency forthis
entry to the specified value.- Parameters:
latency
- to changed to- Returns:
this
, for chaining- See Also:
getLatency()
-
getGameMode
int getGameMode()
Gets the game modethis
entry has been set to.The number corresponds to the game mode in the following way:
- Survival
- Creative
- Adventure
- Spectator
- Returns:
- the game mode
-
setGameMode
TabListEntry setGameMode(int gameMode)
Sets the game mode forthis
entry to the specified value.- Parameters:
gameMode
- to change to- Returns:
this
, for chaining- See Also:
getGameMode()
-
builder
static TabListEntry.Builder builder()
Returns aTabListEntry.Builder
to create aTabListEntry
.- Returns:
TabListEntry
builder
-
-