Minecraft Automatic Cactus Farming

I'm trying to build an automatic cactus farm and I need some help.

I know cacti must be placed on sand, and water/light are not required. The thing I don't know/understand is how to place a roof on top that will break the cactus when it grows.

I tried placing a dirt block two blocks above the first cactus, but rather than the cactus growing up to the dirt and breaking off, it just stops growing once it reaches the dirt.

What am I doing wrong here?


The trick is that you need the blocks to be adjacent to where the cactus will grow. This works because cacti cannot tolerate being adjacent to other blocks - they break off instead.

This tutorial has some good pictures and illustrates a farm with water to gather the fallen blocks automatically.