this post was submitted on 24 Jul 2026
25 points (90.3% liked)

Programming

27863 readers
318 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 3 years ago
MODERATORS
top 5 comments
sorted by: hot top controversial new old
[–] TehPers@beehaw.org 5 points 4 days ago

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:

  1. 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.
  2. 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.

[–] MonkderVierte@lemmy.zip 5 points 4 days ago (1 children)

File? Text file? Picture? Word document?

[–] HetareKing@piefed.social 13 points 4 days ago* (last edited 4 days ago) (1 children)

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.

[–] DeltaWingDragon@sh.itjust.works 2 points 4 days ago (1 children)

This seems like it would be good for compression. Is the byte version any smaller than the Minecraft world? I'm assuming so.

[–] HetareKing@piefed.social 3 points 4 days ago

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.