crwdns139649:0crwdne139649:0

Warning

crwdns139651:0crwdne139651:0

crwdns139653:0crwdne139653:0

crwdns139655:0:javadoc:crwdnd139655:0{PlaceholderParsers}crwdnd139655:0:javadoc:crwdne139655:0

Sponge.getRegistry().getType(PlaceholderParser.class, id);

Tip

crwdns139657:0crwdne139657:0

crwdns139659:0crwdne139659:0

crwdns139661:0:javadoc:crwdnd139661:0:javadoc:crwdnd139661:0:javadoc:crwdnd139661:0:javadoc:crwdne139661:0

crwdns139663:0crwdne139663:0

  • crwdns139665:0:javadoc:crwdnd139665:0:javadoc:crwdne139665:0

  • crwdns139667:0crwdne139667:0

crwdns139669:0:javadoc:crwdne139669:0

crwdns139671:0crwdne139671:0

Player player = ...;

// We know this exists
PlaceholderParser parser = PlaceholderParsers.NAME;
PlaceholderContext context = PlaceholderContext.builder()
    .associatedObject(player)
    .build();
Component text = parser.parse(context);

crwdns139673:0crwdne139673:0

crwdns139675:0crwdne139675:0

crwdns139677:0:javadoc:crwdnd139677:0:javadoc:crwdne139677:0

crwdns139679:0:javadoc:crwdne139679:0

crwdns139681:0crwdne139681:0

PlaceholderComponent placeholderText = PlaceholderComponent.builder().context(context).parser(parser).build();
Component result = Component.text("Hello! Your name is ")
    .append(placeholderText)
    .append(Component.text("!"));

crwdns139683:0crwdne139683:0

Note

crwdns139685:0:javadoc:crwdne139685:0