Class MessageArgument
java.lang.Object
net.minecraft.commands.arguments.MessageArgument
- All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<MessageArgument.Message>, SignedArgument<MessageArgument.Message>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Collection<String> private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static CompletableFuture<FilteredText> filterPlainText(CommandSourceStack sender, PlayerChatMessage message) static ComponentgetMessage(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, String name) static MessageArgumentmessage()parse(com.mojang.brigadier.StringReader reader) parse(com.mojang.brigadier.StringReader reader, @Nullable S source) static voidresolveChatMessage(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, String name, Consumer<PlayerChatMessage> task) private static voidresolveDisguisedMessage(Consumer<PlayerChatMessage> task, CommandSourceStack sender, PlayerChatMessage argument) private static voidresolveSignedMessage(Consumer<PlayerChatMessage> task, CommandSourceStack sender, PlayerChatMessage signedArgument) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mojang.brigadier.arguments.ArgumentType
listSuggestions
-
Field Details
-
EXAMPLES
-
TOO_LONG
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType TOO_LONG
-
-
Constructor Details
-
MessageArgument
public MessageArgument()
-
-
Method Details
-
message
-
getMessage
public static Component getMessage(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, String name) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
resolveChatMessage
public static void resolveChatMessage(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, String name, Consumer<PlayerChatMessage> task) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
resolveSignedMessage
private static void resolveSignedMessage(Consumer<PlayerChatMessage> task, CommandSourceStack sender, PlayerChatMessage signedArgument) -
resolveDisguisedMessage
private static void resolveDisguisedMessage(Consumer<PlayerChatMessage> task, CommandSourceStack sender, PlayerChatMessage argument) -
filterPlainText
private static CompletableFuture<FilteredText> filterPlainText(CommandSourceStack sender, PlayerChatMessage message) -
parse
public MessageArgument.Message parse(com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parsein interfacecom.mojang.brigadier.arguments.ArgumentType<MessageArgument.Message>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parse
public <S> MessageArgument.Message parse(com.mojang.brigadier.StringReader reader, @Nullable S source) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Specified by:
parsein interfacecom.mojang.brigadier.arguments.ArgumentType<MessageArgument.Message>- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getExamples
- Specified by:
getExamplesin interfacecom.mojang.brigadier.arguments.ArgumentType<MessageArgument.Message>
-