@Join
To concatenate multiple arguments into a single string, use the @Join
annotation.
@Command(name = "ban")
public class BanCommand {
@Execute
void ban(@Arg Player target, @Join String reason) {
// Command implementation
}
}
Let's consider the following command usage:
Additional Options
Sometimes you may want to limit the number of arguments that will be joined.
@Join(limit = 2)
Or you may want to join arguments with a different separator.
@Join(separator = ", ")
Or both:
@Command(name = "ban")
public class BanCommand {
@Execute
public void ban(
@Arg Player target,
@Join(limit = 10, separator = "-") String reason
) {
// Command implementation
}
}
Now, our result will be: