Interface MiniMessage.Builder

All Superinterfaces:
AbstractBuilder<MiniMessage>
Enclosing interface:
MiniMessage

public static interface MiniMessage.Builder extends AbstractBuilder<MiniMessage>
A builder for MiniMessage.
Since:
4.10.0
  • Method Details

    • tags

      @NotNull @NotNull MiniMessage.Builder tags(@NotNull @NotNull TagResolver tags)
      Set the known tags to the provided tag resolver.

      This resolver determines the base set of tags known to this MiniMessage instance. Any resolvers passed to the MiniMessage.deserialize(String, TagResolver) method will override this resolver.

      Parameters:
      tags - the tag resolver to use
      Returns:
      this builder
      Since:
      4.10.0
    • editTags

      @NotNull @NotNull MiniMessage.Builder editTags(@NotNull @NotNull Consumer<TagResolver.Builder> adder)
      Add to the set of known tags this MiniMessage instance can use.
      Parameters:
      adder - a function operating on a builder containing currently known tags
      Returns:
      this builder
      Since:
      4.10.0
    • strict

      @NotNull @NotNull MiniMessage.Builder strict(boolean strict)
      Enables strict mode (disabled by default).

      By default, MiniMessage will allow child-allowing tags to be implicitly closed. When strict mode is enabled, all child-allowing tags which are <opened> must be explicitly </closed> as well.

      Additionally, the reset tag is disabled in this mode. Any usage of this tag will throw a parser exception if strict mode is enabled.

      Parameters:
      strict - if strict mode should be enabled
      Returns:
      this builder
      Since:
      4.10.0
    • debug

      @NotNull @NotNull MiniMessage.Builder debug(@Nullable @Nullable Consumer<String> debugOutput)
      Print debug information to the given output (disabled by default).

      Debug output includes detailed information about the parsing process to help debug parser behavior.

      The consumer will receive line fragments terminated by LF, not complete lines. This avoids string concatenation within debug output generation. If the consumer is null, no debug information will be generated.

      Parameters:
      debugOutput - if debug mode should be enabled
      Returns:
      this builder
      Since:
      4.10.0
    • postProcessor

      @NotNull @NotNull MiniMessage.Builder postProcessor(@NotNull @NotNull UnaryOperator<Component> postProcessor)
      Specify a function that takes the component at the end of the parser process.

      By default, this compacts the resulting component with Component.compact().

      Parameters:
      postProcessor - method run at the end of parsing
      Returns:
      this builder
      Since:
      4.10.0
    • preProcessor

      @NotNull @NotNull MiniMessage.Builder preProcessor(@NotNull @NotNull UnaryOperator<String> preProcessor)
      Specify a function that takes the string at the start of the parser process.

      By default, this does absolutely nothing.

      Parameters:
      preProcessor - method run at the start of parsing
      Returns:
      this builder
      Since:
      4.11.0
    • build

      @NotNull @NotNull MiniMessage build()
      Builds the serializer.
      Specified by:
      build in interface AbstractBuilder<MiniMessage>
      Returns:
      the built serializer
      Since:
      4.10.0