On everything from powerful PCs to sleek consoles, players can build towering castles, dig deep mines and fight creepers in Minecraft. But one inventor decided to take this favorite game to an unexpected place: a microcontroller the size of a penny that costs less than a dollar. This is the story of bareiron, a custom Minecraft server built on an ESP32 processor, a feat that feels like cramming an ocean into a teacup.
PortalRunner’s project started with a simple, bold goal: make a Minecraft server that runs on technology small enough to fit in your pocket. The ESP32, a microcontroller with 400KB of memory and a 160MHz processor, is meant for a smart lightbulb not a game server. For comparison, a typical Minecraft server requires gigabytes of RAM and a processor clocked in the gigahertz range. To do this, PortalRunner had to rewrite the rules, create a server from scratch in C and work closely with the hardware itself. The result, bareiron, sacrifices some features for performance but still gives a passable Minecraft experience on a device that consumes half a watt of power.
- LEGO MINECRAFT TOY WITH ANIMALS – The Baby Pig House is packed with pretend play fun for girls and boys ages 7 years old and up who have a passion...
- MINECRAFT FIGURES – This set includes a hero character in a wolf skin, a baby pig, bee, an adult pig and a zombified piglin
- BUILDABLE PLAYSET – Kids build a pig-shaped house that comes with a farm plot where potatoes and beets grow, plus a field with a gate to guide the...
One of the toughest challenges was terrain generation. In a typical Minecraft game, the environment is generated using Perlin noise, a technique for layering random patterns to produce natural looking landscapes. This works but is memory and CPU intensive. Even storing a few chunks—16x16x256 block parts of the game world—would be impossible on the ESP32 due to its limited memory pool. PortalRunner’s solution was to use bilinear interpolation, which is known to anyone who has enlarged a pixelated image. The server generates pseudo random integers based on a chunk’s coordinates to produce a smooth landscape gradient without keeping large noise maps. These numbers give height values for each chunk’s four corners and interpolation fills in the gaps, resulting in rolling hills and valleys. Adjacent chunks exchange coordinates so the world feels smooth as you move around.

Biomes, or unique environments like deserts or snowy plains, added another layer of complexity. Vanilla Minecraft uses complex features like temperature and humidity to shape biomes, bareiron takes a simpler approach. Each biome is a circular island on a grid, its type defined by a repeating pattern tied to the world’s seed. This grid-like arrangement makes biomes predictable and uniform in size, which is a performance trade off. Forests have scattered trees, deserts have cacti, snowy plains have small bushes, all of which are randomly placed from chunk corners. The terrain shape changes with biome—plains are flat with occasional bumps, snowy slopes rise and fall dramatically—by adjusting the number of random elements used in height calculations.

Caves and subsurface elements need imagination. Instead of creating a separate algorithm for caves, PortalRunner mirrored the surface landscape to create deep, wide tunnels like Minecraft’s deepslate caves. Ores, like diamonds, are sparse and often found at the bottom of the caves. This way avoids the original game’s complex vein generation and keeps things simple. Player created changes, like mined or placed blocks, are stored in a small array: each entry takes 6 bytes to store coordinates and block type, so about 25,000 changes – roughly one and a half chunks worth. This limits the build height to 256 blocks and the world’s horizontal spread to 32,000 blocks but it’s a small price to pay for everything to fit on this hardware.

Crafting and inventory management got a simple makeover. When you mine blocks they don’t drop items, instead they go straight to your inventory with a visual effect of items flying towards you. Crafting recipes replaced the 3×3 modular grid with a simple check: the server counts items in the crafting grid, checks if they meet the recipe criteria and checks their position. For example a furnace requires 8 cobblestone blocks around an empty center, while shears require 2 iron ingots in specific positions. Furnaces and chests don’t use timers or require long term storage. Furnaces produce items fast, while chests store items as “invisible blocks” in the same array as block changes, a clever hack that uses the existing data structure.
Performance is where bareiron shines; on the ESP32-C3 a chunk loads in about 200ms which is fast enough for seamless gameplay but lags with more than 3 players. On a modern PC chunks are generated in 0.5ms but the lack of network compression means poor internet can limit the experience. The server also trusts the client completely, so inventory changes or quick block mining don’t require verification, leaving it open to cheating in untrusted groups. These trade-offs are because the project is about possibilities not perfection.
[Source]