Energy Flashlight

Energy Flashlight

Darkness in caves? Need to light the way forward? Use redstone as energy for your new flashlight!

by
3.3K Downloads
datapackfabricminecraftneoforgequiltequipmentgame-mechanicstechnology
Rent Server with this Mod

Screenshots

Preview
Cave
Flashlight clicks
No energy
It's on!
Recipe

About this Mod

📖 About

This datapack adds a flashlight that casts light across the entire beam path.

Important information:

  • In order for light to logically pass through incomplete blocks (slabs for example), you need to install the MIDWUT(click) library datapack;
  • Help with translation into other languages is welcome, currently only available: Russian, English and pre-reformation Russian.

Features:

  • Using redstone dust as energy;
  • Real lighting using light blocks;
  • Charge reduction even if the flashlight is not in your hand;
  • The flashlight shines 20 blocks ahead, covering the entire beam path.

The player can craft a flashlight or give using a function /function energy_flashlight:give/flashlight

  • The player will receive a recipe if he receives a redstone lamp or redstone dust.
  • Recipe visualization on the misode generator website: Click

Instructions for charging a flashlight will always be in the description of the flashlight at zero energy, but I'll repeat it here: the player must hold the flashlight in the main hand, the redstone dust in the off hand, sneak and use the flashlight.
The maximum possible charge for a flashlight is 10 redstone dusts, each redstone dust adds 6 minutes of real-time operation, as a result, the flashlight can be charged for 1 hour. If the flashlight is on, the energy is used up and the next time you pick it up, the battery status will be updated, if more than an hour has passed, the flashlight will turn off immediately. This is achieved by storing the gametime in an item, and when the player holds a flashlight, the datapack compares the saved time with the current one.

🧩 Add-ons & Technical info

Custom light beams

If you want to add custom light beam, you can do it, but first you need to know: the datapack tick function runs on a 2-tick schedule for optimization, so I added the #energy_flashlight:tick functions tag. You can add your own functions for the spawn light beam to this tag.
Why is this necessary?
1) To optimize the light sources so that their life is handled only in this datapack;
2) To avoid bugs, the life of light sources must be processed after they are spawned and updated.

So, to spawn a light beam, you need to set its length and run the function.
The length is measured in 0.5 blocks, that is, the length of the raycast 10 is equal to (<=)5 blocks.

# The base length is 20 blocks.
scoreboard players set #raycast main_score 40
execute anchored eyes positioned ^ ^ ^ run function energy_flashlight:other/raycast/loop

Custom charging item

The charging flashlight always accepts only vanilla redstone dust without any custom components, but if you add the energy_flashlight.energy_for_flashlight:true nbt tag to the minecraft:custom_data component, then this item can be used as a charger.

🔗 Links

You can leave a comment on the PMC page!

PMC

Russian discord server of datapackers / Русский дискорд сервер датапакеров

Если вы датапакер, ищите адекватной помощи, полезных ресурсов и возможности поделиться проектами, то вам на СвинСоюз: Датапаки!
Это сервер-ответвление от изначального заброшенного сервера ZeroCaty "СвинСоюз". Сейчас мы не имеем к нему никакого отношения.

SvinSoyuz

Available Versions

Supports Uprelease
MC 1.21.9, 1.21.10, 1.21.11fabric, neoforge, quilt
January 13, 2026
Supports Uprelease
MC 1.21.9, 1.21.10, 1.21.11datapack, minecraft
January 13, 2026
First!release
MC 1.21.6, 1.21.7, 1.21.8fabric, neoforge, quilt
September 28, 2025
First!release
MC 1.21.6, 1.21.7, 1.21.8datapack, minecraft
September 25, 2025

How to Install Energy Flashlight on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set datapack Loader

In the panel under "Egg", select the datapack loader and matching Minecraft version (1.21.11).

3

Install Mod

Open the mod browser in the dashboard and search for "Energy Flashlight". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

datapackfabricminecraftneoforgequilt

Minecraft Versions

1.21.11, 1.21.10, 1.21.9 (+3 more)

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

Energy Flashlight server crashes on startup – what to do?

Most common cause: wrong datapack version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.11). You can switch loaders with one click in the panel.

Is Energy Flashlight compatible with datapack and fabric and minecraft and neoforge and quilt?

Energy Flashlight officially supports datapack, fabric, minecraft, neoforge, quilt for Minecraft 1.21.11, 1.21.10, 1.21.9. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with Energy Flashlight – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Energy Flashlight consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install Energy Flashlight with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
GNU General Public License v3.0 only
Server-side
Required

Supported Versions

1.21.111.21.101.21.91.21.81.21.71.21.6