@Arg Argument
The @Arg
annotation in the LiteCommands framework is used to define command method parameters that represent required arguments. Arguments are essential pieces of information that the user must provide when invoking a command. The @Arg
annotation helps structure and validate these inputs within the command method.
Usage
The @Arg
annotation is applied to parameters within a command method that represent required arguments. Here is an example of how to use the @Arg
annotation:
/give <player> <type> <amount>
In this example:
@Arg Player
target represents a required argument for a player.@Arg Item
item represents a required argument for an item.@Arg int
amount represents a required argument for an integer value.
Example
Let's consider the following command usage:
In this case, the target
parameter will represent the player "JohnDoe," the item
parameter will represent the material DIAMOND, and the amount
parameter will represent the integer value 3.