Class Commands
java.lang.Object
net.minecraft.commands.Commands
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ClientboundCommandsPacket.NodeInspector<CommandSourceStack> static final Stringprivate static final ThreadLocal<@Nullable ExecutionContext<CommandSourceStack>> private final com.mojang.brigadier.CommandDispatcher<CommandSourceStack> static final PermissionCheckstatic final PermissionCheckstatic final PermissionCheckstatic final PermissionCheckstatic final PermissionCheckprivate static final org.slf4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptionCommands(Commands.CommandSelection commandSelection, CommandBuildContext context) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> com.mojang.brigadier.builder.RequiredArgumentBuilder<CommandSourceStack, T> Creates a new argument.static CommandSourceStackcreateCompilationContext(PermissionSet compilationPermissions) static CommandBuildContextcreateValidationContext(HolderLookup.Provider registries) static voidexecuteCommandInContext(CommandSourceStack context, Consumer<ExecutionContext<CommandSourceStack>> config) private static <S> voidfillUsableCommands(com.mojang.brigadier.tree.CommandNode<S> source, com.mojang.brigadier.tree.CommandNode<S> target, S commandFilter, Map<com.mojang.brigadier.tree.CommandNode<S>, com.mojang.brigadier.tree.CommandNode<S>> converted) private static @Nullable com.mojang.brigadier.context.ContextChain<CommandSourceStack> finishParsing(com.mojang.brigadier.ParseResults<CommandSourceStack> command, String commandString, CommandSourceStack sender) com.mojang.brigadier.CommandDispatcher<CommandSourceStack> static <S> @Nullable com.mojang.brigadier.exceptions.CommandSyntaxExceptiongetParseException(com.mojang.brigadier.ParseResults<S> parse) static <T extends PermissionSetSupplier>
PermissionProviderCheck<T> hasPermission(PermissionCheck permission) static com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> Creates a new argument.static <S> com.mojang.brigadier.ParseResults<S> mapSource(com.mojang.brigadier.ParseResults<S> parse, UnaryOperator<S> sourceOperator) voidperformCommand(com.mojang.brigadier.ParseResults<CommandSourceStack> command, String commandString) voidperformPrefixedCommand(CommandSourceStack sender, String command) voidsendCommands(ServerPlayer player) static StringtrimOptionalPrefix(String command) static voidvalidate()static <S> voidvalidateParseResults(com.mojang.brigadier.ParseResults<S> command)
-
Field Details
-
COMMAND_PREFIX
- See Also:
-
CURRENT_EXECUTION_CONTEXT
private static final ThreadLocal<@Nullable ExecutionContext<CommandSourceStack>> CURRENT_EXECUTION_CONTEXT -
LOGGER
private static final org.slf4j.Logger LOGGER -
LEVEL_ALL
-
LEVEL_MODERATORS
-
LEVEL_GAMEMASTERS
-
LEVEL_ADMINS
-
LEVEL_OWNERS
-
COMMAND_NODE_INSPECTOR
private static final ClientboundCommandsPacket.NodeInspector<CommandSourceStack> COMMAND_NODE_INSPECTOR -
dispatcher
-
-
Constructor Details
-
Commands
-
-
Method Details
-
mapSource
public static <S> com.mojang.brigadier.ParseResults<S> mapSource(com.mojang.brigadier.ParseResults<S> parse, UnaryOperator<S> sourceOperator) -
performPrefixedCommand
-
trimOptionalPrefix
-
performCommand
public void performCommand(com.mojang.brigadier.ParseResults<CommandSourceStack> command, String commandString) -
finishParsing
private static @Nullable com.mojang.brigadier.context.ContextChain<CommandSourceStack> finishParsing(com.mojang.brigadier.ParseResults<CommandSourceStack> command, String commandString, CommandSourceStack sender) -
executeCommandInContext
public static void executeCommandInContext(CommandSourceStack context, Consumer<ExecutionContext<CommandSourceStack>> config) -
sendCommands
-
fillUsableCommands
private static <S> void fillUsableCommands(com.mojang.brigadier.tree.CommandNode<S> source, com.mojang.brigadier.tree.CommandNode<S> target, S commandFilter, Map<com.mojang.brigadier.tree.CommandNode<S>, com.mojang.brigadier.tree.CommandNode<S>> converted) -
literal
public static com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> literal(String literal) Creates a new argument. Intended to be imported statically. The benefit of this over the brigadierLiteralArgumentBuilder.literalmethod is that it is typed toCommandSource. -
argument
public static <T> com.mojang.brigadier.builder.RequiredArgumentBuilder<CommandSourceStack, T> argument(String name, com.mojang.brigadier.arguments.ArgumentType<T> type) Creates a new argument. Intended to be imported statically. The benefit of this over the brigadierRequiredArgumentBuilder.argument(String, ArgumentType)method is that it is typed toCommandSource. -
createValidator
-
getDispatcher
-
validateParseResults
public static <S> void validateParseResults(com.mojang.brigadier.ParseResults<S> command) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getParseException
public static <S> @Nullable com.mojang.brigadier.exceptions.CommandSyntaxException getParseException(com.mojang.brigadier.ParseResults<S> parse) -
createValidationContext
-
validate
public static void validate() -
hasPermission
public static <T extends PermissionSetSupplier> PermissionProviderCheck<T> hasPermission(PermissionCheck permission) -
createCompilationContext
-