Adding Things To Configuration With Commands

Discussion in 'Plugin Development' started by Redbearz1, Sep 9, 2013.

Thread Status:
Not open for further replies.
  1. Hey all,

    I need help producing a plugin i'm making, I've restarted making and i'm still struggling to get a way to add something to the config through a command.

    What i want to do is /Add <Message> And for that to add the <Message> to a list in the configuration.

    Such as:

    List:
    - Bob
    - Tim
    - Jim
    - <Message Goes Here>

    And for it to let them add to that list without going into the config but using a command instead, and for a way for that to save so it will take place maybe on restart or if possible instantly ?

    Thank You :)
    -Redbearz1
     
  2. Offline

    sharp237


    Have you looked at the Bukkit wiki?
     
  3. I've seen the getting methods and setting methods, but I viewed the setting method to not do what I want it to do as from what I've seen it sets a string value and not add it to a list. Am i missing something here :p ?

    Thank You :)
    -Redbearz1
     
  4. Offline

    sharp237


    instead of getString(path); can you not do getList(path); ?
     
  5. In the bukkit configuration it does have that, but i need a way to maybe use that so i can add something to the list ? I would guess if i did that would set the list instead of add to it (Even if the below line makes any sense at all :p)

    this.getConfig().getString("List").set("List", Args [1])
     
  6. Anyone got any help ?

    Thank You :)
    -Redbearz1
     
Thread Status:
Not open for further replies.

Share This Page