Save Inventory and load later`?

Discussion in 'Plugin Development' started by Soxra, Apr 26, 2012.

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

    Soxra

    Hey,
    i want to save my inventory with a command. Later i want to load the saved one with a command.

    Regards Soxra.
     
  2. Offline

    Njol

    Do you need a custom plugin for this? If yes simply store player.getInventory().getContents() and .getArmorContents() in a config, indexed with their position.
     
  3. Offline

    Soxra

    This is not working. I have tried that already
     
  4. Offline

    Njol

    Do you by chance still have the code?
     
  5. Offline

    Soxra

    Njol
    No but it was like that:
    Code:
    plugin.getConfig().set("Inv", player.getInventory().getContents());
    ----------
    ItemStack[] content = (ItemStack[]) plugin.getConfig().get("Inv"),
    player.getInventory().setContents(content);
    
     
Thread Status:
Not open for further replies.

Share This Page