Botanical Defense Grid

Build an automated PvZ-style garden defense where animated melon turrets fire glowing pea volleys across a checkered lawn to stop marching zombie waves.

Java EditionComplex Contraptions & CinematicsExpert24 commandsTested on a real 26.2 & 26.3 server
Glowing melon turrets defend a striped lawn against waves of marching zombies in Minecraft. Download the GIF Video & GIF © www.9minecraft.net

SimulationsNatureCuteGreenYellowMini-gameMap MakingBlock displaysItem displaysSmooth animation (interpolation)Riding & passengersSummoned mobsBlock building (fill/setblock/clone)21+ commands

The Botanical Defense Grid turns your Minecraft world into a live tower defense battlefield inspired by classic lawn defense games. Across a 3-lane checkered lawn, rows of glowing melon turrets automatically detect and fire bright green pea projectiles at relentless waves of helmeted zombies marching toward your flowerbeds.

Each turret smoothly recoils and expands using display entity transformations every time it shoots, while impacts trigger lime particle bursts and sound effects. Everything runs automatically using a single scoreboard clock and tagged entities.

1. Setup - type these once 10 commands

  1. /scoreboard objectives add c9_t dummy
  2. /fill ~-9 ~-1 ~-5 ~9 ~-1 ~5 lime_concrete
  3. /fill ~-9 ~-1 ~-3 ~9 ~-1 ~-1 green_concrete
  4. /fill ~-9 ~-1 ~1 ~9 ~-1 ~3 green_concrete
  5. /fill ~-10 ~ ~-5 ~-10 ~ ~5 oak_fence
  6. /fill ~9 ~-1 ~-5 ~10 ~-1 ~5 coarse_dirt
  7. /summon marker ~ ~ ~ {Tags:["c9_m"]}
  8. /summon block_display ~-8 ~ ~-4 {Tags:["c9_p","c9_e"],Glowing:1b,glow_color_override:65280,block_state:{Name:"minecraft:melon"},transformation:{translation:[-0.35f,0.0f,-0.35f],scale:[0.7f,0.7f,0.7f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},interpolation_duration:4,Passengers:[{id:"minecraft:item_display",Tags:["c9_e"],item:{id:"minecraft:Golden_Carrot"},transformation:{translation:[0.35f,0.5f,0.0f],scale:[0.6f,0.6f,0.8f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}]}
  9. /summon block_display ~-8 ~ ~ {Tags:["c9_p","c9_e"],Glowing:1b,glow_color_override:65280,block_state:{Name:"minecraft:melon"},transformation:{translation:[-0.35f,0.0f,-0.35f],scale:[0.7f,0.7f,0.7f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},interpolation_duration:4,Passengers:[{id:"minecraft:item_display",Tags:["c9_e"],item:{id:"minecraft:Golden_Carrot"},transformation:{translation:[0.35f,0.5f,0.0f],scale:[0.6f,0.6f,0.8f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}]}
  10. /summon block_display ~-8 ~ ~4 {Tags:["c9_p","c9_e"],Glowing:1b,glow_color_override:65280,block_state:{Name:"minecraft:melon"},transformation:{translation:[-0.35f,0.0f,-0.35f],scale:[0.7f,0.7f,0.7f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]},interpolation_duration:4,Passengers:[{id:"minecraft:item_display",Tags:["c9_e"],item:{id:"minecraft:Golden_Carrot"},transformation:{translation:[0.35f,0.5f,0.0f],scale:[0.6f,0.6f,0.8f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}]}

2. Loop - one repeating command block each (Always Active) 14 commands

  1. /scoreboard players add @e[tag=c9_m] c9_t 1
  2. /execute if score @e[tag=c9_m,limit=1] c9_t matches 15 run execute at @e[tag=c9_p] run summon item_display ~0.6 ~0.45 ~ {Tags:["c9_b","c9_e"],Glowing:1b,glow_color_override:65280,item:{id:"minecraft:slime_ball"},transformation:{translation:[0f,0f,0f],scale:[0.5f,0.5f,0.5f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}
  3. /execute if score @e[tag=c9_m,limit=1] c9_t matches 15 run execute at @e[tag=c9_p] run data merge entity @s {start_interpolation:0,transformation:{translation:[-0.45f,0.0f,-0.45f],scale:[0.9f,0.5f,0.9f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}
  4. /execute if score @e[tag=c9_m,limit=1] c9_t matches 20 run execute at @e[tag=c9_p] run data merge entity @s {start_interpolation:0,transformation:{translation:[-0.35f,0.0f,-0.35f],scale:[0.7f,0.7f,0.7f],left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f]}}
  5. /execute if score @e[tag=c9_m,limit=1] c9_t matches 30 run summon zombie ~9 ~ ~-4 {Tags:["c9_z","c9_e"],NoAI:1b,Silent:1b,Health:10f,armor_items:[{},{},{},{id:"minecraft:leather_helmet",components:{"minecraft:dyed_color":16733440}}]}
  6. /execute if score @e[tag=c9_m,limit=1] c9_t matches 50 run summon zombie ~9 ~ ~ {Tags:["c9_z","c9_e"],NoAI:1b,Silent:1b,Health:10f,armor_items:[{},{},{},{id:"minecraft:iron_helmet"}]}
  7. /execute if score @e[tag=c9_m,limit=1] c9_t matches 70 run summon zombie ~9 ~ ~4 {Tags:["c9_z","c9_e"],NoAI:1b,Silent:1b,Health:10f,armor_items:[{},{},{},{id:"minecraft:leather_helmet",components:{"minecraft:dyed_color":16733440}}]}
  8. /execute if score @e[tag=c9_m,limit=1] c9_t matches 75.. run scoreboard players set @e[tag=c9_m] c9_t 0
  9. /execute as @e[tag=c9_b] at @s run tp @s ~0.45 ~ ~
  10. /execute at @e[tag=c9_b] run particle dust{color:[0.2,1.0,0.2],scale:1.0} ~ ~ ~ 0.05 0.05 0.05 0 2
  11. /execute as @e[tag=c9_b] at @s if entity @e[tag=c9_z,distance=..1.2] run particle item{item:{id:"minecraft:slime_block"}} ~ ~0.5 ~ 0.2 0.2 0.2 0.1 12
  12. /execute as @e[tag=c9_b] at @s if entity @e[tag=c9_z,distance=..1.2] run damage @e[tag=c9_z,distance=..1.2,limit=1] 4 magic
  13. /execute as @e[tag=c9_b] at @s if entity @e[tag=c9_z,distance=..1.2] run kill @s
  14. /execute as @e[tag=c9_z] at @s run tp @s ~-0.07 ~ ~ 90 0

How it works

Frames from the test run

Botanical Defense Grid - frame 1Botanical Defense Grid - frame 2Botanical Defense Grid - frame 3

Recorded on our own test server: 59 frames at about 9.7 fps. Our image check saw: A striped green lawn features three glowing melon turrets on the left firing projectiles at waves of helmeted zombies walking from the right.

Commands, video and screenshots: tested and recorded by www.9minecraft.net © 9Minecraft. Sharing a video or screenshot? Please credit www.9minecraft.net.

Build it in your world

  1. Stand in the middle of a flat open area with at least 20 blocks of space around you.
  2. Run each of the 10 Setup commands in chat one by one to build the striped lawn and spawn the three melon turrets.
  3. Place a line of 14 Repeating Command Blocks set to Always Active underneath or beside the lawn.
  4. Paste one Loop command into each repeating command block in order.
  5. Watch the turrets automatically squash, shoot glowing peas, and defend the fence from incoming waves of zombies.

Use it with real players

To let players plant their own turrets during gameplay, remove the last three setup commands and instead execute the turret summon command at a thrown snowball or dropped melon seed item: /execute at @e[type=item,nbt={Item:{id:"minecraft:melon_seeds"}}] run summon block_display ~ ~ ~ ... followed by killing the seed item.

Remove it again 5 commands

  1. /kill @e[tag=c9_e]
  2. /kill @e[tag=c9_m]
  3. /scoreboard objectives remove c9_t
  4. /fill ~-10 ~ ~-5 ~10 ~ ~5 air
  5. /fill ~-10 ~-1 ~-5 ~10 ~-1 ~5 grass_block

FAQ

How do I add more turrets to the lawn?

Copy any of the last three setup commands and change the X or Z coordinates to place a turret on any tile of the lawn. All turrets tagged c9_p will automatically fire together.

Why do the zombies walk smoothly without pathfinding AI?

They are spawned with NoAI:1b and moved 0.07 blocks per tick using /tp in the last loop command, keeping them strictly inside their assigned lawn lanes.

Commands used

/damage/data/execute/fill/kill/particle/scoreboard/summon/tp

Similar creations

Join 9Minecraft News & Guides