A sex offender moved out after his home was targeted by vigilantes.
But James Petty fell foul of the law after failing to tell police where he was living for nearly three months.
The 20-year-old was ordered to sign the sex offenders’ register following his conviction for raping a girl aged under 13.
As part of this he was required to tell police when he moved and he initially registered his address as Roundway in Honley.
However, police were not notified when he left his mum’s home following some tensions there.
Prosecutor Vanessa Jones told Kirklees magistrates that Petty’s whereabouts were then unknown between June 1 and August 30 this year.
He had no fixed address and was sleeping where he could but police were not made aware of this change in his circumstances.
In October 2015 the then 18-year-old was sentenced by a judge at Leeds Crown Court to a suspended jail term for raping the schoolgirl.
He was told to sign the sex offenders’ register until October 2025.
His solicitor Philip Axon explained: “The offence caused a number of difficulties, the windows were being put through and there was damage and graffiti.
“His mum had to be rehoused after 32 years at the same address and, given his age, she didn’t want it following her to the new address.
“This was understandable and he’s felt a lot of guilt for bringing this on his mum.
“Having been kicked out of the family home he’s been sleeping rough and staying at the homes of various friends.
“The one thing that didn’t register with him was to go to the police station and say he was homeless.
“While it’s an unacceptable period this isn’t somebody who is deliberately trying to avoid cooperating with the authorities.”
Mr Axon added that, should his client be allowed his liberty, the first thing he planned to do was to go to Huddersfield Police Station and register himself as homeless.
Petty, who appeared in court from custody, pleaded guilty to breaching his notification requirements.
Magistrates told Petty that they felt that he was “quite negligent” in ignoring the restrictions for such a long time.
They sentenced him to a community order as a direct alternative to custody.
This will include 25 days of rehabilitation activities and 150 hours of unpaid work.
They also ordered him to pay £85 court costs.