Adding String to StringList via Command

Discussion in 'Plugin Development' started by drillzy, Apr 27, 2017.

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

    drillzy

    Hello guys today i would like to ask how would i make it so when i do a command, say /jokesubmit <msg> it would add that <msg> to the StringList in config. Here is my code so far:

    Code:
    
    if(args.length >= 2 && args[0].equalsIgnoreCase("jokesubmit")) {
    
    
              getConfig().getStringList("Jokes").add(args[1]);
    
                p.sendMessage(ChatColor.translateAlternateColorCodes('&', "JokeSubmitMsg"));
    
    }
    
     
  2. Offline

    xXkguyXx

    Code:
    String message = StringUtils.join(args, ' ', 2);
    
    Something like that, I didnt do this in an IDE, so I'm not to sure, But after you could just store the String message in the config
     
Thread Status:
Not open for further replies.

Share This Page