8000 Subcommand information should be available at runtime · Issue #313 · CommandAPI/CommandAPI · GitHub
[go: up one dir, main page]

Skip to content < 8000 react-partial partial-name="keyboard-shortcuts-dialog" data-ssr="false" data-attempted-ssr="false" data-react-profiling="false" >
Subcommand information should be available at runtime #313
Closed
@JorelAli

Description

@JorelAli

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestimplemented for next releaseThis has been implemented in the current dev build for the next public release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0