Advance config.yml question

Discussion in 'Plugin Development' started by Giorgio, Dec 8, 2012.

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

    Giorgio

    Hello, How would i be able to store more than one variable per command. For instance if a player type /friend john, they would friend him. Then if they do /friend bob. It will add it to the list and not delete johns data. How would I be able to do so?
     
  2. Offline

    gomeow

    Could you explain more?
     
  3. Offline

    bryce325

    I believe you just want to save the List.
     
  4. Offline

    chaseoes Retired Staff

    Code:
    List<String> friends = getConfig().getStringList("friends." + cs.getName());
    friends.add(args[0]);
    getConfig().set("friends." + cs.getName(), friends);
     
    ZeusAllMighty11 likes this.
  5. Offline

    Giorgio

    chaseoes

    Ok, and for the argument "cs" what does is this? player?
     
  6. Offline

    gomeow

    yes, a player
     
  7. Offline

    chaseoes Retired Staff

    I used it as a CommandSender since I assumed this was going in a command.
     
Thread Status:
Not open for further replies.

Share This Page