Class CommandUtils
java.lang.Object
net.neoforged.neoforge.server.command.CommandUtils
Utility class for various command-related operations.
For modders and NeoForge to both use.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Optional<ResourceKey<T>> getResourceKey(CommandContext<CommandSourceStack> ctx, String name, ResourceKey<Registry<T>> registryKey) static MutableComponentstatic MutableComponentmakeTranslatableWithFallback(String key, Object... args) static <T extends Registry<?>>
SuggestionProvider<CommandSourceStack> suggestFromRegistry(Function<Registry<?>, Iterable<Identifier>> namesFunction, String argumentString, ResourceKey<Registry<T>> registryKey) static CompletableFuture<Suggestions> suggestRegistries(CommandContext<CommandSourceStack> ctx, SuggestionsBuilder builder)
-
Constructor Details
-
CommandUtils
private CommandUtils()
-
-
Method Details
-
suggestRegistries
public static CompletableFuture<Suggestions> suggestRegistries(CommandContext<CommandSourceStack> ctx, SuggestionsBuilder builder) -
suggestFromRegistry
public static <T extends Registry<?>> SuggestionProvider<CommandSourceStack> suggestFromRegistry(Function<Registry<?>, Iterable<Identifier>> namesFunction, String argumentString, ResourceKey<Registry<T>> registryKey) -
getResourceKey
public static <T> Optional<ResourceKey<T>> getResourceKey(CommandContext<CommandSourceStack> ctx, String name, ResourceKey<Registry<T>> registryKey) -
makeTranslatableWithFallback
-
makeTranslatableWithFallback
-