Solved get string from config..

Discussion in 'Plugin Help/Development/Requests' started by Scorpionvssub, Jul 13, 2015.

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

    Scorpionvssub

    Cant find out how to get a string

    From the config like:

    Settings:
    slayers:
    - Scorpionvssub
    - Clairecreeper

    back into a array to reuse.

    Code:
        @Override
        public void onEnable() {
            getConfig().options().copyDefaults(true);
            saveDefaultConfig();
            getCommand("dragon").setExecutor(this);
            getServer().getPluginManager().registerEvents(this, this);
    
            reload();
    
            List<String> slayer = getConfig().getStringList("Settings.slayers");
            slayers.add(String.valueOf(slayer));
    
            getServer().getConsoleSender().sendMessage(prefix + " Dragon Slayer Enabled");
        }
    
    A simple addall done the trick XD

    This doesnt seem to work and cant find anything that does or would work

    bumpcaller

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 12, 2016
  2. Offline

    Scorpionvssub

  3. Offline

    Scorpionvssub

Thread Status:
Not open for further replies.

Share This Page