Class Argument
java.lang.Object
net.kyori.adventure.text.minimessage.translation.Argument
A utility class to create arguments for
translatable components.
This is intended to be used with a MiniMessageTranslator instance to allow for
<name> tags.
Static methods on this class work by creating
virtual components that store data about the argument.
The MiniMessage translator instance detects these virtual components to use the name
provided as tag names to replace the <arg> tag.
As the names provided to all static methods in this class are used to create tags, they must be valid tag names.
- Since:
- 4.20.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentLikeargument(String name, TranslationArgument argument) Creates a named translation argument.static ComponentLikeargument(String name, TranslationArgumentLike argument) Creates a named translation argument.static ComponentLikeCreates a named boolean argument.static ComponentLikecomponent(String name, ComponentLike value) Creates a named component argument.static ComponentLikeCreates a named numeric argument.static ComponentLikeCreates a named string argument.static ComponentLikeCreates a named tag argument.static ComponentLiketagResolver(Iterable<TagResolver> resolvers) Creates an argument used to add arbitrary tag resolvers to the deserialization process.static ComponentLiketagResolver(TagResolver tagResolver) Creates an argument used to add arbitrary tag resolvers to the deserialization process.static ComponentLiketagResolver(TagResolver... resolvers) Creates an argument used to add arbitrary tag resolvers to the deserialization process.static ComponentLikeCreates an argument used to set the target of the deserialization process.
-
Method Details
-
bool
Creates a named boolean argument.- Parameters:
name- the namevalue- the value- Returns:
- the named argument
- Since:
- 4.20.0
-
numeric
Creates a named numeric argument.- Parameters:
name- the namevalue- the value- Returns:
- the named argument
- Since:
- 4.20.0
-
string
Creates a named string argument.- Parameters:
name- the namevalue- the value- Returns:
- the named argument
- Since:
- 4.21.0
-
component
Creates a named component argument.- Parameters:
name- the namevalue- the value- Returns:
- the named argument
- Since:
- 4.20.0
-
argument
Creates a named translation argument.- Parameters:
name- the nameargument- the translation argument- Returns:
- the named argument
- Since:
- 4.20.0
-
argument
Creates a named translation argument.- Parameters:
name- the nameargument- the translation argument- Returns:
- the named argument
- Since:
- 4.20.0
-
tag
Creates a named tag argument.- Parameters:
name- the nametag- the tag- Returns:
- the named argument
- Since:
- 4.20.0
-
tagResolver
Creates an argument used to add arbitrary tag resolvers to the deserialization process.- Parameters:
resolvers- the resolvers- Returns:
- the argument
- Since:
- 4.20.0
-
tagResolver
Creates an argument used to add arbitrary tag resolvers to the deserialization process.- Parameters:
resolvers- the resolvers- Returns:
- the argument
- Since:
- 4.20.0
-
tagResolver
Creates an argument used to add arbitrary tag resolvers to the deserialization process.- Parameters:
tagResolver- the tag resolver- Returns:
- the argument
- Since:
- 4.20.0
-
target
Creates an argument used to set the target of the deserialization process.- Parameters:
target- the target- Returns:
- the argument
- Since:
- 4.20.0
-