You can tell them about your knee injury without telling them that it happened at undocumented work. Your "objective" (whether a section on your resume or a paragraph in your cover letter) should mention it, in fact:
Seeking a [whatever you're applying for] position that uses my intensive knowledge of farming and landscaping, along with my superior [you-tell-me] skills, for [6 months, a year, whatever] while I recover from a knee injury.
If you think you wouldn't be hired if they knew it was temporary, then:
Seeking a [whatever you're applying for] position that uses my intensive knowledge of farming and landscaping, along with my superior [you-tell-me] skills and does not aggravate my existing knee injury.
In the interview, when asked "why do you want this job?" you can reply
I love farming and landscaping, but can't do it for at least [6 months] while my knee fully heals. I can get around fine, walking and living my daily life, but I can't do a lot of strenuous activity. So I'm looking for something a little less strenuous that still uses my particular skills. [Launch into what those are.]
Again, if you don't want to come clean about the temporary nature:
I love farming and landscaping, but can't do it since I hurt my knee. I can get around fine, walking and living my daily life, but I can't do a lot of strenuous activity. So I'm looking for something a little less strenuous that still uses my particular skills. [Launch into what those are.]
A smart employer will see (if you write it for them) a chance to take advantage of an opportunity to get someone who's not normally available for this kind of thing. For example, if you worked in a garden centre or at a farm supply store, that would not be as strenuous, but you'd bring a ton of experience to the picture. Try to find employers to whom both your previous background and the fact that farming's not an option right now are advantages, and make sure you tell them about that.
If someone asks such a personal question as "how did you hurt your knee?" you can just decline to answer. It just isn't relevant to a job interview.