Args

object Args

Safe access to a command callback's argument array. A command trigger's value is a string[], but JS-style indexing (args[0], args.length) isn't guaranteed by the bytecode compiler — these helpers are plain method calls, which always compile cleanly.

Jim.register(Event.COMMAND, (args) => {
if (Args.count(args) >= 1) ChatLib.chat("hi " + Args.get(args, 0));
}).setName("greet");

Functions

Link copied to clipboard
fun count(args: Any?): Int

Number of arguments passed to the command.

Link copied to clipboard
fun get(args: Any?, index: Int): String

The argument at index, or "" if out of range.