For this project, I wanted to set up my own Minecraft server that would stay on continuously, and wanted to have some way of visually displaying activity on the server. To achieve this, I used a Raspberry Pi (an affordable, credit card-sized computer) to run the server on, and created a “firefly” jar out of a Mason jar, reindeer moss, and yellow LEDs. When at least one player is on my Minecraft server, the LEDs fade on and off in a random pattern, creating the effect of glowing fireflies in a jar. When no players are on the server, they turn off.
The motivation to have my own physical server box for Minecraft came from trying a couple of other solutions first and not getting the results I wanted. I tried setting one up on the hosting account I use for this website, but couldn’t get it to work correctly. I then set one up using a free Minecraft server hosting service, but with the free version the server shuts down every hour and has to be restarted. I wasn’t interested in paying an ongoing monthly fee for hosting, and thought that setting up my own server on a computer on my LAN would be neat. That’s when I remembered the Raspberry Pi – a small, affordable computer with endless creative potential. The Pi has I/O pins which can be used to control electronic components, making it possible to take events that happen on the computer and use them to trigger electronic devices in the physical world.
While searching Pinterest for Raspberry Pi Inspiration, I saw a project someone had made where they used a Mason jar as an enclosure for the Pi. Visually, it was a neat combination of something rustic and something technological, which I found compelling. I then began to consider how I might make use of the Pi’s I/O pins, and how I might represent server activity visually. This led me to the idea of having LEDs turn on when someone is on the server, and I thought that having them fading up and down in the jar could create the effect of fireflies in a jar. I took to Pinterest again, and searched for “Firefly Mason Jar,” and found examples where people had created firefly jars using LEDs, and in many of the examples they filled the jars with decorative reindeer moss, which I thought look really good, and added to the rustic effect. The moss also diffuses the light of the LEDs a bit, giving them a nice “glow,” and supports the LEDs in the jar. Ultimately I decided not to put the Raspberry Pi inside the jar with the moss. I read that dry moss is highly flammable, and the Pi gets pretty warm when its running. It wouldn’t have been visible in the moss anyways, and it gets better airflow outside of the jar (keeping the Pi cooler).
For the tech end of things, I installed a Spigot Minecraft server following these instructions, which worked perfectly. I then used port forwarding to make the server accessible from outside my LAN. To control the LEDs, I wrote a Python script that checks the Minecraft server every three seconds to see if there are players on it, and if there are, it runs a function for the LED light sequence.
Here’s a video I made showing a demo of the firefly jar in action: