How can I spawn items into a chest, using Command Blocks?

Solution 1:

Do

/replaceitem block <x> <y> <z> <slot (if you want to fill the 9th slot of an ender chest with something, change this to slot.enderchest.9)> <item> [data] [dataValue]