Spring-Loaded Proximity Traps

Buried proximity mines wait in the grass until wandering mobs approach, then rocket upward to waist height while spinning and explode in a fiery blast.

Java EditionWands, Weapons & ToolsEasy24 commandsTested on a real 26.2 & 26.3 server
A glowing half-buried TNT proximity mine detonates near wandering husks with explosion and flame particles. Download the GIF Video & GIF © www.9minecraft.net

TrapsFireTechnologyGreenOrangeRedPvPAdventure MapMini-gameParticlesItem displaysScoreboard timersExecute chainsSummoned mobsSoundsGlowing outlines21+ commands

Six compact TNT mines sit half-buried in the grass with a soft orange-red glow while test husks wander across the arena. As soon as a mob steps within two blocks of a buried trap, the mechanism springs upward to waist height, spinning rapidly with a trail of flame particles.

At the peak of its jump, each trap detonates in a burst of explosion particles and sound that damages and knocks back nearby mobs without breaking the grass platform. Detonated traps automatically re-arm in a fresh random spot so the demonstration runs continuously.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9 dummy
  2. /summon minecraft:item_display ~2 ~ ~2 {Tags:["c9_trap"],item:{id:"minecraft:tnt",count:1},Glowing:1b,glow_color_override:16729344,transformation:{translation:[0f,-0.12f,0f],left_rotation:[0f,0f,0f,1f],scale:[0.55f,0.55f,0.55f],right_rotation:[0f,0f,0f,1f]}}
  3. /summon minecraft:item_display ~-2 ~ ~2 {Tags:["c9_trap"],item:{id:"minecraft:tnt",count:1},Glowing:1b,glow_color_override:16729344,transformation:{translation:[0f,-0.12f,0f],left_rotation:[0f,0f,0f,1f],scale:[0.55f,0.55f,0.55f],right_rotation:[0f,0f,0f,1f]}}
  4. /summon minecraft:item_display ~2 ~ ~-2 {Tags:["c9_trap"],item:{id:"minecraft:tnt",count:1},Glowing:1b,glow_color_override:16729344,transformation:{translation:[0f,-0.12f,0f],left_rotation:[0f,0f,0f,1f],scale:[0.55f,0.55f,0.55f],right_rotation:[0f,0f,0f,1f]}}
  5. /summon minecraft:item_display ~-2 ~ ~-2 {Tags:["c9_trap"],item:{id:"minecraft:tnt",count:1},Glowing:1b,glow_color_override:16729344,transformation:{translation:[0f,-0.12f,0f],left_rotation:[0f,0f,0f,1f],scale:[0.55f,0.55f,0.55f],right_rotation:[0f,0f,0f,1f]}}
  6. /summon minecraft:item_display ~ ~ ~ {Tags:["c9_trap"],item:{id:"minecraft:tnt",count:1},Glowing:1b,glow_color_override:16729344,transformation:{translation:[0f,-0.12f,0f],left_rotation:[0f,0f,0f,1f],scale:[0.55f,0.55f,0.55f],right_rotation:[0f,0f,0f,1f]}}
  7. /summon minecraft:item_display ~ ~ ~4 {Tags:["c9_trap"],item:{id:"minecraft:tnt",count:1},Glowing:1b,glow_color_override:16729344,transformation:{translation:[0f,-0.12f,0f],left_rotation:[0f,0f,0f,1f],scale:[0.55f,0.55f,0.55f],right_rotation:[0f,0f,0f,1f]}}
  8. /scoreboard players set @e[tag=c9_trap] c9 0
  9. /summon minecraft:husk ~4 ~ ~-1 {Tags:["c9_mob"],PersistenceRequired:1b}
  10. /summon minecraft:husk ~-4 ~ ~1 {Tags:["c9_mob"],PersistenceRequired:1b}

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

  1. /execute store result score #mobs c9 if entity @e[tag=c9_mob]
  2. /execute if score #mobs c9 matches ..4 run summon minecraft:husk ~ ~ ~ {Tags:["c9_mob","c9_unplaced"],PersistenceRequired:1b}
  3. /tag @e[tag=c9_mob,distance=7.5..] add c9_unplaced
  4. /scoreboard players add @e[tag=c9_trap,scores={c9=1..}] c9 1
  5. /execute as @e[tag=c9_trap,scores={c9=0}] at @s if entity @e[tag=c9_mob,distance=..2.2] run scoreboard players set @s c9 1
  6. /execute as @e[tag=c9_trap,scores={c9=1..9}] at @s run tp @s ~ ~0.14 ~ ~45 ~
  7. /execute at @e[tag=c9_trap,scores={c9=1..9}] run particle minecraft:flame ~ ~0.1 ~ 0.06 0.06 0.06 0.03 3
  8. /execute at @e[tag=c9_trap,scores={c9=10..}] run particle minecraft:explosion_emitter ~ ~ ~ 0.2 0.2 0.2 0 1
  9. /execute at @e[tag=c9_trap,scores={c9=10..}] run playsound minecraft:entity.generic.explode master @a ~ ~ ~ 1 1.1
  10. /execute at @e[tag=c9_trap,scores={c9=10..}] as @e[tag=c9_mob,distance=..3.6] run damage @s 14 minecraft:explosion at ~ ~ ~
  11. /tag @e[tag=c9_trap,scores={c9=10..}] add c9_unplaced
  12. /scoreboard players set @e[tag=c9_trap,scores={c9=10..}] c9 0
  13. /spreadplayers ~ ~ 2.5 6.0 false @e[tag=c9_unplaced]
  14. /tag @e[tag=c9_unplaced] remove c9_unplaced

How it works

Frames from the test run

Spring-Loaded Proximity Traps - frame 1Spring-Loaded Proximity Traps - frame 2Spring-Loaded Proximity Traps - frame 3

Recorded on our own test server: 60 frames at about 9.9 fps. Our image check saw: In a grassy Minecraft arena, a half-buried TNT mine with an orange-red glow sits near wandering husks as explosion and flame particles damage and knock back nearby husks.

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. Clear a flat open grass area at least 15x15 blocks and stand at the center.
  2. Run all 10 setup commands once in order using chat or impulse command blocks to create the scoreboard, 6 buried traps, and initial test husks.
  3. Place 14 command blocks in a chain or stack near the center, all set to Repeating and Always Active.
  4. Paste each of the 14 loop commands into its own repeating command block in the listed order.
  5. Step back and watch the test husks wander into the field, launching traps to waist height before each blast.

Use it with real players

To make traps target real players or any hostile mob, change @e[tag=c9_mob,distance=..2.2] in the trigger command and @e[tag=c9_mob,distance=..3.6] in the damage command to @a (or @e[type=!item_display]). You can also remove the husk-spawning loop commands if you want to place traps manually in your own world using the trap /summon setup command.

Remove it again 3 commands

  1. /kill @e[tag=c9_trap]
  2. /kill @e[tag=c9_mob]
  3. /scoreboard objectives remove c9

FAQ

Do these traps break blocks when they explode?

No. The detonation uses explosion particles, sound, and the <code>/damage</code> command instead of live TNT entities, so your grass or build stays completely intact.

Can I change how high the traps jump before detonating?

Yes. Increase or decrease the vertical step <code>0.14</code> in the leap <code>/tp</code> command, or adjust the fuse limit from <code>9</code> and <code>10..</code> to change hang time.

Commands used

/damage/execute/particle/playsound/scoreboard/spreadplayers/summon/tag/tp

Similar creations

Join 9Minecraft News & Guides