JorelAli/CommandAPI

Subcommand information should be available at runtime

JorelAli opened this issue · 1 comments

Description

Commands with subcommands lose all of their subcommand information once the command is registered. This should be made accessible for runtime use.

Expected code

If you have this code:

CommandAPICommand main = null;
main = new CommandAPICommand("main")
	.executes((sender, args) -> {
		System.out.println(main.getSubcommands().size());
	});

CommandAPICommand sub = new CommandAPICommand("sub")
	.executes((sender, args) -> {
		System.out.println("Subcommand called");
	});

main.withSubcommand(sub);
main.register();

Then running /main should print 1.

Extra details

No response

Fixed in 8.5.1.