Easily summon chests with items!
I and some friends were working in a CC map, and we needed a way to give items to players. Some time ago, I used command blocks and played in the snapshots a lot, so I thought of spawning a Chest as a Falling Sand from the sky. But NBT tags are a bit hard, so I made this utility to help us with that.
Note: it summons a FALLING SAND entity, so you can summon it at y150 and it'll fall from the sky, like a Supply Crate :P/>
Download: pastebin get QNhhry4M crate
Usage:
os.loadAPI("crate")
-- First, you need to make a table with all the items.
items = {
{id = 322, count = 1, slot = 4, data = 1}, -- note: data is optional
{id = 264, count = 64, slot = 13},
{id = 276, count = 1, slot = 22}
}
x, y, z = commands.getBlockPosition()
-- Then, summonCrate(xCoords, yCoords, zCoords, table with items)
crate.summonCrate(x, 200, z, items)
Oh, and thanks awsumben13 for the help with some var to NBT things ;)/>