Hey. I feel a bit stupid asking this, but I can’t find any good examples of how to add an optional flag to the rest of your command arguments.
Currently, I have this CommandSpec:
CommandSpec banSpec = CommandSpec.builder()
.arguments(
GenericArguments.onlyOne(GenericArguments.string(Text.of("player"))),
GenericArguments.optional(GenericArguments.remainingJoinedStrings(Text.of("reason"))),
GenericArguments.flags().flag("-ip", "i").buildWith(GenericArguments.none()))
.executor(new Command())
.build();
The expected behaviour: if “-i” is specified in the command arguments, args.hasAny("i")
will return true
. This doesn’t happen. Thanks for your help.