Ambient Firefly Swarm

Create a glowing swarm of ambient fireflies that gently drift, blink, and flutter around an enchanted forest lantern in Minecraft Java Edition.

Java EditionParticle ArtEasy22 commandsTested on a real 26.2 & 26.3 server
Glowing yellow-green and orange firefly particles swarm around a lantern at night. Download the GIF Video & GIF © www.9minecraft.net

Trails & PathsNatureYellowGreenOrangeDecorationMap MakingArmor standsSummoned mobsBlock building (fill/setblock/clone)Rotation math21+ commands

Despite how atmospheric Minecraft nights can be, forests and swamps often feel a bit empty once the sun goes down. With a handful of command blocks, you can populate any area with a living swarm of glowing fireflies that drift through the air, pulse with warm yellow-green light, and leave trailing sparks behind them.

This setup uses invisible wandering bats to give the fireflies natural, unpredictable flight paths, combined with an invisible orbit system and custom colour-shifting dust particles that glow brightly against the dark.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_timer dummy
  2. /fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 moss_block
  3. /setblock ~ ~ ~ cobblestone_wall
  4. /setblock ~ ~1 ~ oak_fence
  5. /setblock ~ ~2 ~ lantern[hanging=false]
  6. /summon armor_stand ~ ~1 ~ {Invisible:1b,NoGravity:1b,Marker:1b,Tags:["c9_center"]}
  7. /summon bat ~2 ~2 ~1 {Silent:1b,NoAI:0b,PersistenceRequired:1b,Tags:["c9_fly","c9_f1"],active_effects:[{id:"minecraft:invisibility",amplifier:0,duration:-1,show_particles:0b}]}
  8. /summon bat ~-2 ~3 ~-1 {Silent:1b,NoAI:0b,PersistenceRequired:1b,Tags:["c9_fly","c9_f2"],active_effects:[{id:"minecraft:invisibility",amplifier:0,duration:-1,show_particles:0b}]}
  9. /summon bat ~1 ~2 ~-2 {Silent:1b,NoAI:0b,PersistenceRequired:1b,Tags:["c9_fly","c9_f1"],active_effects:[{id:"minecraft:invisibility",amplifier:0,duration:-1,show_particles:0b}]}
  10. /summon bat ~-1 ~4 ~2 {Silent:1b,NoAI:0b,PersistenceRequired:1b,Tags:["c9_fly","c9_f2"],active_effects:[{id:"minecraft:invisibility",amplifier:0,duration:-1,show_particles:0b}]}

2. Loop - one repeating command block each (Always Active) 12 commands

  1. /scoreboard players add @e[tag=c9_center] c9_timer 1
  2. /execute as @e[tag=c9_center,scores={c9_timer=40..}] run scoreboard players set @s c9_timer 0
  3. /execute as @e[tag=c9_center] at @s run tp @s ~ ~ ~ ~4 ~
  4. /execute at @e[tag=c9_center] positioned ^ ^1 ^3.5 run particle dust_color_transition{from_color:[0.8,1.0,0.1],to_color:[1.0,0.6,0.0],scale:1.2} ~ ~ ~ 0.1 0.1 0.1 0 2 force
  5. /execute at @e[tag=c9_center] positioned ^ ^0.5 ^-3.5 run particle dust_color_transition{from_color:[0.6,1.0,0.2],to_color:[1.0,0.8,0.0],scale:1.2} ~ ~ ~ 0.1 0.1 0.1 0 2 force
  6. /execute at @e[tag=c9_center] positioned ^2.5 ^1.8 ^1 run particle dust_color_transition{from_color:[1.0,0.9,0.2],to_color:[0.4,0.9,0.1],scale:1.1} ~ ~ ~ 0.1 0.1 0.1 0 2 force
  7. /execute if entity @e[tag=c9_center,scores={c9_timer=1..25}] at @e[tag=c9_f1] run particle dust_color_transition{from_color:[0.7,1.0,0.1],to_color:[1.0,0.7,0.0],scale:1.3} ~ ~0.3 ~ 0.15 0.15 0.15 0 3 force
  8. /execute if entity @e[tag=c9_center,scores={c9_timer=15..38}] at @e[tag=c9_f2] run particle dust_color_transition{from_color:[1.0,0.9,0.1],to_color:[0.5,1.0,0.1],scale:1.3} ~ ~0.3 ~ 0.15 0.15 0.15 0 3 force
  9. /execute at @e[tag=c9_fly] run particle wax_on ~ ~0.3 ~ 0.4 0.4 0.4 0.01 1 force
  10. /execute at @e[tag=c9_center] run particle end_rod ~ ~0.5 ~ 5 2.5 5 0.005 2 force
  11. /execute at @e[tag=c9_center] run particle spore_blossom_air ~ ~2 ~ 6 3 6 0.01 4 force
  12. /execute at @e[tag=c9_center] as @e[tag=c9_fly,distance=7..] run tp @s ~ ~1.5 ~

How it works

Frames from the test run

Ambient Firefly Swarm - frame 1Ambient Firefly Swarm - frame 2Ambient Firefly Swarm - frame 3

Recorded on our own test server: 59 frames at about 9.7 fps. Our image check saw: A swarm of glowing yellow-green, orange, and white particles drift around a lantern at night.

Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.

Build it in your world

  1. Enable cheats in your world and give yourself a command block using /give @s command_block.
  2. Pick a spot outdoors at night and run each of the 10 setup commands in chat to build the mossy lantern post, scoreboard timer, center marker, and invisible bats.
  3. Place 12 repeating command blocks in a row nearby (or a 1 repeating + 11 chain command block line) and set all of them to Always Active.
  4. Paste one loop command into each command block in order.
  5. Set the time to midnight (/time set midnight) to see the glowing green and gold fireflies blink and dance around the lantern.

Use it with real players

If you want the firefly swarm to follow you through dark caves or forests instead of staying around a lantern, skip building the lantern post and replace @e[tag=c9_center] in the loop commands with @a[ limit=1] (or a specific player name). The orbiting fireflies and wandering bats will follow you wherever you walk and tether back to you whenever you move more than 7 blocks ahead.

Remove it again 5 commands

  1. /kill @e[tag=c9_fly]
  2. /kill @e[tag=c9_center]
  3. /scoreboard objectives remove c9_timer
  4. /fill ~-2 ~-1 ~-2 ~2 ~2 ~2 air
  5. /fill ~-2 ~-1 ~-2 ~2 ~-1 ~2 grass_block

FAQ

Why use invisible bats instead of armor stands for the fireflies?

Armor stands only move where you teleport them, which can look robotic unless you write lots of movement commands. Bats naturally swoop, dip, and change direction on their own, giving the fireflies lifelike motion for free.

How can I change the color of the fireflies?

Edit the RGB numbers inside from_color and to_color in the dust_color_transition commands. Each number runs from 0.0 to 1.0 for Red, Green, and Blue—for example, [0.1,0.8,1.0] makes glowing cyan fairy lights.

Commands used

/execute/fill/particle/scoreboard/setblock/summon/tp

Similar creations

Join 9Minecraft News & Guides