Build a self-playing garden defense in vanilla Minecraft where animated pea-turrets fire green projectiles and explosive blasts at marching zombies.
Custom MobsNatureHorrorGreenOrangeMini-gameMap MakingParticlesBlock displaysScoreboard timersExecute chainsSummoned mobsBlock building (fill/setblock/clone)Glowing outlines21+ commands
This command creation builds an automated garden defense showcase across a five-lane emerald lawn. Five animated botanical turrets sit behind protective oak walls on the left side while waves of armored undead march across from the right.
Using block display entities and scoreboard timers, the flora automatically track incoming targets and fire glowing slime-pea projectiles. Every third volley charges up an orange explosive blast that detonates on impact, knocking back and eliminating nearby zombies.
/scoreboard objectives add c9_t dummy/fill ~-9 ~-1 ~-4 ~9 ~-1 ~4 emerald_block/fill ~-6 ~ ~-4 ~-6 ~ ~4 oak_wood/summon marker ~ ~ ~ {Tags:["c9_e","c9_ctrl"]}/summon block_display ~-8 ~ ~-4 {Tags:["c9_e","c9_plant"],block_state:{Name:"minecraft:melon"},Glowing:1b,glow_color_override:65280,transformation:{translation:[-0.35f,0.1f,-0.35f],scale:[0.7f,0.7f,0.7f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/summon block_display ~-8 ~ ~-2 {Tags:["c9_e","c9_plant"],block_state:{Name:"minecraft:melon"},Glowing:1b,glow_color_override:65280,transformation:{translation:[-0.35f,0.1f,-0.35f],scale:[0.7f,0.7f,0.7f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/summon block_display ~-8 ~ ~ {Tags:["c9_e","c9_plant"],block_state:{Name:"minecraft:melon"},Glowing:1b,glow_color_override:65280,transformation:{translation:[-0.35f,0.1f,-0.35f],scale:[0.7f,0.7f,0.7f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/summon block_display ~-8 ~ ~2 {Tags:["c9_e","c9_plant"],block_state:{Name:"minecraft:melon"},Glowing:1b,glow_color_override:65280,transformation:{translation:[-0.35f,0.1f,-0.35f],scale:[0.7f,0.7f,0.7f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/summon block_display ~-8 ~ ~4 {Tags:["c9_e","c9_plant"],block_state:{Name:"minecraft:melon"},Glowing:1b,glow_color_override:65280,transformation:{translation:[-0.35f,0.1f,-0.35f],scale:[0.7f,0.7f,0.7f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/scoreboard players add @e[tag=c9_ctrl] c9_t 1/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 1..60 as @e[tag=c9_plant] at @s run particle happy_villager ~ ~0.4 ~ 0.2 0.2 0.2 0 1/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 15 run summon zombie ~8 ~ ~-4 {Tags:["c9_e","c9_z"],NoAI:1b,Silent:1b,Rotation:[90f,0f],armor_items:[{},{},{},{id:"minecraft:leather_helmet",count:1}]}/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 30 run summon husk ~8 ~ ~ {Tags:["c9_e","c9_z"],NoAI:1b,Silent:1b,Rotation:[90f,0f],armor_items:[{},{},{},{id:"minecraft:golden_helmet",count:1}]}/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 45 run summon zombie ~8 ~ ~4 {Tags:["c9_e","c9_z"],NoAI:1b,Silent:1b,Rotation:[90f,0f],armor_items:[{},{},{},{id:"minecraft:iron_helmet",count:1}]}/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 60 run summon zombie ~8 ~ ~-2 {Tags:["c9_e","c9_z"],NoAI:1b,Silent:1b,Rotation:[90f,0f],armor_items:[{},{},{},{id:"minecraft:copper_helmet",count:1}]}/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 25 as @e[tag=c9_plant] at @s run summon block_display ~0.6 ~0.4 ~ {Tags:["c9_e","c9_pea"],block_state:{Name:"minecraft:slime_block"},Glowing:1b,glow_color_override:65280,transformation:{translation:[-0.15f,-0.15f,-0.15f],scale:[0.3f,0.3f,0.3f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 50 as @e[tag=c9_plant] at @s run summon block_display ~0.6 ~0.4 ~ {Tags:["c9_e","c9_pea","c9_bomb"],block_state:{Name:"minecraft:magma_block"},Glowing:1b,glow_color_override:16744448,transformation:{translation:[-0.2f,-0.2f,-0.2f],scale:[0.4f,0.4f,0.4f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}/execute as @e[tag=c9_pea] at @s run tp @s ~0.45 ~ ~/execute as @e[tag=c9_pea] at @s run particle dust{color:[0.2,1.0,0.2],scale:1.0} ~ ~ ~ 0.05 0.05 0.05 0 2/execute as @e[tag=c9_z] at @s run tp @s ~-0.07 ~ ~/execute as @e[tag=c9_pea] at @s if entity @e[tag=c9_z,distance=..1.1] run particle explosion ~ ~0.5 ~ 0.1 0.1 0.1 0 1 force/execute as @e[tag=c9_pea] at @s if entity @e[tag=c9_z,distance=..1.1] run damage @e[tag=c9_z,distance=..1.4,limit=1] 7 generic/execute if score @e[tag=c9_ctrl,limit=1] c9_t matches 60.. run scoreboard players set @e[tag=c9_ctrl] c9_t 0/kill @e[tag=c9_pea,x=10,dx=20]setup #5 Summons the first melon block display turret with green glowing outline and scaled-down transformation matrix on the far left of the lawn.loop #1 Advances the master 60-tick loop counter stored on the controller marker entity.loop #3 Spawns a helmeted, AI-disabled zombie facing left at the end of a lane on specific tick intervals.loop #7 At tick 25, every botanical turret fires a scaled slime block display projectile tagged as a pea.loop #8 At tick 50, every turret fires a larger glowing magma block projectile that acts as a heavy explosive shot.loop #13 Detects when a projectile comes within 1.1 blocks of an undead target and deals 7 generic damage to eliminate them.


Recorded on our own test server: 51 frames at about 8.4 fps. Our image check saw: Five botanical turrets behind an oak log barrier on a five-lane emerald block lawn shoot glowing green and orange projectiles at advancing zombies.
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 plant their own turrets anywhere in a survival world, summon the c9_plant block display at the location of a dropped melon seed item: /execute at @e[type=item,nbt={Item:{id:"minecraft:melon_seeds"}}] run summon block_display ~ ~ ~ {Tags:["c9_e","c9_plant"],block_state:{Name:"minecraft:melon"},transformation:{translation:[-0.35f,0.1f,-0.35f],scale:[0.7f,0.7f,0.7f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}, then kill the seed item right after.
/kill @e[tag=c9_e]/scoreboard objectives remove c9_t/fill ~-9 ~ ~-4 ~9 ~2 ~4 air/fill ~-9 ~-1 ~-4 ~9 ~-1 ~4 grass_blockThe helmets prevent the zombies from burning in sunlight so only the botanical turrets damage them.
Lower the tick reset threshold in the second-to-last loop command from 60 to 40 and adjust the projectile spawn ticks accordingly.
▶Toxic Aura Sheep Command CreationCustom MobsEasy24 cmds
▶Botanical Undead DefenseCustom MobsHard26 cmds
▶Camouflaged Ambush MonsterCustom MobsMedium24 cmds
▶Custom Acid-Spitting Hover BugCustom MobsHard24 cmds
▶Festive Gourd Boss ShowcaseCustom MobsHard26 cmds
▶Flying Amphibian ChimeraCustom MobsEasy22 cmds