A byte can hold one of 256 values (0–255), and luckily there are way more than 256 blocks in Minecraft, so I can hand every single byte its own block.
This was not always the case. It is now since they moved (many years ago) to their new ID format, but at one point there were less than 256 blocks, and items would start at ID 256 (Iron Shovel). Not super relevant today of course, but just a fun bit of history.
Anyway, two other things come to mind:
- You could encode files directly into NBT data for an item or entity. You might need to split files across multiple tags though. It’d be funny to see armor stands representing files on disk, for example.
- You don’t need to map bytes 1:1 to blocks. It’s possible to have a palette of more than 256 blocks, and encode the data in a different base, like say base 300 or so, to make the encoded data more (spatially) compact.
Cool project. It’s a fun idea.
File? Text file? Picture? Word document?
It just reads out the raw bytes from the file and maps each possible byte value to a Minecraft block, which means that it works with any file. The flipside of this is that it’s rarely going to produce anything other than a garbled mess.
This seems like it would be good for compression. Is the byte version any smaller than the Minecraft world? I’m assuming so.
For small numbers of blocks, this would be more space-efficient, because it has no overhead and stores less information per block. However, Minecraft’s file format actually already supports compression, so once things get to a certain size, it would probably start catching up (depending on how structured the blocks are in relation to each other).
More importantly though, this program can only produce contiguous square pillars, so there are not a whole lot of practical uses for it (of course, this is not the goal of this project to begin with). Once you start adding in the complexities to make it useful, you’re basically reinventing Minecraft’s own file format, with similar space-efficiency.
And of course, there’s the matter that normally, Minecraft’s worlds are procedurally generated from a seed, so it doesn’t actually need to save all the blocks that make up a region, just the changes the players made to it. But this is something that’s impossible to do when storing a region as just a sequence of blocks.




