Another example proving that crime doesn’t pay — and can sometimes get you killed:

An upstate New York marijuana grower accidentally killed himself with the booby trap he’d set up to protect his plants, police said.

Daniel Ricketts was almost decapitated Saturday after he drunkenly drove his quad bike into barely visible thin piano wire strung up around his plantation in Berne, Albany County.

The 50-year-old was thrown from his Honda Foreman, his head almost entirely severed from his body.

Hikers spotted his lifeless corpse and called cops. Police also found barbed wire and a leg trap used to catch coyotes surrounding the four large plants.

Ricketts was pronounced dead at the scene by Albany County Coroner Paul Marra.

May he rest in peace.