@Contract(pure = true)
  @ScopedComponentOverrideNotRequired
  default @NotNull Component replaceText(final @NotNull TextReplacementConfig config) {
    requireNonNull(config, "replacement");
    if (!(config instanceof TextReplacementConfigImpl)) {
      throw new IllegalArgumentException("Provided replacement was a custom TextReplacementConfig implementation, which is not supported.");
    }
    return TextReplacementRenderer.INSTANCE.render(this, ((TextReplacementConfigImpl) config).createState());
  }
Finds and replaces any text with this or child {@link Component}s using the provided options.

@param config the replacement config
@return a modified copy of this component
@since 4.2.0
api/src/main/java/net/kyori/adventure/text/Component.java