Build an automated castle entrance with a rising iron portcullis and a folding wooden drawbridge over a glowing magma moat using block display entities.
Machines & MechanismsMedievalFireOrangeBlackWhiteMap MakingAdventure MapDecorationBlock displaysSmooth animation (interpolation)Block building (fill/setblock/clone)Sounds21+ commands
The Colossal Fortress Gate turns a flat plain into the guarded entrance of a stone citadel. Two bastion towers frame a deep magma-lit moat, while an oversized wooden drawbridge and a heavy iron portcullis move smoothly using block display entities and transformation matrices.
On a repeating cycle, the iron grate slides upward into the archway as the drawbridge rotates down across the lava gap, kicking up sparks, smoke, and debris when the heavy timber slams into place.
/scoreboard objectives add c9_gate dummy/scoreboard players set #t c9_gate 0/fill ~-6 ~-1 ~-2 ~6 ~-1 ~5 cobblestone/fill ~-6 ~ ~-1 ~6 ~11 ~1 stone_bricks/fill ~-6 ~ ~-2 ~-4 ~12 ~2 polished_deepslate/fill ~4 ~ ~-2 ~6 ~12 ~2 polished_deepslate/fill ~-3 ~ ~-1 ~3 ~7 ~1 air/fill ~-3 ~-1 ~2 ~3 ~-1 ~5 magma_block/summon block_display ~ ~ ~0.4 {Tags:["c9_all","c9_port"],interpolation_duration:40,teleport_duration:2,block_state:{Name:"minecraft:iron_bars"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-3.5f,0f,0f],scale:[7f,8f,1f]}}/summon block_display ~ ~ ~1.5 {Tags:["c9_all","c9_bridge"],interpolation_duration:40,teleport_duration:2,block_state:{Name:"minecraft:spruce_planks"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-3.5f,0f,0f],scale:[7f,7.5f,0.6f]}}/scoreboard players add #t c9_gate 1/execute if score #t c9_gate matches 180.. run scoreboard players set #t c9_gate 0/execute if score #t c9_gate matches 10 as @e[tag=c9_port] run data merge entity @s {start_interpolation:0,interpolation_duration:40,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-3.5f,6.5f,0f],scale:[7f,8f,1f]}}/execute if score #t c9_gate matches 10 as @e[tag=c9_bridge] run data merge entity @s {start_interpolation:0,interpolation_duration:40,transformation:{left_rotation:[0.7071f,0f,0f,0.7071f],right_rotation:[0f,0f,0f,1f],translation:[-3.5f,0.5f,0f],scale:[7f,7.5f,0.6f]}}/execute if score #t c9_gate matches 100 as @e[tag=c9_port] run data merge entity @s {start_interpolation:0,interpolation_duration:35,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-3.5f,0f,0f],scale:[7f,8f,1f]}}/execute if score #t c9_gate matches 100 as @e[tag=c9_bridge] run data merge entity @s {start_interpolation:0,interpolation_duration:35,transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[-3.5f,0f,0f],scale:[7f,7.5f,0.6f]}}/execute if score #t c9_gate matches 10..50 run particle crit ~-3.2 ~7 ~1.5 0.1 0.2 0.1 0.1 5 force/execute if score #t c9_gate matches 10..50 run particle crit ~3.2 ~7 ~1.5 0.1 0.2 0.1 0.1 5 force/execute if score #t c9_gate matches 100..135 run particle large_smoke ~ ~4 ~0.5 3 2 0.2 0.02 6 force/execute if score #t c9_gate matches 50 run particle campfire_cosy_smoke ~ ~0.2 ~5 3 0.1 2 0.01 45 force/execute if score #t c9_gate matches 50 run playsound minecraft:entity.iron_golem.hurt master @a ~ ~ ~ 1.5 0.5/execute if score #t c9_gate matches 135 run particle block{block_state:{Name:"minecraft:stone_bricks"}} ~ ~0.2 ~0.5 3.5 0.2 0.5 0.2 80 force/execute if score #t c9_gate matches 135 run playsound minecraft:block.anvil.land master @a ~ ~ ~ 1.2 0.6/particle lava ~ ~-0.2 ~3.5 2.5 0.1 1 0.1 1 forcesetup #9 Summons the portcullis as a single <code>block_display</code> entity holding iron bars, scaled up to 7 blocks wide by 8 blocks tall using the <code>transformation</code> compound.setup #10 Summons the drawbridge using a spruce planks <code>block_display</code> scaled to 7 by 7.5 blocks so it fills the archway when standing upright.loop #3 At tick 10, updates the portcullis translation Y value to <code>6.5f</code> over 40 ticks (2 seconds), smoothly sliding the iron gate upward into the stone wall.loop #4 At tick 10, applies a 90-degree X-axis quaternion rotation <code>[0.7071f,0f,0f,0.7071f]</code> to the drawbridge so it hinges down flat over the magma moat.loop #10 At tick 50, right when the 40-tick drawbridge interpolation finishes, bursts <code>campfire_cosy_smoke</code> across the landing zone to sell the weight of the bridge.


Recorded on our own test server: 69 frames at about 9.8 fps. Our image check saw: A stone gate with two towers has a wooden drawbridge that rotates down over magma blocks while an iron bar slides upwards.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To let players control the gate with a lever instead of running on a timer, remove the first two scoreboard clock commands from the loop. Wire a lever to two impulse command blocks: one that sets #t c9_gate to 10 (or runs the tick 10 /data merge commands directly) to open the gate, and an inverted branch that runs the tick 100 /data merge commands to close it. Note that block displays do not have collision boxes automatically; if you want players to walk across the lowered bridge or be blocked by the portcullis, place and clear minecraft:barrier blocks at the same ticks.
/kill @e[tag=c9_all]/scoreboard objectives remove c9_gate/fill ~-6 ~ ~-2 ~6 ~12 ~5 air/fill ~-6 ~-1 ~-2 ~6 ~-1 ~5 grass_blockBlock display entities are purely visual and have no hitbox. For a survival build, pair the opening and closing commands with a /fill command that places or removes barrier blocks inside the archway.
Change the interpolation_duration value inside the /data merge commands in the loop. A value of 40 takes 2 seconds (40 game ticks), while 80 takes 4 seconds.
▶Self-Folding Damask Steel Katana ForgeMachines & MechanismsHard24 cmds
▶Automated Siege TrebuchetMachines & MechanismsHard24 cmds
▶Autonomous Glassblowing Kiln WorkshopMachines & MechanismsHard24 cmds
▶Gothic Cathedral Organ Pipe SymphonyMachines & MechanismsHard22 cmds
▶Holographic Magnetic Tokamak Fusion ConfinementMachines & MechanismsExpert26 cmds
▶Kinematic Radial Aircraft Engine IgnitionMachines & MechanismsExpert24 cmds