Undefined string in config

Discussion in 'Plugin Development' started by dvargas135, Nov 8, 2015.

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

    dvargas135

    I don't know how else to name this. But is there a way to make undefined strings in a config?
    E.g.
    Code:
    'undefinedString':
      commands:
      - say hi
    'anotherOne':
      commands:
      - say hi2
    Can anyone give me an example code for this?
    Or not to spoon feed me, guide me on how to make it
     
  2. Offline

    Zombie_Striker

    @dvargas135
    I do not know what you mean by "undefined"? Do you mean you want a "key1" and a "key2"?
     
  3. Offline

    dvargas135

    When you don't specify in the code, like getConfig().getBoolean("plugin.enabled");
    and that would do
    Code:
    plugin:
      enabled: true
    I want it so you can put whatever you want there instead of "plugin".
    Code:
    custom:
      enabled: true
     
  4. Offline

    Zombie_Striker

    @dvargas135
    Well, one way to do it is to add an integer in front of the key (such as "1.plugin.enabled"), simply loop through all the numbers when you want to get a number (Such as creating a for loop and using I+".plugin.enabled")
     
Thread Status:
Not open for further replies.

Share This Page