crwdns139373:0crwdne139373:0

Warning

crwdns139375:0crwdne139375:0

crwdns139377:0crwdne139377:0

crwdns139379:0:javadoc:crwdnd139379:0:javadoc:crwdne139379:0

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

TabList tablist = player.getTabList();

crwdns139381:0crwdne139381:0

import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;

tablist.setHeader(Component.text("The tab list header", NamedTextColor.GOLD));
tablist.setFooter(Component.text("The tab list footer", NamedTextColor.RED));

crwdns139383:0:javadoc:crwdne139383:0

tablist.setHeaderAndFooter(Component.text("header"), Component.text("footer"));

Note

crwdns139385:0:javadoc:crwdnd139385:0:javadoc:crwdne139385:0

crwdns139387:0crwdne139387:0

crwdns139389:0crwdne139389: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);

crwdns139391:0:javadoc:crwdnd139391:0:javadoc:crwdnd139391:0:javadoc:crwdnd139391:0:doc:crwdnd139391:0:javadoc:crwdne139391:0

crwdns139393:0crwdne139393:0

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

crwdns139395:0:javadoc:crwdnd139395:0:javadoc:crwdne139395:0

crwdns139397:0crwdne139397:0

crwdns139399:0:javadoc:crwdne139399:0

import java.util.Optional;

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

crwdns139401:0crwdne139401:0

entry.setDisplayName(Component.text("Pretender Spongie"));
entry.setLatency(1000);
entry.setGameMode(GameModes.SPECTATOR);

crwdns139403:0:javadoc:crwdne139403:0

crwdns139405:0:javadoc:crwdne139405:0