[CommandSpec] Issue using default executor

As it is, if you execute a command and no matching sub-commands are found, the main executor is (theoretically) called. However, if I have a setup like this, it does not seem to be the case. I have one main command, “/warp”, and 3 sub-commands, '/warp list", “/warp set”, and “/warp delete”. However, if I attempt to use “/warp mywarp”, I expect it to use the default executor. This is apparently not the case, as the output I get is: “Input command mywarp was not a valid subcommand”, and then it gives me the usage of /warp. I have tried to resolve this issue multiple times, and I have been repeatedly assured that this works. Any ideas?

Note: I am on Forge build 1371 and Sponge build 438, as recommended

Could you post this as an issue via GitHub?

I tried to re-open my existing issue, but see the comments disproving my claim (I don’t mean that negatively at all)

your existing issue isn’t matching the issue you’re describing here.

the issue you opened previously mentioned that children were not returning back to the default executor, not that the error message still popped up before throwing back to the executor. reopening your existing issue would not be appropriate, as it would be “out of scope” of the issue.

tl;dr go make a new issue; your old one isn’t related

I suppose you’re right… reading the original issue I see that now.

EDIT: Made the issue

You have to properly specify the arguments to be accepted by the command. In your case, that would be something like firstParsing(subCommands, warp(t(“warp”))), where warp is a custom CommandElement you write that matches against stored warps.

I’m not sure why you would be passing in subCommands to firstParsing, and firstParsing only takes a List of CommandElements, and subCommands is a Map. Could you explain?

EDIT: I did as you suggested, creating a custom CommandElement… the new code looks like:

setArguments(GenericArguments.firstParsing(new WarpCommandElement(Texts.of("warp"))))

but even this yields the same results (it doesn’t even appear the parseValue() method is being called).

I am having the same issue! Any lucky finding out how to fix it?