Categories

Categories can be added to the base command or nested in other categories with the category() method.

Configuration

Category implements option(), category(), printFunc(), saveFunc() and helpFunc() methods in the same way as the base command node.

Example

configBuilder.category((source) -> {
    // CategoryBuilder<FabricClientCommandSource>
    var categoryBuilder = CategoryBuilder.create("category", source);
    categoryBuilder.helpFunc(() -> Text.of("This is a category!"));
    // Category setup

    return categoryBuilder;
});

Result

/example-mod category

Although, this category doesn't have any other nodes and will throw an exception upon running the command.

Last updated