Build an automated Plants vs. Zombies lawn defense in vanilla Minecraft with Peashooter turrets, Wall-nut barriers, and waves of marching zombies.
Custom MobsNatureHorrorGreenGoldMini-gameMap MakingAdventure MapBlock displaysItem displaysArmor standsSummoned mobsBlock building (fill/setblock/clone)Glowing outlines21+ commands
Botanical Undead Defense turns a Minecraft lawn into a five-lane tower defense arena inspired by Plants vs. Zombies. Custom Peashooters built from block displays and armor stands automatically fire glowing green slime peas down their lanes, while oversized potato Wall-nuts hold the line.
Waves of helmet-wearing zombies shamble in from the dirt road on the right, getting knocked back and splattered by bursts of lime particles whenever a pea hits its mark.
/scoreboard objectives add c9_timer dummy/fill ~-12 ~-1 ~-7 ~12 ~-1 ~7 moss_block/fill ~-12 ~-1 ~-4 ~12 ~-1 ~-2 grass_block/fill ~-12 ~-1 ~2 ~12 ~-1 ~4 grass_block/fill ~-13 ~-1 ~-7 ~-12 ~-1 ~7 oak_planks/fill ~11 ~-1 ~-7 ~12 ~-1 ~7 rooted_dirt/summon marker ~-10 ~ ~-6 {Tags:["c9_plant_spot"]}/summon marker ~-10 ~ ~-3 {Tags:["c9_plant_spot"]}/summon marker ~-10 ~ ~ {Tags:["c9_plant_spot"]}/summon marker ~-10 ~ ~3 {Tags:["c9_plant_spot"]}/scoreboard players add #tick c9_timer 1/execute if score #tick c9_timer matches 1 run summon marker ~-10 ~ ~6 {Tags:["c9_plant_spot"]}/execute if score #tick c9_timer matches 2 at @e[tag=c9_plant_spot] run summon armor_stand ~ ~ ~ {Tags:["c9_plant","c9_shooter"],Invisible:1b,NoGravity:1b,Marker:1b,Small:1b,equipment:{head:{id:"minecraft:lime_concrete",count:1}}}/execute if score #tick c9_timer matches 2 at @e[tag=c9_plant_spot] run summon block_display ~-0.25 ~ ~-0.25 {Tags:["c9_plant","c9_deco"],block_state:{Name:"minecraft:lime_concrete"},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0.3f,0f],scale:[0.5f,0.6f,0.5f]}}/execute if score #tick c9_timer matches 2 at @e[tag=c9_plant_spot] run summon item_display ~3 ~0.6 ~ {Tags:["c9_plant","c9_wall"],item:{id:"minecraft:potato",count:1},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[1.6f,1.8f,1.6f]}}/execute if score #tick c9_timer matches 25 at @e[tag=c9_shooter] run summon item_display ~0.5 ~0.8 ~ {Tags:["c9_pea"],Glowing:1b,glow_color_override:65280,item:{id:"minecraft:slime_ball",count:1},transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[0.8f,0.8f,0.8f]}}/execute if score #tick c9_timer matches 25 at @e[tag=c9_shooter] run particle happy_villager ~0.5 ~0.8 ~ 0.15 0.15 0.15 0.05 4/execute as @e[tag=c9_pea] at @s run tp @s ~0.5 ~ ~/execute at @e[tag=c9_pea] run particle item{item:{id:"minecraft:lime_dye"}} ~ ~ ~ 0.05 0.05 0.05 0.02 2/execute as @e[tag=c9_pea] at @s if entity @e[tag=c9_zom,distance=..1.5] run particle explosion ~ ~0.5 ~ 0.1 0.1 0.1 0.05 1/execute at @e[tag=c9_pea] as @e[tag=c9_zom,distance=..1.5,limit=1] at @s run damage @s 7 minecraft:magic/execute as @e[tag=c9_pea] at @s if entity @e[tag=c9_zom,distance=..1.5] run kill @s/execute if score #tick c9_timer matches 28 at @r[tag=c9_plant_spot] run summon zombie ~21 ~ ~ {Tags:["c9_zom"],Rotation:[90f,0f],Health:18f,attributes:[{id:"minecraft:movement_speed",base:0.0f}],equipment:{head:{id:"minecraft:leather_helmet",count:1}}}/execute as @e[tag=c9_zom] at @s unless entity @e[tag=c9_wall,distance=..1.3] run tp @s ~-0.08 ~ ~ 90 0/execute if score #tick c9_timer matches 30.. run scoreboard players set #tick c9_timer 10/kill @e[tag=c9_pea,distance=24..]setup #3 The <code>/fill</code> commands stripe the lawn with alternating 3-block-wide lanes of moss blocks and grass blocks, bordered by an oak porch on the left and a rooted dirt spawn road on the right.loop #5 Summons an <code>item_display</code> showing a potato scaled up to 1.6x width and 1.8x height three blocks ahead of each Peashooter to act as a Wall-nut barrier.loop #6 Every 20 ticks (when <code>#tick</code> hits 25), each Peashooter spawns a glowing green <code>slime_ball</code> item display tagged <code>c9_pea</code>.loop #11 Checks for a zombie within 1.5 blocks of any flying pea and applies 7 points of magic damage using the <code>/damage</code> command before the next command deletes the pea.loop #13 Picks a random lane marker with <code>@r[tag=c9_plant_spot]</code> and spawns a leather-helmeted zombie 21 blocks to the right with its base movement speed set to 0 so it stays strictly in its lane.


Recorded on our own test server: 59 frames at about 9.8 fps. Our image check saw: A five-lane grassy lawn in Minecraft has green peashooter blocks and potato items on the left shooting green slime projectiles to the right, though no zombies are currently visible in these frames.
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 towers manually instead of spawning all five lanes at once, skip the marker summon commands in setup and give players spawn eggs named Peashooter or Wall-nut. Use an execute at @e[type=endermite,name="Peashooter"] command to summon the c9_plant_spot marker where the player places the egg, then teleport the endermite into the void.
/kill @e[tag=c9_plant_spot]/kill @e[tag=c9_plant]/kill @e[tag=c9_pea]/kill @e[tag=c9_zom]/scoreboard objectives remove c9_timer/fill ~-13 ~-1 ~-7 ~12 ~-1 ~7 grass_blockSince the defense game takes place during the day, the leather helmets stop the zombies from burning in the sunlight while also acting like the cone-head zombies from the original game.
Their <code>minecraft:movement_speed</code> attribute is set to <code>0.0f</code> when summoned, and a repeating teleport command moves them straight down the X-axis until they bump into a Wall-nut.
▶Toxic Aura Sheep Command CreationCustom MobsEasy24 cmds
▶Automated Botanical DefenseCustom MobsHard24 cmds
▶Camouflaged Ambush MonsterCustom MobsMedium24 cmds
▶Custom Acid-Spitting Hover BugCustom MobsHard24 cmds
▶Festive Gourd Boss ShowcaseCustom MobsHard26 cmds
▶Flying Amphibian ChimeraCustom MobsEasy22 cmds