[Urgent] Kit Creator

Discussion in 'Plugin Development' started by Zer0DZN, Jul 13, 2014.

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

    Zer0DZN

    Ok, If You Type The Command /createkit <name>, Get All Your Inventory Items and Create a Kit, If The Server Restart All Kits is Removed!, idk how to create!, help me !

    Thanks!

    - Dzn, Zer0
     
  2. Offline

    The Fancy Whale

    What? Please explain the issue. Is this a plugin you made? Is this a plugin you downloaded? Do you have the code? Is there an error? I'm lost.
     
  3. Offline

    ImDeJay


    I think its a plugin that he wants created.
     
  4. Offline

    TheMcScavenger

    Get the player's inventory, and save it to a file. Then, when someone requests the kit, convert it back to inventory, and give it back to the player. If you want help, give us your current code.
     
  5. Offline

    Zer0DZN

    yes that is, just need a base to make

    I already thought of that, but I need a base to make, because im not good with config files :c

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

    TheMcScavenger

    Here's your base:
    Code:java
    1. public void storeToFile(Player player){
    2. ItemStack[] inventory = player.getInventory().getContents();
    3. for(Item i : inventory){
    4. // Your Code
    5. }
    6. }
     
  7. Offline

    Zer0DZN

    I'm still confused, I need to make a config file to save the kit, and do not know what
     
  8. Offline

    TheMcScavenger

    Either:
    Code:java
    1. getConfig();
    2. getConfig().getString("path");
    3. getConfig().set("path", value);


    or:
    Code:java
    1. File file = new File(getDataFolder() + "/myfile.yml");
    2. FileConfiguration fileConfig = YamlConfiguration.loadConfiguration(file);
    3.  
    4. fileConfig.getString("path");
    5. fileConfig.set("path", value);
     
  9. Offline

    Zer0DZN

    place this in storetofile void?
     
  10. Offline

    TheMcScavenger

    Learn Java.
     
  11. Offline

    Zer0DZN

    I know java, but I'm noob in config files, sorry
     
  12. Offline

    TheMcScavenger

    Where to place parts of the code has nothing to do with configuration files, it's just plain old Java.
     
  13. Offline

    Zer0DZN

    ok
     
Thread Status:
Not open for further replies.

Share This Page