Save Inventory and Loading Inventory

Discussion in 'Plugin Development' started by Warreo, Aug 22, 2012.

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


    Hey guys, now I've been looking and I'm really hoping there's an easy way to do this. But I would like to be able to save a players inventory to a file with a method such as this one:

    ItemStack[] items player.getInventory().getContents();
    ItemStack i items){
    != null){
    String s i.getType().toString();
    int z i.getAmount();
    this.getBankConfig().set(player.getName() + "." +player.getWorld().getName() + "." sz);           
    But now I would like to know a fast way to read this (or an edited version of that). And then be able to give it back to the player, if someone could point me in the right direction I would really appreciate that! Thanks!
  2. Offline


  3. Offline


  4. Nobody here seems to know that you can save an ItemStack in a yml without any converting... What do you think config.getItemStack(path) is for? ;)
    thats just great
  6. Offline


  7. That's what i thought when i saw it :p
Thread Status:
Not open for further replies.

Share This Page