Tablist
Namespace Mc.Scripting · Kind class (sealed)
public sealed class TablistThe tab list as one viewer sees it: the name, order, latency and game mode of each player in the list, the header and footer, fake entries (extra slots with their own name and skin) and the objectives shown in the list or under the names. Every change is seen by the viewer only. What a plugin sets is restored and removed when the plugin unloads. Reach it as plugin.Tablist. Call from the tick thread.
Methods
Section titled “Methods”| Member | Description |
|---|---|
AddFakeEntry |
Adds a fake entry: an extra row of the tab list with its own name and skin, for one viewer. |
void Header(Player viewer, Component? header, Component? footer) |
Sets the header and footer of the tab list for one viewer. |
void RemoveFakeEntry(Player viewer, Guid slotId) |
Removes a fake entry added with Tablist.AddFakeEntry. |
void RemoveObjective(Player viewer, string name) |
Removes an objective of one viewer, with its scores. |
void ResetScore(Player viewer, string objective, string holder) |
Removes one holder’s score from an objective of one viewer. |
void Restore(Player viewer, Player target) |
Puts back the server’s own tab values of one player for one viewer (name, listed, order, latency and game mode), whoever set them. |
void Set(Player viewer, Player target, TabEntry entry) |
Changes how one viewer sees one player in the tab list. |
void SetObjective(Player viewer, int slot, string name, Component title) |
Defines an objective for one viewer: slot 0 is the tab list (the value after each name), slot 2 is below the name. |
SetScore |
Sets one holder’s score on an objective of one viewer. |
AddFakeEntry
Section titled “AddFakeEntry”public void AddFakeEntry(Player viewer, Guid slotId, string name, string? skinValue, string? skinSignature, int latency, int order, Component? display, bool hat)Adds a fake entry: an extra row of the tab list with its own name and skin, for one viewer.
Parameters
| Name | Type | Description |
|---|---|---|
viewer |
Player |
The player who sees it. |
slotId |
Guid |
The entry’s id; use it to remove the entry again. |
name |
string |
The name shown: 1 to 16 printable ASCII characters, no space. |
skinValue |
string? |
The skin texture value, or null or empty for no skin. |
skinSignature |
string? |
The skin signature, or null or empty for an unsigned skin. |
latency |
int |
The latency shown, in milliseconds (0 to 60000). |
order |
int |
The order in the list (lower first). |
display |
Component? |
The text shown instead of the name, or null for none. |
hat |
bool |
Whether the skin’s hat layer is shown. |
Header
Section titled “Header”public void Header(Player viewer, Component? header, Component? footer)Sets the header and footer of the tab list for one viewer. Null (or an empty component) is no header or footer.
Parameters
| Name | Type | Description |
|---|---|---|
viewer |
Player |
The player who sees them. |
header |
Component? |
The header text. |
footer |
Component? |
The footer text. |
RemoveFakeEntry
Section titled “RemoveFakeEntry”public void RemoveFakeEntry(Player viewer, Guid slotId)Removes a fake entry added with Tablist.AddFakeEntry.
Parameters
| Name | Type | Description |
|---|---|---|
viewer |
Player |
The player who sees it. |
slotId |
Guid |
The entry’s id. |
RemoveObjective
Section titled “RemoveObjective”public void RemoveObjective(Player viewer, string name)Removes an objective of one viewer, with its scores.
Parameters
| Name | Type | Description |
|---|---|---|
viewer |
Player |
The player who sees it. |
name |
string |
The objective name. |
ResetScore
Section titled “ResetScore”public void ResetScore(Player viewer, string objective, string holder)Removes one holder’s score from an objective of one viewer.
Parameters
| Name | Type | Description |
|---|---|---|
viewer |
Player |
The player who sees it. |
objective |
string |
The objective name. |
holder |
string |
The holder. |
Restore
Section titled “Restore”public void Restore(Player viewer, Player target)Puts back the server’s own tab values of one player for one viewer (name, listed, order, latency and game mode), whoever set them.
Parameters
| Name | Type | Description |
|---|---|---|
viewer |
Player |
The player who sees the list. |
target |
Player |
The player in the list. |
public void Set(Player viewer, Player target, TabEntry entry)Changes how one viewer sees one player in the tab list. A field left null keeps what it was.
Parameters
| Name | Type | Description |
|---|---|---|
viewer |
Player |
The player who sees the change. |
target |
Player |
The player in the list. |
entry |
TabEntry |
The fields to change. |
SetObjective
Section titled “SetObjective”public void SetObjective(Player viewer, int slot, string name, Component title)Defines an objective for one viewer: slot 0 is the tab list (the value after each name), slot 2 is below the name.
Parameters
| Name | Type | Description |
|---|---|---|
viewer |
Player |
The player who sees it. |
slot |
int |
0 for the tab list, 2 for below the name. |
name |
string |
The objective name: 1 to 16 printable ASCII characters, no space. |
title |
Component |
The title. |
SetScore
Section titled “SetScore”public void SetScore(Player viewer, string objective, string holder, int score, Component? display, ScoreFormat format, Component? fixedFormat)Sets one holder’s score on an objective of one viewer.
Parameters
| Name | Type | Description |
|---|---|---|
viewer |
Player |
The player who sees it. |
objective |
string |
The objective name (defined for this viewer). |
holder |
string |
The holder: a player name or any text of 1 to 40 bytes. |
score |
int |
The score. |
display |
Component? |
The text shown instead of the name, or null for none. |
format |
ScoreFormat |
How the number is shown. |
fixedFormat |
Component? |
The text shown instead of the number; needed with ScoreFormat.Fixed. |
See also
Section titled “See also”Component · Player · ScoreFormat · TabEntry