Build a working castle gatehouse in vanilla Minecraft where a heavy wooden drawbridge smoothly lowers across a moat as the iron portcullis rises.
Animated BlocksMedievalWaterBlueOrangeBlackMap MakingAdventure MapDecorationBlock displaysSmooth animation (interpolation)Summoned mobsBlock building (fill/setblock/clone)Sounds21+ commands
Every good fortress needs an entrance that feels heavy and mechanical. This command creation builds a stone brick castle gatehouse complete with a water moat, an animated wooden drawbridge, and a sliding iron portcullis that operates automatically on a cycle.
By combining block_display entities with transformation matrices and smooth interpolation, the 3x5 wooden bridge pivots seamlessly around its base hinge over three seconds. As it slams down onto the far bank, a cloud of dust and water splash particles erupts while the iron bars crank upward into the archway.
/scoreboard objectives add c9_timer dummy/fill ~-5 ~-1 ~-5 ~5 ~-1 ~2 minecraft:water/fill ~-5 ~ ~2 ~5 ~6 ~4 minecraft:stone_bricks/fill ~-5 ~7 ~2 ~5 ~7 ~4 minecraft:cobblestone_wall/fill ~-2 ~-1 ~2 ~2 ~-1 ~4 minecraft:spruce_planks/fill ~-1 ~ ~2 ~1 ~3 ~4 minecraft:air/setblock ~-2 ~3 ~1 minecraft:lantern[hanging=true]/setblock ~2 ~3 ~1 minecraft:lantern[hanging=true]/summon minecraft:block_display ~-1.5 ~ ~1.5 {Tags:["c9_entity","c9_bridge"],block_state:{Name:"minecraft:spruce_wood"},interpolation_duration:60,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[3f,5f,0.4f],translation:[0f,0f,0f]}}/summon minecraft:block_display ~-1.5 ~ ~2.9 {Tags:["c9_entity","c9_gate"],block_state:{Name:"minecraft:iron_bars",Properties:{east:"true",west:"true"}},interpolation_duration:50,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[3f,4f,0.2f],translation:[0f,0f,0f]}}/scoreboard players add #gate c9_timer 1/execute if score #gate c9_timer matches 200.. run scoreboard players set #gate c9_timer 0/execute if score #gate c9_timer matches 10 as @e[tag=c9_bridge] run data merge entity @s {start_interpolation:0,interpolation_duration:60,transformation:{left_rotation:[-0.7071f,0f,0f,0.7071f],right_rotation:[0f,0f,0f,1f],scale:[3f,5f,0.4f],translation:[0f,0f,0f]}}/execute if score #gate c9_timer matches 25 as @e[tag=c9_gate] run data merge entity @s {start_interpolation:0,interpolation_duration:50,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[3f,4f,0.2f],translation:[0f,3.2f,0f]}}/execute if score #gate c9_timer matches 10..70 if score #gate c9_timer matches ..70 run particle minecraft:crit ~-1.5 ~4 ~1.5 0 0 0 0.1 2/execute if score #gate c9_timer matches 10..70 if score #gate c9_timer matches ..70 run particle minecraft:crit ~1.5 ~4 ~1.5 0 0 0 0.1 2/execute if score #gate c9_timer matches 70 run playsound minecraft:entity.zombie.attack_wooden_door master @a ~ ~ ~ 1 0.5/execute if score #gate c9_timer matches 70 run particle minecraft:campfire_cosy_smoke ~ ~0.2 ~-3.2 1.2 0.1 0.3 0.01 25/execute if score #gate c9_timer matches 70 run particle minecraft:splash ~ ~0.2 ~-2 1.5 0.1 1.5 0.2 50/execute if score #gate c9_timer matches 25 run playsound minecraft:block.iron_door.open master @a ~ ~2 ~3 1 0.6/execute if score #gate c9_timer matches 120 as @e[tag=c9_bridge] run data merge entity @s {start_interpolation:0,interpolation_duration:60,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[3f,5f,0.4f],translation:[0f,0f,0f]}}/execute if score #gate c9_timer matches 120 as @e[tag=c9_gate] run data merge entity @s {start_interpolation:0,interpolation_duration:50,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[3f,4f,0.2f],translation:[0f,0f,0f]}}/execute if score #gate c9_timer matches 120 run playsound minecraft:block.iron_door.close master @a ~ ~2 ~3 1 0.6/execute if score #gate c9_timer matches 180 run playsound minecraft:block.wooden_door.close master @a ~ ~2 ~1.5 1 0.6setup #9 Summons the wooden drawbridge using a single <code>block_display</code> entity scaled to 3 blocks wide, 5 blocks tall, and 0.4 blocks thick. Because display entities pivot around their own origin corner, placing it at the bottom-back corner lets it swing down like a real hinge.loop #3 At tick 10, this command merges a new <code>left_rotation</code> quaternion (<code>[-0.7071f,0f,0f,0.7071f]</code>) into the bridge entity, pitching it 90 degrees forward over the moat across a 60-tick (3-second) interpolation window.loop #4 At tick 25, the iron portcullis starts sliding straight up into the stone wall above the archway by changing its Y translation to <code>3.2f</code> over 50 ticks.loop #8 Right at tick 70 when the 60-tick drawbridge animation finishes, a puff of smoke and water splashes triggers at the end of the bridge along with a heavy wooden thud sound.


Recorded on our own test server: 58 frames at about 8.2 fps. Our image check saw: A stone brick castle gatehouse is shown with an animated wooden drawbridge tilting upward and an iron bar portcullis sliding down to close the entrance.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To trigger the drawbridge when a player walks up to the moat instead of on a repeating timer, replace the first two timer commands with a proximity check such as /execute if entity @a[distance=..8] to run the lowering commands, and /execute unless entity @a[distance=..8] to raise it back up. You can also place barrier blocks across the water at ~-1 ~-1 ~-3 ~1 ~-1 ~1 while the bridge is down so players can actually walk across the display entity.
/kill @e[tag=c9_entity]/scoreboard objectives remove c9_timer/fill ~-5 ~ ~-5 ~5 ~7 ~4 minecraft:air/fill ~-5 ~-1 ~-5 ~5 ~-1 ~4 minecraft:grass_blockBlock display entities are purely visual and do not have collision hitboxes by themselves. To walk across the bridge when it is lowered, place invisible barrier blocks at water level when the timer hits tick 70 and replace them with air at tick 120.
Edit the interpolation_duration value inside the third loop command. It is set to 60 ticks (3 seconds) by default; make sure you also adjust the tick 70 impact sound and particles to match your new duration.
/data/execute/fill/particle/playsound/scoreboard/setblock/summon
▶Shattered Sword Reforging RitualAnimated BlocksMedium24 cmds
▶Shattering Iceberg Calving Tsunami WaveAnimated BlocksHard26 cmds
▶Ancient Shrine GateAnimated BlocksMedium26 cmds
▶Automated Blueprint to Building ExtruderAnimated BlocksExpert24 cmds
▶Automated Castle ConstructionAnimated BlocksHard19 cmds
▶Block Display MiniaturizerAnimated BlocksMedium24 cmds