Did you ever want to store the Minecraft movie in Minecraft? No? Too bad, because now you can.
The Idea
I recently had the silly idea to convert a file into a Minecraft world. This led me down a really cool rabbit-hole, learning a ton about 3D geometry, byte layouts and Minecraft.
The core idea is pretty simple: I want to take any file and be able to view it in Minecraft blocks.
Along the way I also managed to convince my code that a tiny text-file is 2.3 exabytes large.
Why
Why not.
Palette Generator
The first thing you need is a lookup table. 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. Byte 0 becomes stone, byte 1 becomes granite, all the way up to 255 .
A bunch of blocks carry state that changes on its own or depends on placement: wheat, carrots and other crops have an age , water and lava have a level . If byte 42 decoded to wheat and that wheat grew a stage, my decoder would read the wrong byte and the whole file would be in shambles.
... continue reading