Solved Creating config paths

Discussion in 'Plugin Development' started by ItsMas_, Jan 10, 2016.

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

    ItsMas_

    I am making a plugin so when a player who has never joined before joins, it creates a path in the config with their uuid with two keys, "toggle" and "spy". Like this:
    Code:
    playername:
      toggle: false
      spy: false
    
    Here is my code:
    Code:
    if (!e.getPlayer().hasPlayedBefore()){
                plugin.getConfig().createSection(e.getPlayer().getUniqueId().toString());
                plugin.getConfig().createPath(e.getPlayer().getUniqueId(), "toggle"); [ERRROR LINE]
                plugin.getConfig().createPath(e.getPlayer().getUniqueId(), "spy"); [ERROR LINE]
               
                plugin.getConfig().set(e.getPlayer().getUniqueId().toString() + ".pmtoggle", false);
                plugin.getConfig().set(e.getPlayer().getUniqueId().toString() + ".spy", false);
            }
    
    The error is the lines where createPath() is used.
    Error:
    "The method createPath(ConfigurationSection, String) in the type MemorySection is not applicable for the arguments (UUID, String)"
     
  2. Offline

    Lolmewn

    Just delete the lines, you only have to set it. You don't even have to create a section for it.
     
  3. Offline

    ItsMas_

    Okay, thanks :)
     
  4. Offline

    Lolmewn

    Remember: If this solved your issue, mark the thread as [Solved] :)
     
Thread Status:
Not open for further replies.

Share This Page