Sending multiple commands

Discussion in 'Plugin Development' started by javoris767, Mar 26, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    javoris767

    Hello guys, I'm trying to execute multiple commands from a list and the commands are located in the config. I think only 1 command works.

    Code:
            // Custom Commands
            List<String> commands = new ArrayList<String>();
            if(_plugin.getConfig().getBoolean("VoteSQL.onVote.commandsEnabled") == true)
            {
                commands = _plugin.getConfig().getStringList("VoteSQL.onVote.Commands");
                for (String command : commands) {
                    if(command.contains("%p")) {
                        command = command.replace("%p", player.getName());
                    }
                    command = Functions.formatMessage(command, vote);
                    Bukkit.dispatchCommand(Bukkit.getConsoleSender(), command);
    Then I have a config.yml preset.
    Commands:
    - give %p diamond 2
    - say %p voted!!!
     
  2. Offline

    Nitnelave

    Which command works and which doesn't? Are you sure the indentation is right in your YAML file?
     
Thread Status:
Not open for further replies.

Share This Page