Automated Ceiling Spike Trap

Build an automated deepslate ceiling trap armed with three oversized glowing stalactites that slam down whenever a mob crosses the cyan sensor field.

Java EditionMini-games & UtilitiesEasy24 commandsTested on a real 26.2 & 26.3 server
Three glowing stalactites drop from a deepslate gantry to crush a target on a sensor floor. Download the GIF Video & GIF © www.9minecraft.net

Arenas & Mini-gamesDarkTechnologyCyanRedBlackAdventure MapMap MakingPvPBlock displaysSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)Sounds21+ commands

This command creation builds a deepslate overhead gantry armed with three massive, glowing stalactites made from block_display entities. A shimmering cyan sensor field guards the floor below, waiting for any wandering mob to step inside.

Once triggered, the sensor flashes a red warning alarm before violently dropping the three spikes to crush the target with an explosion effect, then smoothly winches the spikes back up into the ceiling for the next victim.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_trap dummy
  2. /fill ~-3 ~-1 ~-3 ~3 ~-1 ~3 minecraft:deepslate_tiles
  3. /setblock ~ ~-1 ~ minecraft:sculk_sensor
  4. /fill ~-4 ~0 ~-1 ~-4 ~9 ~1 minecraft:polished_deepslate
  5. /fill ~4 ~0 ~-1 ~4 ~9 ~1 minecraft:polished_deepslate
  6. /fill ~-4 ~9 ~-3 ~4 ~9 ~3 minecraft:deepslate_bricks
  7. /summon minecraft:marker ~ ~ ~ {Tags:["c9_core"]}
  8. /summon minecraft:block_display ~-2 ~5.5 ~ {Tags:["c9_spike"],teleport_duration:1,Glowing:1b,brightness:{sky:15,block:15},block_state:{Name:"minecraft:pointed_dripstone",Properties:{thickness:"tip",vertical_direction:"down"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.7f,0f,-0.7f],scale:[1.4f,3.5f,1.4f]}}
  9. /summon minecraft:block_display ~ ~5.5 ~ {Tags:["c9_spike"],teleport_duration:1,Glowing:1b,brightness:{sky:15,block:15},block_state:{Name:"minecraft:pointed_dripstone",Properties:{thickness:"tip",vertical_direction:"down"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.7f,0f,-0.7f],scale:[1.4f,3.5f,1.4f]}}
  10. /summon minecraft:block_display ~2 ~5.5 ~ {Tags:["c9_spike"],teleport_duration:1,Glowing:1b,brightness:{sky:15,block:15},block_state:{Name:"minecraft:pointed_dripstone",Properties:{thickness:"tip",vertical_direction:"down"}},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-0.7f,0f,-0.7f],scale:[1.4f,3.5f,1.4f]}}

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

  1. /execute as @e[tag=c9_core,limit=1] run scoreboard players add @s c9_trap 0
  2. /scoreboard players add #mob c9_trap 1
  3. /execute if score @e[tag=c9_core,limit=1] c9_trap matches 0 if score #mob c9_trap matches 25.. unless entity @e[tag=c9_mob,distance=..6] run summon minecraft:husk ~ ~0 ~-3.0 {Tags:["c9_mob"],PersistenceRequired:1b,Motion:[0.0,0.1,0.4]}
  4. /execute if score #mob c9_trap matches 25.. run scoreboard players set #mob c9_trap 0
  5. /execute if score @e[tag=c9_core,limit=1] c9_trap matches 0 run particle minecraft:dust{color:[0.1,0.9,1.0],scale:1.2} ~ ~0.25 ~ 1.4 0.1 1.4 0 12
  6. /execute if score @e[tag=c9_core,limit=1] c9_trap matches 1.. run scoreboard players add @e[tag=c9_core,limit=1] c9_trap 1
  7. /execute if score @e[tag=c9_core,limit=1] c9_trap matches 0 if entity @e[tag=c9_mob,distance=..2.6] run scoreboard players set @e[tag=c9_core,limit=1] c9_trap 1
  8. /execute if score @e[tag=c9_core,limit=1] c9_trap matches 2..10 run particle minecraft:dust{color:[1.0,0.1,0.1],scale:1.8} ~ ~0.5 ~ 1.8 0.3 1.8 0 18
  9. /execute if score @e[tag=c9_core,limit=1] c9_trap matches 11..15 as @e[tag=c9_spike] at @s run tp @s ~ ~-1.12 ~
  10. /execute if score @e[tag=c9_core,limit=1] c9_trap matches 16 as @e[tag=c9_mob,distance=..3.2] run damage @s 40 minecraft:falling_stalactite
  11. /execute if score @e[tag=c9_core,limit=1] c9_trap matches 16 run playsound minecraft:block.anvil.land hostile @a ~ ~ ~ 1 0.7
  12. /execute if score @e[tag=c9_core,limit=1] c9_trap matches 16 run particle minecraft:explosion ~ ~0.5 ~ 1.5 0.2 1.5 0 6
  13. /execute if score @e[tag=c9_core,limit=1] c9_trap matches 35..54 as @e[tag=c9_spike] at @s run tp @s ~ ~0.28 ~
  14. /execute if score @e[tag=c9_core,limit=1] c9_trap matches 55.. run scoreboard players set @e[tag=c9_core,limit=1] c9_trap 0

How it works

Frames from the test run

Automated Ceiling Spike Trap - frame 1Automated Ceiling Spike Trap - frame 2Automated Ceiling Spike Trap - frame 3

Recorded on our own test server: 55 frames at about 9.1 fps. Our image check saw: A deepslate gantry holds three glowing dripstone spikes that drop down onto a cyan-and-red particle sensor to crush a mob with an explosion effect.

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. Stand at the spot where you want the centre of the trap floor to be.
  2. Run each of the 10 setup commands once in chat to build the deepslate gantry, scoreboard objective, and three glowing ceiling spikes.
  3. Place 14 repeating command blocks (or 1 repeating followed by 13 chain command blocks) nearby and set them to Always Active.
  4. Paste the 14 loop commands into the command blocks in order.
  5. Watch as demo husks spawn and step into the cyan sensor zone, triggering the red warning particles and dropping the ceiling spikes.

Use it with real players

To make this trap defend your base against real players or natural monsters instead of spawning demo husks, omit loop commands 2, 3, and 4, and replace @e[tag=c9_mob,distance=..2.6] in loop command 7 and @e[tag=c9_mob,distance=..3.2] in loop command 10 with @e[type=!minecraft:marker,type=!minecraft:block_display,type=!minecraft:item,distance=..2.8].

Remove it again 6 commands

  1. /kill @e[tag=c9_spike]
  2. /kill @e[tag=c9_core]
  3. /kill @e[tag=c9_mob]
  4. /fill ~-4 ~0 ~-3 ~4 ~9 ~3 minecraft:air
  5. /fill ~-3 ~-1 ~-3 ~3 ~-1 ~3 minecraft:grass_block
  6. /scoreboard objectives remove c9_trap

FAQ

Why do the spikes stay aligned after firing many times?

They drop 1.12 blocks per tick for 5 ticks (5.60 blocks total) and rise 0.28 blocks per tick for 20 ticks (also 5.60 blocks total), so their height never drifts.

Can I change the damage of the falling spikes?

Yes, change the number 40 in the <code>/damage @s 40 minecraft:falling_stalactite</code> loop command to any amount of health points you want.

Commands used

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

Similar creations

Join 9Minecraft News & Guides