crwdns130513:0crwdne130513:0
crwdns130515:0crwdne130515:0
crwdns130517:0:javadoc:crwdnd130517:0:javadoc:crwdne130517:0
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.entity.living.player.tab.TabList;
TabList tablist = player.getTabList();
crwdns130519:0crwdne130519: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"));
crwdns130521:0:javadoc:crwdne130521:0
tablist.setHeaderAndFooter(Text.of("header"), Text.of("footer"));
Note
crwdns130523:0:javadoc:crwdnd130523:0:javadoc:crwdne130523:0
crwdns130525:0crwdne130525:0
crwdns130527:0crwdne130527: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);
crwdns130529:0:javadoc:crwdnd130529:0:javadoc:crwdnd130529:0:javadoc:crwdnd130529:0:doc:crwdnd130529:0:javadoc:crwdne130529:0
crwdns130531:0crwdne130531:0
TabListEntry entry = TabListEntry.builder()
.list(tablist)
.displayName(Text.of("Spongie"))
.latency(0)
.profile(gameProfile)
.build();
tablist.addEntry(entry);
crwdns130533:0:javadoc:crwdnd130533:0:javadoc:crwdne130533:0
crwdns130535:0crwdne130535:0
crwdns130537:0:javadoc:crwdne130537:0
import java.util.Optional;
Optional<TabListEntry> optional = tablist.getEntry(uuid);
if (optional.isPresent()) {
TabListEntry entry = optional.get();
}
crwdns130539:0crwdne130539:0
entry.setDisplayName(Text.of("Pretender Spongie"));
entry.setLatency(1000);
entry.setGameMode(GameModes.SPECTATOR);
crwdns130541:0:javadoc:crwdne130541:0
crwdns130543:0:javadoc:crwdne130543:0