Need Help Saving Custom Inventory

Discussion in 'Plugin Development' started by mrbliss, Jun 15, 2014.

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


    Currently I am having trouble saving my custom inventory created like this

    1. public void OpenInventory(Player p){
    2. Inventory inv = Bukkit.createInventory(p,9 * 1,ChatColor.RED +"Synx EnderChest");
    3. inv.addItem(new ItemStack(iv()));
    4. p.openInventory(inv);
    5. }

    This works while the server is running but when it shuts down or reloads all items are lost. Any help is greatly appreciated
  2. Offline


    Save the inventory to the config.
  3. Offline


  4. Offline


    mrbliss you can for example code it to a string array, so the strings will represent item stacks:
    items: [275:8, 135|2:5:custom name:FIRE_ASPECT]
    items: [NAME:diamond_axe|LORE:cuttin' trees|QUANTITY:5, NAME:dirt|ENCHANT:FORTUNE|ENCHANTLVL:3]
    and then parse each string!
    The format? Let your creativity work. :)
    I often use this trick.
Thread Status:
Not open for further replies.

Share This Page