command config

Discussion in 'Plugin Development' started by noraver, Apr 13, 2013.

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

    noraver

    I looked around for command for config for writing in it but everything was based on the wrong format i been looking for i tryed many different type and started my class file over a few times.

    so here is part of my config.yml
    Code:
     
    messages1: hello world
     
    messages2: greetings
     
     
    
    i need the command like

    /<command> <message1> <msg>

    so it changes the msg thats in the config

    this is being made on a different class not the main class
    help would be much appreciated :)


    Thank you
    Bless_
     
  2. Offline

    Nitnelave

    First of all, you may want to reconsider your config structure. I don't know exactly what you're trying to do (if you explained it, we could give you some help), but maybe something like
    Code:
    hello :
        tank :
            health: 20
        knight :
            health: 30
    
    would be closer to what you're looking for. I could explain how to do what you asked, but I've got a feeling that there's a much better way of doing it, by restructuring the config.

    Now, tell us what you want to do, and we'll explain how to do it simply.
     
  3. Offline

    noraver

    Nope i just need it for the node

    Node2: my.node.here

    dont need the other stuff in it
     
  4. Offline

    Nitnelave

    ok. I'm still not sure what you need, but...
    it would be config.set (node, value);
    like config.set ("Node2", "my.node.here");
     
  5. Offline

    noraver

    changed the format little to what im looking for
     
  6. Offline

    Nitnelave

    Well, then, it's config.set ("message1", newMessage);
     
Thread Status:
Not open for further replies.

Share This Page