Interface MiniMessage
- All Superinterfaces:
ComponentDecoder<String, Component>, ComponentEncoder<Component, String>, ComponentSerializer<Component, Component, String>
This class allows you to serialize and deserialize them, strip or escape them.
- Since:
- 4.10.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA builder forMiniMessage.static enumA variety of presets for configuring MiniMessage. -
Method Summary
Modifier and TypeMethodDescriptionstatic MiniMessage.Builderbuilder()Creates a newMiniMessage.Builder.static MiniMessage.Builderbuilder(MiniMessage.Preset preset) Creates a newMiniMessage.Builderpre-configured for a specific preset.deserialize(String input, Pointered target) Deserializes a string into a component, with a target.deserialize(String input, Pointered target, TagResolver tagResolver) Deserializes a string into a component, with a tag resolver to parse tags of the form<key>and a target.default Componentdeserialize(String input, Pointered target, TagResolver... tagResolvers) Deserializes a string into a component, with tag resolvers to parse tags of the form<key>and a target.deserialize(String input, TagResolver tagResolver) Deserializes a string into a component, with a tag resolver to parse tags of the form<key>.default Componentdeserialize(String input, TagResolver... tagResolvers) Deserializes a string into a component, with tag resolvers to parse tags of the form<key>.deserializeToTree(String input) Deserializes a string into a tree of parsed elements.deserializeToTree(String input, Pointered target) Deserializes a string into a tree of parsed elements, with a target.deserializeToTree(String input, Pointered target, TagResolver tagResolver) Deserializes a string into a tree of parsed elements, with a tag resolver to parse tags of the form<key>and a target.default Node.RootdeserializeToTree(String input, Pointered target, TagResolver... tagResolvers) Deserializes a string into a tree of parsed elements, with a tag resolver to parse tags of the form<key>.deserializeToTree(String input, TagResolver tagResolver) Deserializes a string into a tree of parsed elements, with a tag resolver to parse tags of the form<key>.default Node.RootdeserializeToTree(String input, TagResolver... tagResolvers) Deserializes a string into a tree of parsed elements, with a tag resolver to parse tags of the form<key>.escapeTags(String input) Escapes all known tags in the input message, so that they are ignored in deserialization.escapeTags(String input, TagResolver tagResolver) Escapes all known tags in the input message, so that they are ignored in deserialization.default StringescapeTags(String input, TagResolver... tagResolvers) Escapes all known tags in the input message, so that they are ignored in deserialization.static MiniMessageGets a simple instance with default settings.static MiniMessageminiMessage(MiniMessage.Preset preset) Gets an instance based on a specific preset.booleanstrict()Returns if this MiniMessage instance is in strict mode.Removes all supported tags in the input message.stripTags(String input, TagResolver tagResolver) Removes all known tags in the input message, so that they are ignored in deserialization.default StringstripTags(String input, TagResolver... tagResolvers) Removes all known tags in the input message, so that they are ignored in deserialization.tags()Returns the base tag resolver of this MiniMessage instance.Methods inherited from interface ComponentSerializer
deserialize, deserializeOr, deserializeOrNull, serialize, serializeOr, serializeOrNull
-
Method Details
-
miniMessage
Gets a simple instance with default settings.- Returns:
- a simple instance
- Since:
- 4.10.0
-
miniMessage
Gets an instance based on a specific preset.- Parameters:
preset- the preset to use- Returns:
- an instance
- Since:
- 5.0.0
-
escapeTags
Escapes all known tags in the input message, so that they are ignored in deserialization.Useful for untrusted input.
Only globally known tags will be escaped. Use the overload that takes a
TagResolverif any custom tags should be handled.- Parameters:
input- the input message, with potential tags- Returns:
- the output, with escaped tags
- Since:
- 4.10.0
-
escapeTags
Escapes all known tags in the input message, so that they are ignored in deserialization.Useful for untrusted input.
- Parameters:
input- the input message, with potential tagstagResolver- the tag resolver for any additional tags to handle- Returns:
- the output, with escaped tags
- Since:
- 4.10.0
-
escapeTags
Escapes all known tags in the input message, so that they are ignored in deserialization.Useful for untrusted input.
- Parameters:
input- the input message, with potential tagstagResolvers- a series of tag resolvers to apply extra tags from, last specified taking priority- Returns:
- the output, with escaped tags
- Since:
- 4.10.0
-
stripTags
Removes all supported tags in the input message.Useful for untrusted input.
Only globally known tags will be stripped. Use the overload that takes a
TagResolverif any custom tags should be handled.- Parameters:
input- the input message, with potential tags- Returns:
- the output, without tags
- Since:
- 4.10.0
-
stripTags
Removes all known tags in the input message, so that they are ignored in deserialization.Useful for untrusted input.
- Parameters:
input- the input message, with tagstagResolver- the tag resolver for any additional tags to handle- Returns:
- the output, without tags
- Since:
- 4.10.0
-
stripTags
Removes all known tags in the input message, so that they are ignored in deserialization.Useful for untrusted input.
- Parameters:
input- the input message, with tagstagResolvers- a series of tag resolvers to apply extra tags from, last specified taking priority- Returns:
- the output, without tags
- Since:
- 4.10.0
-
deserialize
-
deserialize
Deserializes a string into a component, with a tag resolver to parse tags of the form<key>.Tags will be resolved from the resolver parameter before the resolver provided in the builder is used.
- Parameters:
input- the input stringtagResolver- the tag resolver for any additional tags to handle- Returns:
- the output component
- Since:
- 4.10.0
-
deserialize
Deserializes a string into a component, with a tag resolver to parse tags of the form<key>and a target.Tags will be resolved from the resolver parameter before the resolver provided in the builder is used.
- Parameters:
input- the input stringtarget- the target of the deserializationtagResolver- the tag resolver for any additional tags to handle- Returns:
- the output component
- Since:
- 4.17.0
-
deserialize
Deserializes a string into a component, with tag resolvers to parse tags of the form<key>.Tags will be resolved from the resolver parameters before the resolver provided in the builder is used.
- Parameters:
input- the input stringtagResolvers- a series of tag resolvers to apply extra tags from, last specified taking priority- Returns:
- the output component
- Since:
- 4.10.0
-
deserialize
Deserializes a string into a component, with tag resolvers to parse tags of the form<key>and a target.Tags will be resolved from the resolver parameters before the resolver provided in the builder is used.
- Parameters:
input- the input stringtarget- the target of the deserializationtagResolvers- a series of tag resolvers to apply extra tags from, last specified taking priority- Returns:
- the output component
- Since:
- 4.17.0
-
deserializeToTree
-
deserializeToTree
Deserializes a string into a tree of parsed elements, with a target. This is intended for inspecting the output of the parser for debugging purposes.- Parameters:
input- the input stringtarget- the target of the deserialization- Returns:
- the root of the resulting tree
- Since:
- 4.17.0
-
deserializeToTree
Deserializes a string into a tree of parsed elements, with a tag resolver to parse tags of the form<key>. This is intended for inspecting the output of the parser for debugging purposes.Tags will be resolved from the resolver parameter before the resolver provided in the builder is used.
- Parameters:
input- the input stringtagResolver- the tag resolver for any additional tags to handle- Returns:
- the root of the resulting tree
- Since:
- 4.10.0
-
deserializeToTree
Deserializes a string into a tree of parsed elements, with a tag resolver to parse tags of the form<key>and a target. This is intended for inspecting the output of the parser for debugging purposes.Tags will be resolved from the resolver parameter before the resolver provided in the builder is used.
- Parameters:
input- the input stringtarget- the target of the deserializationtagResolver- the tag resolver for any additional tags to handle- Returns:
- the root of the resulting tree
- Since:
- 4.17.0
-
deserializeToTree
Deserializes a string into a tree of parsed elements, with a tag resolver to parse tags of the form<key>. This is intended for inspecting the output of the parser for debugging purposes.Tags will be resolved from the resolver parameter before the resolver provided in the builder is used.
- Parameters:
input- the input stringtagResolvers- a series of tag resolvers to apply extra tags from, last specified taking priority- Returns:
- the root of the resulting tree
- Since:
- 4.10.0
-
deserializeToTree
Deserializes a string into a tree of parsed elements, with a tag resolver to parse tags of the form<key>. This is intended for inspecting the output of the parser for debugging purposes.Tags will be resolved from the resolver parameter before the resolver provided in the builder is used.
- Parameters:
input- the input stringtarget- the target of the deserializationtagResolvers- a series of tag resolvers to apply extra tags from, last specified taking priority- Returns:
- the root of the resulting tree
- Since:
- 4.17.0
-
strict
boolean strict()Returns if this MiniMessage instance is in strict mode.- Returns:
- if the instance is in strict mode
- Since:
- 4.15.0
- See Also:
-
tags
TagResolver tags()Returns the base tag resolver of this MiniMessage instance.- Returns:
- the base tag resolver
- Since:
- 4.15.0
-
builder
Creates a newMiniMessage.Builder.- Returns:
- a builder
- Since:
- 4.10.0
-
builder
Creates a newMiniMessage.Builderpre-configured for a specific preset.- Parameters:
preset- the preset- Returns:
- the builder
- Since:
- 5.0.0
-