crwdns129975:0crwdne129975:0
crwdns129977:0crwdne129977:0
crwdns129979:0crwdne129979:0
crwdns129981:0crwdne129981:0
crwdns129983:0crwdne129983:0
import org.spongepowered.api.text.Text;
Text unformattedText = Text.of("Hey! This is unformatted text!");
crwdns129985:0:ref:crwdne129985:0
crwdns129987:0crwdne129987:0
crwdns129989:0crwdne129989:0
Tip
crwdns129991:0crwdne129991:0
crwdns129993:0crwdne129993:0
crwdns129995:0crwdne129995:0
crwdns129997:0crwdne129997:0
import org.spongepowered.api.text.format.TextColors;
Text coloredText = Text.builder("Woot! Golden text is golden.").color(TextColors.GOLD).build();
crwdns129999:0:javadoc:crwdne129999:0
crwdns130001:0crwdne130001:0
Text multiColoredText = Text.builder("Sponges are ").color(TextColors.YELLOW).append(
Text.builder("invincible!").color(TextColors.RED).build()).build();
crwdns130003:0crwdne130003:0
crwdns130005:0crwdne130005:0
crwdns130007:0crwdne130007:0
import org.spongepowered.api.text.format.TextStyles;
Text styledText = Text.builder("Yay! Styled text!").style(TextStyles.ITALIC).build();
crwdns130009:0crwdne130009:0
crwdns130011:0crwdne130011:0
Text multiStyledText = Text.builder("I'm italicized! ").style(TextStyles.ITALIC)
.append(Text.builder("I'm bold!").style(TextStyles.BOLD).build()).build();
crwdns130013:0crwdne130013:0
crwdns130015:0:javadoc:crwdne130015:0
crwdns130017:0crwdne130017:0
Text colorAndStyleText = Text.of(TextColors.RED, TextStyles.ITALIC, "Shortcuts for the win!");
crwdns130019:0crwdne130019:0
crwdns130021:0:javadoc:crwdne130021:0
crwdns130023:0crwdne130023:0
import org.spongepowered.api.text.action.TextActions;
Text clickableText = Text.builder("Click here!").onClick(TextActions.runCommand("tell Spongesquad I'm ready!")).build();
crwdns130025:0crwdne130025:0
Note
crwdns130027:0:javadoc:crwdne130027:0
Tip
crwdns130029:0crwdne130029:0
crwdns130031:0crwdne130031:0
crwdns130033:0crwdne130033:0
Tip
crwdns130035:0crwdne130035:0
crwdns130037:0:javadoc:crwdne130037:0
crwdns130039:0crwdne130039:0
import org.spongepowered.api.text.selector.Selector;
Text adventurers = Text.builder("These players are in adventure mode: ").append(
Text.of(Selector.parse("@a[m=2]"))
).build();
crwdns130041:0crwdne130041:0