Callum Langton, 21, had sexual conversations via social media with someone he believed to be a 14-year-old girl and discussed meeting up in York so they could have sex, said Kelly Clarke, prosecuting.
He also told her to keep their conversation secret, as “he could get into trouble having sex with her as he was 21 and she was 14 years old,” said the barrister at York Crown Court.
But the social media profile did not belong to a child. It was run by an adult member of an online paedophile hunting group, who tracked him down, confronted him and called police.
Judge Simon Hickey told Langton: “I don’t think you are a risk or a danger to the public.”
He passed an eight-month prison sentence, suspended for two years on condition Langton does a rehabilitation programme, 30 days’ rehabilitative activities and 100 hours’ unpaid work.
Langton will be on the sex offenders’ register for 10 years and is barred from working with children or vulnerable people.
He must pay £425 prosecution costs.
The judge declined a prosecution request that Langton be subject to a sexual harm prevention order enabling police to monitor his use of the internet.
Langton, of Leavening near Malton, pleaded guilty to attempted sexual communication with a child.
Ms Clarke said in March Langton sent a friend request to the paedophile hunter’s social profile.
The hunter repeatedly told Langton she was a “14-year-old girl” as their conversation turned sexual.
Langton sent the profile a sexual picture of himself and asked for a sexual photo from the “girl” which “she” never sent.
The hunter group went to his home on April 7 and when Langton admitted he had sent the messages, called police and Langton was arrested.
In a police interview he said he had had no intention of meeting the “girl” and had no sexual interest in children or young girls.
Mr Parsons said Langton had shown remorse.
His parents, who attended court to support him, were standing by him and were putting measures in place to help him after the court case was over.
They had persuaded a social worker to come out of retirement to work privately with Langton.