Configuration strings

Discussion in 'Plugin Development' started by mcmyst3r, Jun 7, 2022.

  1. Offline

    mcmyst3r

    Hi. I'm currently working on a plugin and i am having a small problem with my configuration. I'm not sure if this is a error on my side or there is a good reason for it not to work.
    First of all i'm trying to set a path in this order:
    reports:
    '1':
    username:
    uuid:
    The problem is when i try to get a value from the config using a set string.
    if i use getConfig().getString("reports.1.username");
    it returns fine.
    But if i try doing it like this:

    String idno = "1";
    getConfig().getString("reports." + idno + ".username")
    it returns null.
    Why would this be the case?
    -Thanks!
     
  2. Offline

    DopeBrot

    for me it looks fine
    did you try:

    Code:
    int idno = 1;
    getConfig().getString("reports." + idno + ".username")
    if yes can you post more code?
     
    Last edited: Jun 13, 2022

Share This Page