Check if a section exists in config.yml

Discussion in 'Plugin Development' started by Darkpicasa, Aug 27, 2014.

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

    Darkpicasa

    I'm wondering, is it possible to check if a section exists in the config.yml or not

    For example:
    if the code was:
    Code:
    example1: ex
    example2: ex2
    and you checked for example1, it would return true, but if you checked for example3, it would return false.
     
  2. Offline

    xTigerRebornx

  3. Offline

    zRA1Nz

    Code:java
    1. if (getConfig().contains("example1") {
    2. return true;
    3. }
    4.  
    5. OR
    6.  
    7. boolean ex = getConfig().contains("example1");

    )
     
Thread Status:
Not open for further replies.

Share This Page