If I destroy a computer, will it lose its programs?

It will lose its programs. A CC computer considers itself "new" when it's placed and will have a new computer ID. (CC stores filesystem contents by computer ID, so having its ID change makes it "lose" its files, even though they're still in your world's save folder if you go looking in Windows Explorer or equivalent.)

However, there's an easy fix. Any computer (including turtles) that has a label keep their computer ID and therefore remember their contents. You can set the label with the command:

label set namegoeshere

Computers forgetting their programs had been giving me a lot of headaches until I learned about labels, since I was using a turtle and a custom tunnel program. Now I have two turtles, Cricket and Grasshopper, and they keep their custom programs when I break and move them. I set their labels with:

label set cricket

and

label set grasshopper

No more carrying around floppies and disk drives in the mines!


You can recover lost data if it's your own world (not server).

Method 1. If you know id of destroyed computer, just change number in file ".minecraft/saves//computer/lastid.txt" to id-1. For example, if you want recover computer #5, you must write 4 into this file. If you don't know id, you can search your files in "computer" directory, name of subdirectory is id. After modyfing "lastid.txt" place new computer into the world. Don't forget to restore lastid after this.

Method 2. If you don'n use id in your programs (don't send rednet messages to it etc.) you can place new computer, get its id by "id" command, then get id of lost computer (read method 1) and copy your files from lost computer directory to new one.