A 35-year-old man will be sentenced next month after pleading guilty to the production of Class B drugs.
Bradford Crown Court heard how Neil Highley of Linhurst Mount, Todmorden, grew 27 cannabis plants at his home for personal use.
Judge Jonathan Rose assured Highley that he did not want to send him to prison, but was unsure of how to deal with him because Highley’s doctor had deemed him unfit for work.
He said: “I’m not sending you to prison - I don’t think it will help you.
“There does need to be a punishment for this - the punishment I have in mind is unpaid work.”
He told Highley he must return to Bradford Crown Court on October 2 following a report from his GP.