David Medlam, 37, of no fixed abode, appeared before Sheffield Crown Court on Wednesday facing charges of possession of a firearm with intent to cause fear or violence.
On February 15, South Yorkshire Police received a call stating a man had been threatened by Medlam with a firearm.
The 35-year-old victim was stood outside with his son, in a garden on Yews Lane, when he was approached by a car.
Medlam got out of the car and threatened the victim with the gun stating that he would ‘get it’ if the child wasn’t present - he then fled the scene and it is believed he fired the gun as shots were heard.
Shortly after the incident, at around 1.40pm, the police received reports of a car potentially dealing drugs on Pontefract Road and upon arrival officers found Medlam at the scene.
He was arrested and the vehicles, a black Citroen C3 and a grey Ford Mondeo, were recovered for forensic purposes.
Detective Emma Shipley, who led the investigation, said: “Using a firearm to cause fear will not be tolerated in our communities.
“We want to ensure our communities are safe by taking as many firearms off the streets as possible and bringing those who think this type of behaviour is acceptable before the courts.”