Confused.. getting keys from configurationsection inside another

Discussion in 'Plugin Development' started by Pizza371, Nov 11, 2013.

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

    Pizza371

    So.. basically.. I need to get enchantment IDs and levels from a config..
    helmet:
    id: 310
    lore: 'moo'
    enchantments:
    1:
    lvl: 3
    name: 'moo'
    and when I try something like this
    ConfigurationSection s = this.getConfig().getConfSection("helmet.enchantments");
    sendMsg(s.getKeys(false));
    it gives a nullpointer, why is this happening? Can't I get a configsection within another one? If so, any ideas on how to offer enchantmens?
    All help very much appreciated!
     
  2. Offline

    qhenckel

    Pizza371
    That is the correct usage. I use it like that all the time.
    Maybe it's because sendmessage() uses List<String> but getKeys returns Set<String>.
    That may be it. I've had that be a problem in the past.
     
    Pizza371 likes this.
Thread Status:
Not open for further replies.

Share This Page