JavaScript, ScriptCraft Inventory saving?

22 views
Skip to first unread message

Emma Nevada

unread,
Jan 14, 2019, 2:55:49 AM1/14/19
to ScriptCraft - Scripting Minecraft

How would I be able to save all details of an Inventory?

I can easily get the inventory as such:
var Chest = server.getWorld("world").getBlockAt(543562, 69, 543562);
var Inventory = Chest.getState().getInventory();
var Contents = Inventory.getContents();

But I would love to be able to export the contents of an inventory, keeping all its Enchants, ItemFlags ItemMeta, etc, as such:
/*
    var contentsDataString = stringify(Contents);
    Inventory.setContents(objectify(contentDataString);
*/

But I cannot find any way to simply do that, so, is it even possible, has it been already attempted, or is there a more simpler way of saving inventory data?
Reply all
Reply to author
Forward
0 new messages