Explosive Bat Swarm

Summon a chaotic flock of glowing bomber bats that swarm across the arena, dropping live TNT from the sky and blasting craters into the terrain below.

Java EditionMobs & PetsEasy24 commandsTested on a real 26.2 & 26.3 server
Glowing red bats drop explosive TNT blocks onto a cratered grassy area at night. Download the GIF Video & GIF © www.9minecraft.net

Custom MobsFireDarkHorrorRedOrangeBlackBoss FightAdventure MapMini-gameItem displaysSummoned mobsSoundsRotation math21+ commands

Turn one of Minecraft's most harmless ambient mobs into an aerial bombardment hazard. This creation spawns a glowing flock of bomber bats that circle an eerie altar in the center of the arena, trailing fiery embers and clouds of smoke as they flutter overhead.

Every few seconds, bats from the swarm release armed TNT blocks with glowing red outlines. The explosives whistle down to the ground and blast craters into the grass while the invincible bats remain completely unharmed by their own destruction.

1. Setup - type these once 10 commands

  1. /gamerule command_block_output false
  2. /gamerule tnt_explodes true
  3. /scoreboard objectives add c9_timer dummy
  4. /team add c9_red
  5. /team modify c9_red color red
  6. /summon marker ~ ~ ~ {Tags:["c9_core"]}
  7. /summon item_display ~ ~1.5 ~ {Tags:["c9_core_vis"],Glowing:1b,glow_color_override:16724736,item:{id:"minecraft:tnt",count:1},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1.2f,1.2f,1.2f]}}
  8. /summon bat ~4 ~6 ~4 {Tags:["c9_bat"],Glowing:1b,Invulnerable:1b,CustomName:'{"text":"Bomber Bat","color":"red"}'}
  9. /summon bat ~-4 ~7 ~3 {Tags:["c9_bat"],Glowing:1b,Invulnerable:1b,CustomName:'{"text":"Bomber Bat","color":"red"}'}
  10. /summon bat ~3 ~5 ~-4 {Tags:["c9_bat"],Glowing:1b,Invulnerable:1b,CustomName:'{"text":"Bomber Bat","color":"red"}'}

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

  1. /scoreboard players add @e[tag=c9_core] c9_timer 1
  2. /execute as @e[tag=c9_bat] at @s run scoreboard players add @s c9_timer 1
  3. /execute at @e[tag=c9_core_vis] run particle lava ~ ~ ~ 0.4 0.4 0.4 0 1 force
  4. /execute as @e[tag=c9_core_vis] at @s run tp @s ~ ~ ~ ~6 ~
  5. /execute as @e[tag=c9_core,scores={c9_timer=15}] unless entity @e[tag=c9_bat,limit=14] run summon bat ~ ~6 ~ {Tags:["c9_bat"],Glowing:1b,Invulnerable:1b,CustomName:'{"text":"Bomber Bat","color":"red"}'}
  6. /team join c9_red @e[tag=c9_bat,team=!c9_red]
  7. /execute at @e[tag=c9_bat] run particle flame ~ ~0.2 ~ 0.15 0.15 0.15 0.02 2 force
  8. /execute at @e[tag=c9_bat] run particle large_smoke ~ ~0.2 ~ 0.1 0.1 0.1 0.01 1 force
  9. /execute as @e[tag=c9_bat] at @s if block ~ ~-9 ~ air run tp @s ~ ~-0.3 ~
  10. /execute as @e[tag=c9_bat] at @s unless block ~ ~-3 ~ air run tp @s ~ ~0.35 ~
  11. /execute as @e[tag=c9_bat,distance=12..] at @s facing ~ ~6 ~ run tp @s ^ ^ ^0.45
  12. /execute as @e[tag=c9_core,scores={c9_timer=30..}] at @e[tag=c9_bat,limit=2,sort=random] run summon tnt ~ ~-0.4 ~ {Tags:["c9_tnt"],fuse:45,Glowing:1b,Motion:[0.0,-0.2,0.0]}
  13. /execute as @e[tag=c9_core,scores={c9_timer=30..}] at @e[tag=c9_tnt] run playsound entity.tnt.primed master @a ~ ~ ~ 0.8 1.4
  14. /scoreboard players set @e[tag=c9_core,scores={c9_timer=30..}] c9_timer 0

How it works

Frames from the test run

Explosive Bat Swarm - frame 1Explosive Bat Swarm - frame 2Explosive Bat Swarm - frame 3

Recorded on our own test server: 59 frames at about 9.7 fps. Our image check saw: Red glowing bats fly overhead trailing embers and dropping outlined TNT blocks that explode into lava-filled craters around a central TNT altar.

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. Create a flat grass area and stand in the exact center where you want the bat swarm to circle.
  2. Run each of the 10 setup commands in your chat window one by one to create the scoreboard, red glowing team, floating TNT beacon, and starter bats.
  3. Place a line of 14 Repeating Command Blocks set to Always Active (or 1 Repeating block leading into 13 Chain Command Blocks).
  4. Paste the 14 loop commands into the command blocks in order. If you use a single repeating block with chain blocks, make sure every command is executed positioned at your center point.
  5. Step back and watch the glowing red bats multiply to 14 and start carpet-bombing the floor.

Use it with real players

To make the bat swarm follow a player instead of hovering around the center altar, replace ~ ~6 ~ in loop command 11 with the player's coordinates by wrapping it in /execute at @p run .... You can also give players a special control item so the bats only drop TNT when a player holds a Blaze Rod by adding if entity @p[nbt={SelectedItem:{id:"minecraft:blaze_rod"}}] to the TNT summoning command.

Remove it again 7 commands

  1. /kill @e[tag=c9_bat]
  2. /kill @e[tag=c9_tnt]
  3. /kill @e[tag=c9_core_vis]
  4. /kill @e[tag=c9_core]
  5. /kill @e[type=item]
  6. /team remove c9_red
  7. /scoreboard objectives remove c9_timer

FAQ

Why don't the bats die when their own TNT explodes?

All bats in the swarm are summoned with the Invulnerable:1b NBT tag, so blast damage and falling debris cannot hurt them while they fly around.

How can I stop the TNT from destroying my builds while keeping the explosion effects?

Change the TNT summon command in loop step 12 to summon a creeper with {Fuse:0,ignited:1b} and set /gamerule mob_griefing false, or summon the TNT over obsidian or water.

Commands used

/execute/gamerule/particle/playsound/scoreboard/summon/team/tp

Similar creations

Join 9Minecraft News & Guides