Allwine Designs built this Creeper Detector for Minecraft to “engage kids with electronics and coding” — also probably to protect themselves from nearby creepers! The Instructable is incredibly extensive and includes lots of tips for thinking through project builds and making design decisions along the way.
When all LEDs are off, it means there are no creepers within 32 blocks. When all LEDs are on (they’ll be flashing as well), you’re within the 3 block detonation radius of the creeper (the radius at which the creeper will stop, light its fuse and explode). Anything in between can give you an estimate as to how far away a creeper is from you. When 4 of the 8 LEDs are lit, you’re about 16 blocks from a creeper, which is the range at which if a creeper sees you, it’ll attack. The LEDs will begin to flash when you’re within the blast radius of the creeper (7 blocks). It’s also the radius that if you step out of, the creeper will stop its fuse and continue to come after you. With this knowledge, you should be able to avoid any unexpected creeper attacks or hunt down any nearby creepers!
– I used an 8 LED RGBW NeoPixel stick, but I didn’t use the white (W) LED at all so an 8 LED RGB NeoPixel stick will do. You can substitute this for any RGB or RGBW NeoPixel product, but there are power considerations that we’ll discuss in the next step and code changes that I’ll point out when we get here. You may want to choose one that doesn’t require soldering, but I’ll be showing you how I soldered wires onto the stick.
– A microcontroller and its matching USB cable. I used SparkFun’s RedBoard which is an Arduino Uno clone. It uses a Mini B USB connector (I’m not sure why it’s so expensive on Amazon, you can get it directly from SparkFun here, or go for an alternative on Amazon, like this one). We’ll be using an Arduino library to simplify the coding, but it only uses basic Serial communication so the library can likely be ported to work on any microcontroller that can do USB Serial. Almost any Arduino will do. Make sure it has USB Serial (most do, but some don’t such as the original Trinket).