Class TagsCommand
java.lang.Object
net.neoforged.neoforge.server.command.TagsCommand
The
/neoforge tags command for listing a registry's tags, getting the elements of tags, and querying the tags of a
registry object.
Each command is paginated, showing 8L entries at a time. When there are more than 0 entries,
the text indicating the amount of entries is highlighted and can be clicked to copy the list of all entries (across
all pages) to the clipboard. (This is reflected by the use of green text in brackets, mimicking the clickable
coordinates in the /locate command's message)
The command has three subcommands:
/neoforge tags <registry> list [page]- Lists all available tags in the given registry./neoforge tags <registry> get <tag> [page]- Gets all elements of the given tag in the given registry./neoforge tags <registry> query <element> [page]- Queries for all tags in the given registry which contain the given registry object.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate static final longprivate static final ResourceKey<Registry<Registry<?>>> private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <O> Oprivate static MutableComponentcreateMessage(MutableComponent header, String containsText, String copyHoverText, long count, long currentPage, ChatFormatting elementColor, Supplier<Stream<String>> names) private static intlistTagElements(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) private static intlistTags(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) private static intqueryElementTags(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> register()
-
Field Details
-
CLIPBOARD_TEXT_LIMIT
private static final long CLIPBOARD_TEXT_LIMIT- See Also:
-
PAGE_SIZE
private static final long PAGE_SIZE- See Also:
-
ROOT_REGISTRY_KEY
-
UNKNOWN_REGISTRY
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType UNKNOWN_REGISTRY -
UNKNOWN_TAG
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType UNKNOWN_TAG -
UNKNOWN_ELEMENT
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType UNKNOWN_ELEMENT
-
-
Constructor Details
-
TagsCommand
TagsCommand()
-
-
Method Details
-
register
-
listTags
private static int listTags(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
listTagElements
private static int listTagElements(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
queryElementTags
private static int queryElementTags(com.mojang.brigadier.context.CommandContext<CommandSourceStack> ctx, int page) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
createMessage
private static MutableComponent createMessage(MutableComponent header, String containsText, String copyHoverText, long count, long currentPage, ChatFormatting elementColor, Supplier<Stream<String>> names) -
cast
-