Build an automated medieval castle gate in Minecraft Java Edition. Watch a heavy iron portcullis grind open block-by-block with particles and sound effects.
Animated BlocksMedievalRoyalGoldWhiteAdventure MapDecorationCinematicBlock displaysBlock building (fill/setblock/clone)Sounds21+ commands
Every grand medieval build needs an impressive entrance. This command creation constructs a stone brick gatehouse with flanking towers, a cobblestone entryway, and a glowing golden statue waiting inside the courtyard. At the center stands a heavy iron bar portcullis held down by iron chains.
Using a scoreboard timer, the gate slowly grinds upward block-by-block with heavy metallic clanking sounds, puffs of dust, and flying sparks from the winches above. Once fully raised, a bell chimes to welcome visitors before the heavy gate slams back down into the floor.
/scoreboard objectives add c9_timer dummy/scoreboard players set #gate c9_timer 0/fill ~-7 ~-1 ~-4 ~7 ~-1 ~6 cobblestone/fill ~-6 ~ ~-1 ~6 ~8 ~1 stone_bricks/fill ~-6 ~ ~-2 ~-4 ~10 ~2 chiseled_stone_bricks/fill ~4 ~ ~-2 ~6 ~10 ~2 chiseled_stone_bricks/fill ~-7 ~8 ~-2 ~7 ~9 ~2 stone_brick_stairs[facing=south,half=top]/fill ~-3 ~ ~-2 ~3 ~5 ~2 air/fill ~-3 ~ ~ ~3 ~5 ~ iron_bars/summon block_display ~-0.5 ~ ~4.5 {Tags:["c9_statue"],Glowing:1b,glow_color_override:16766720,block_state:{Name:"minecraft:gold_block"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],scale:[1f,2.5f,1f],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 1 run fill ~-3 ~ ~ ~3 ~5 ~ iron_bars/execute if score #gate c9_timer matches 20 run fill ~-3 ~ ~ ~3 ~ ~ air/execute if score #gate c9_timer matches 45 run fill ~-3 ~1 ~ ~3 ~1 ~ air/execute if score #gate c9_timer matches 70 run fill ~-3 ~2 ~ ~3 ~2 ~ air/execute if score #gate c9_timer matches 95 run fill ~-3 ~3 ~ ~3 ~3 ~ air/execute if score #gate c9_timer matches 120 run fill ~-3 ~4 ~ ~3 ~4 ~ air/execute if score #gate c9_timer matches 20..120 run particle smoke ~ ~6 ~ 2 0.2 0.2 0.01 2 force/execute if score #gate c9_timer matches 20..120 run particle crit ~-3 ~5.5 ~ 0.1 0.1 0.1 0.2 3 force/execute if score #gate c9_timer matches 20..120 run particle crit ~3 ~5.5 ~ 0.1 0.1 0.1 0.2 3 force/execute if score #gate c9_timer matches 20..120 if score #gate c9_timer matches ..120 run particle dust{color:[0.6,0.6,0.6],scale:1.5f} ~ ~3 ~ 2 2 0.2 0.01 2 force/execute if score #gate c9_timer matches 20 run playsound block.iron_door.open master @a ~ ~3 ~ 2 0.5/execute if score #gate c9_timer matches 70 run playsound block.anvil.place master @a ~ ~4 ~ 1.5 0.6setup #1 Creates a dummy scoreboard objective named <code>c9_timer</code> to control the timing of the gate animation.setup #8 Carves out the 7x6 archway opening through the center of the stone brick wall.setup #10 Summons a glowing golden block display inside the courtyard behind the gate so there is a bright focal point revealed as the bars rise.loop #4 At tick 20 (1 second in), the bottom row of iron bars is replaced with air, starting the upward step-by-step opening sequence.loop #10 While the gate is actively moving between ticks 20 and 120, critical hit spark particles emit from the upper left corners where the lifting chains would grind.loop #14 Plays a low-pitched anvil clang halfway through the lift to sell the heavy metallic weight of the portcullis.


Recorded on our own test server: 60 frames at about 9.9 fps. Our image check saw: A stone brick gatehouse with a cobblestone entryway and glowing gold block pillars in front, where an iron bar portcullis raises upward one block with particle effects.
Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.
To make the gate open only when a player approaches instead of looping continuously, change the first loop command to /execute if entity @a[distance=..8] if score #gate c9_timer matches ..130 run scoreboard players add #gate c9_timer 1, and add a command to reset #gate to 1 whenever no players are within 8 blocks.
/kill @e[tag=c9_statue]/scoreboard objectives remove c9_timer/fill ~-7 ~ ~-4 ~7 ~10 ~6 air/fill ~-7 ~-1 ~-4 ~7 ~-1 ~6 grass_blockYes. Adjust the tick numbers in the loop commands (20, 45, 70, 95, 120). Bringing those numbers closer together makes the gate open faster, while spacing them further apart makes it rise more slowly.
Absolutely. Replace every instance of iron_bars in the setup and loop commands with oak_fence, spruce_fence, or chains to fit your castle palette.
▶Colossal Loot Chest Display FountainAnimated BlocksMedium23 cmds
▶Crystal Chandelier Domino ShatterAnimated BlocksHard22 cmds
▶Grand Hinged Castle Gate & DrawbridgeAnimated BlocksMedium24 cmds
▶Morphing Banquet HallAnimated BlocksHard23 cmds
▶Waving Tricolor Banner DisplayAnimated BlocksEasy24 cmds
▶Plummeting Colossal ChandelierAnimated BlocksMedium24 cmds