I asked Development and they said they had a mod that you can use as a guide or inspiration to create miners:
(Note that it hasn't been tested in a while):
(click to see more info)
Description: Go out for a mine knowing that everything you collect will be saved in a chest.
Look for the special commands in the code, to either place the chest, print or clear the list.
Check out the video for more details: https://www.youtube.com/watch?v=Cz110qm1ABg
When you run it, you get a diamond pickaxe and a glass block
Place the glass block wherever you want your final chest to spawn
Start mining anything you want; you won't be able to pick up the drops though
Once you're done mining chat: "1" (only the number one)
This will place a chest (where you place the glass block) surrounded by glass; inside the chest you will have all the blocks that you mined
Other chat commands:
"b" - Makes a 5x5x5 cube of random blocks to mine
"r" - resets the chest contents and empties the lists
"p" - prints a list of everything you have mines so far
"godMode" - cheat code to allow player to break glass