crwdns119205:0crwdne119205:0
crwdns119207:0crwdne119207:0
crwdns119209:0crwdne119209:0
crwdns119211:0crwdne119211:0
crwdns119213:0crwdne119213:0
import org.spongepowered.api.text.Text;
Text unformattedText = Text.of("Hey! This is unformatted text!");
crwdns119215:0:ref:crwdne119215:0
crwdns119217:0crwdne119217:0
crwdns119219:0crwdne119219:0
Tip
crwdns119221:0crwdne119221:0
crwdns119223:0crwdne119223:0
crwdns119225:0crwdne119225:0
crwdns119227:0crwdne119227:0
import org.spongepowered.api.text.format.TextColors;
Text coloredText = Text.builder("Woot! Golden text is golden.").color(TextColors.GOLD).build();
crwdns119229:0:javadoc:crwdne119229:0
crwdns119231:0crwdne119231:0
Text multiColoredText = Text.builder("Sponges are ").color(TextColors.YELLOW).append(
Text.builder("invincible!").color(TextColors.RED).build()).build();
crwdns119233:0crwdne119233:0
crwdns119235:0crwdne119235:0
crwdns119237:0crwdne119237:0
import org.spongepowered.api.text.format.TextStyles;
Text styledText = Text.builder("Yay! Styled text!").style(TextStyles.ITALIC).build();
crwdns119239:0crwdne119239:0
crwdns119241:0crwdne119241:0
Text multiStyledText = Text.builder("I'm italicized! ").style(TextStyles.ITALIC)
.append(Text.builder("I'm bold!").style(TextStyles.BOLD).build()).build();
crwdns119243:0crwdne119243:0
crwdns119245:0:javadoc:crwdne119245:0
crwdns119247:0crwdne119247:0
Text colorAndStyleText = Text.of(TextColors.RED, TextStyles.ITALIC, "Shortcuts for the win!");
crwdns119249:0crwdne119249:0
crwdns119251:0:javadoc:crwdne119251:0
crwdns119253:0crwdne119253:0
import org.spongepowered.api.text.action.TextActions;
Text clickableText = Text.builder("Click here!").onClick(TextActions.runCommand("tell Spongesquad I'm ready!")).build();
crwdns119255:0crwdne119255:0
Note
crwdns119257:0:javadoc:crwdne119257:0
Tip
crwdns119259:0crwdne119259:0
crwdns119261:0crwdne119261:0
crwdns119263:0crwdne119263:0
Tip
crwdns119265:0crwdne119265:0
crwdns119267:0:javadoc:crwdne119267:0
crwdns119269:0crwdne119269: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();
crwdns119271:0crwdne119271:0