Details emerged, on Thursday, May 18, as Shane Currie (46), with an address listed as Victoria Street in Belfast, admitted breaching a Sexual Offences Prevention Order (SOPO).
As part of the Order he was not to have association with children unless with the approval of his Designated Risk Manager 'save for every day inadvertent and unavoidable contact'.
He pleaded guilty to breaching the Order on August 30 last year.
Ballymena Magistrates' Court heard he had been living in the Ballymena area at the time of the breach.
Details of the offence for which he received the SOPO were not disclosed but it was heard it had been given to him at Magherafelt Magistrates' Court in 2020.
However, the Ballymena Court was told that on April 27 this year, the defendant was given Probation at court in Belfast for breaching the SOPO on February 3, 2023, by failing to make a notification about a change of a mobile phone.
Regarding August 30 last year, a prosecutor said police attended Currie's home in the "early afternoon" and there were "four or five young children in and around eight to 10 years old exiting the address".
The prosecutor said the children "locked the front door using the key. So they had his key".
She said police asked the children where Currie was and "one of the boys said Shane was at this child's dad's house and that they indicated they were over at his house playing with the hamster and then he goes and gets Shane and returns.
"So the children had a key to his house to enter as they pleased," the prosecutor added.
A defence lawyer said police had gone to the address in connection with a SOPO condition regarding a phone and "on that occasion there was nothing wrong with his phone".
The barrister said Currie "had a hamster" and a child of a "friend" knew he had it and a key was given to the youngster by the defendant.
District Judge Nigel Broderick said: "That was quite foolish when he is subject to a SOPO. Does he have any other pets that might attract the interest of children on his premises?"
The defence lawyer said he "couldn't comment" but said Currie accepted he had been "very foolish" and "remorseful".
The lawyer added: "Effectively the child knew that he had a hamster. The problem in the area, he was worried for his own safety, if someone in the area was to know the reason why he shouldn't be allowed near children. However that is no excuse".
The barrister accepted it was Currie's responsibility to abide by the SOPO conditions.
The lawyer said the defendant no longer lives in the "Ballymena area" where the incident happened and is now living in Belfast.
Judge Broderick said the SOPO was there to prevent re-offending and he said he took a "dim view" of the breach.
The judge added: "This hamster story, I am not sure if it bears up to any great degree of scrutiny".
He said Currie was "treading a very fine line" and "not without some hesitation" he was replicating the Order recently given at the Belfast Court - a two-year Probation Order.
The judge warned the defendant: "I want to make it very clear. If you breach this Order a third time there is a real likelihood you will get an immediate custodial sentence."