How to make commands edit config files?

Discussion in 'Plugin Development' started by MeZTech, Oct 14, 2012.

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

    MeZTech

    I want to make one of my commands edit text in the config.yml that another command will list. So I want the command /addwanted (Player) to add the playername to a list in the config.yml, and I want /listwanted to show all the wanted players in the list in the config.yml. I know how to make /listwanted, but I need help with /addwanted
     
  2. Offline

    Sagacious_Zed Bukkit Docs

  3. Offline

    MeZTech

    This doesn't help at all...
     
  4. Offline

    chaseoes

    Something like this?
    Code:
    List<String> wanted = getConfig().getStringList("wanted");
    wanted.add(playername);
    getConfig().set("wanted", wanted);
    saveConfig();
    
     
    Gigi10012 likes this.
  5. Offline

    Lolmewn

    I guess so, yeah, and just put that code in onCommand and you're pretty much done :)
     
  6. Offline

    Sagacious_Zed Bukkit Docs

    Gigi10012 likes this.
Thread Status:
Not open for further replies.

Share This Page