Using custom ymls

Discussion in 'Plugin Development' started by EnderTroll68, Nov 28, 2013.

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

    EnderTroll68

    Hello people of Bukkit!!

    I am rather new to coding plugins, and I have a problem that I cannot figure out on my own. I am making a plugin that when someone issues a command, it will create a new yml file named after argument one, in the folder named users. The problem that I am having, is that I want to base this file off of a default one that I have already made. I create the new file by coding in:
    Code:java
    1. Player target = Bukkit.getServer().getPlayer(args[0]);
    2. File customConfigFile = new File(this.getDataFolder() + "/users/", target.getPlayer().getName() + ".yml");
    When this file is made, I want it to be based off of a file named example.yml that I will put in the jar. I then want to be able to use the loadConfiguration method without using the variable customConfigFile, as I want to able to use the information outside of where I defined the variable target.

    Any suggestions/help?

    EnderTroll out
     
  2. Offline

    Darq

    looks like you're trying to append a String to a File object! that won't work :)

    Try this:
    Code:
    File customConfigFile = new File(this.getDataFolder(), "users/" + target.getPlayer().getName() + ".yml");
     
  3. Offline

    xTrollxDudex

Thread Status:
Not open for further replies.

Share This Page