Interface TabListEntry
-
public interface TabListEntryRepresents a single entry in aTabList.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTabListEntry.BuilderRepresents a builder which createsTabListEntrys.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static TabListEntry.Builderbuilder()Returns aTabListEntry.Builderto create aTabListEntry.@Nullable ComponentdisplayName()Returns an optional textComponent, which if present is the text displayed forthisentry in theTabList, otherwiseGameProfile.name()is shown.intgameMode()Gets the game modethisentry has been set to.GameProfilegameProfile()Returns theGameProfileof 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.TabListparent()intping()Returns the latency forthisentry.TabListEntrysetDisplayName(@Nullable Component displayName)TabListEntrysetGameMode(int gameMode)Sets the game mode forthisentry to the specified value.TabListEntrysetPing(int latency)Sets the latency forthisentry to the specified value.
-
-
-
Method Detail
-
gameProfile
GameProfile gameProfile()
Returns theGameProfileof 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:
GameProfileof the entry
-
displayName
@Nullable Component displayName()
Returns an optional textComponent, which if present is the text displayed forthisentry in theTabList, otherwiseGameProfile.name()is shown.- Returns:
- text
Componentof name displayed in the tab list
-
setDisplayName
TabListEntry setDisplayName(@Nullable Component displayName)
Sets the textComponentto be displayed forthisTabListEntry. Ifnull,GameProfile.name()will be shown.- Parameters:
displayName- to show in theTabListforthisentry- Returns:
this, for chaining
-
ping
int ping()
Returns the latency forthisentry.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
thisentry
-
setPing
TabListEntry setPing(int latency)
Sets the latency forthisentry to the specified value.- Parameters:
latency- to changed to- Returns:
this, for chaining- See Also:
ping()
-
gameMode
int gameMode()
Gets the game modethisentry 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 forthisentry to the specified value.- Parameters:
gameMode- to change to- Returns:
this, for chaining- See Also:
gameMode()
-
builder
static TabListEntry.Builder builder()
Returns aTabListEntry.Builderto create aTabListEntry.- Returns:
TabListEntrybuilder
-
-