#ACF doubts

1 messages · Page 1 of 1 (latest)

fringe cargo
#
@Subcommand("givepoints")
    public void onGivePoints(CommandSender sender, Player player, int amount){
        sender.sendMessage("The player " + player.getName() + " has received " + amount + " points!");
    }
#

I'm trying to implement this subcommand which usage is /test givepoints [player] <amount> but for some reason when I try to use this command inside the game the parameters [player] and [amount] are inverted. The command just work if I type /test givepoints <amount> [player]

#

and when I try to type it in the correct order a message appears indicating the correct syntax, even though I'm already using the correct syntax for the command.

#

"Usage: /test givepoints [player] <amount>"

#

Does anyone know what might be wrong?

gilded cloak
#

Use OnlinePlayer

#

Not Player

#

Not sure if that would cause that issue though

fringe cargo
#

I just tested it and it solved my problem, thank you