Get string from path.

Discussion in 'Spigot Plugin Development' started by Settler, May 24, 2015.

  1. Hello how to get string from path???
    for example:

    Code (Text):
    Messages:
          AntiMessages:
                    Hello: hello, hello.
    (Im getting error)
    My code:
    Code (Text):
    Set<String> msg = getConfig().getConfigurationSection("Messages" + args[0] + "." + name).getKeys(false);

    sender.sendMessage(msg);
     
  2. replace "Messages" with "Messages." and make a null check for got damn :))

    by the way, all your code is bad :(
     
    #2 Fr33styler, May 24, 2015
    Last edited by a moderator: May 24, 2015
  3. I just give it for example :)
    Please dont comment if you don't know.
     
  4. try using
    Code (Text):
    Sting msg = getConfig().getString("Messages.AntiMessages.Hello");

    sender.sendMessage(msg);
     
    • Agree Agree x 3