Need some help with this.

Discussion in 'Spigot Plugin Development' started by TheL0w3R, Jun 19, 2015.

  1. Hi, I'm making a Harry Potter spell plugin.

    I'm new in Minecraft coding (but I have 2~ years of experience in Java coding).
    I would like to know how the config files work.
    I created a config.yml file but now I need to create folders and other files (to store player's spells and wands).

    How does the bukkit file api works? I'll need some examples (if it's possible).
    All the help is welcome! (Sorry for my bad english, I'm spanish).
     
  2. Creeoer

    Supporter

    There's already documentation on how the config files work, but to load your config file you could put the file object itself into YamlConfiguration's static method of load configuration, which returns a YamlConfiguration object you could do config stuff with.

    As for a file api, I don't think there is any "bukkit file api." You probaly want to grab the plugin data folder, which is just getDataFolder(), the mkdir() method should create any directories for you, which I'd assume you'd have expierence with since you claim to be a 2 year java coder.
     
  3. Hi, yes, i have expirence with that, but I thought Bukkit had a system (like FileConfiguration)..

    Anyways, thanks a lot :)
     
  4. Bukkit doesn't really have a nice data system. I'm actually planning on creating on creating a resource to manage it.

    For now, use the YamlConfiguration class as @Creeoer said. It can be a pain, but it works well.
     
  5. Thanks :D