crwdns20038:0crwdne20038:0

crwdns42101:0crwdne42101:0

crwdns20040:0:javadoc:crwdnd20040:0:javadoc:crwdne20040:0

import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.entity.living.player.tab.TabList;

TabList tablist = player.getTabList();

crwdns20041:0crwdne20041:0

import org.spongepowered.api.text.Text;
import org.spongepowered.api.text.format.TextColors;

tablist.setHeader(Text.of(TextColors.GOLD, "The tab list header"));
tablist.setFooter(Text.of(TextColors.RED, "The tab list footer"));

crwdns20042:0:javadoc:crwdne20042:0

tablist.setHeaderAndFooter(Text.of("header"), Text.of("footer"));

Note

crwdns20043:0:javadoc:crwdnd20043:0:javadoc:crwdne20043:0

crwdns20044:0crwdne20044:0

crwdns20045:0crwdne20045:0

import org.spongepowered.api.entity.living.player.gamemode.GameModes;
import org.spongepowered.api.entity.living.player.tab.TabListEntry;
import org.spongepowered.api.profile.GameProfile;

TabListEntry entry = TabListEntry.builder()
    .list(tablist)
    .gameMode(GameModes.SURVIVAL)
    .profile(gameProfile)
    .build();
tablist.addEntry(entry);

crwdns42624:0:javadoc:crwdnd42624:0:javadoc:crwdnd42624:0:javadoc:crwdnd42624:0:doc:crwdnd42624:0:javadoc:crwdne42624:0

crwdns20047:0crwdne20047:0

TabListEntry entry = TabListEntry.builder()
    .list(tablist)
    .displayName(Text.of("Spongie"))
    .latency(0)
    .profile(gameProfile)
    .build();
tablist.addEntry(entry);

crwdns20048:0:javadoc:crwdnd20048:0:javadoc:crwdne20048:0

crwdns20049:0crwdne20049:0

crwdns20050:0:javadoc:crwdne20050:0

import java.util.Optional;

Optional<TabListEntry> optional = tablist.getEntry(uuid);
if (optional.isPresent()) {
    TabListEntry entry = optional.get();
}

crwdns20051:0crwdne20051:0

entry.setDisplayName(Text.of("Pretender Spongie"));
entry.setLatency(1000);
entry.setGameMode(GameModes.SPECTATOR);

crwdns42625:0:javadoc:crwdne42625:0

crwdns20053:0:javadoc:crwdne20053:0