Mr Joyce, who was expecting the birth of his girlfriend’s baby in just three months, was stabbed up to four times on Thursday night in St Cronan’s estate in Swords, north Dublin.
Gardaí said the incident was sparked over “a relatively minor disagreement” centring around relationships between a girl and the attacker and the intended target.
The suspected killer, aged 22, handed himself over to gardaí yesterday morning and made admissions during questioning. He is expected to be charged.
The incident occurred as a group of up to 10 youths enjoyed the fine summer weather, drinking and, in some cases, smoking cannabis on a green.
Locals said there was trouble brewing during the day and evening and gardaí were called to the scene.
Garda sources said there was friction within the group, between the would-be killer and another man over a girl, who was also pregnant, but said there was no indication of potential violence.
Gardaí spoke to the youths and took the 22-year-old away for a drugs search, which took place at Swords Station at around 7pm, two hours before the attack. There was no knife found on him at this stage.
When the 22-year-old, from Rush, north Dublin, was released he went back to the green.
He started rowing again with the other man over his current girlfriend and the other man’s former girlfriend. Mr Joyce also knew the girl.
Just before 9pm, the 22-year-old went to a friend’s house and took two kitchen knives from a knife-block.
“He went back in an agitated state with two knives,” said a garda source.
He said Mr Joyce intervened and “tried to prevent” the attacker stabbing the other man. “Joyce stood in and got stabbed.”
Gardaí are investigating local reports that Mr Joyce had armed himself with a shovel before the attacker had come back with knives.
Mr Joyce was knifed three or four times, with one wound cutting a main artery in his neck or chest.
“It’s a real tragedy,” said the Garda source. “He was not in dispute with the attacker. He was not the fella supposed to be targeted. Joyce was a harmless enough fella.”
Gardaí have recovered knives, but are still looking for “other items”, including the shovel.
Mr Joyce’s girlfriend, Alison Colgan, who is six months’ pregnant, said: “We went down to the green with a few friends and there was a row going on and James tried to stop it.
“And then this guy came over, we really didn’t know him, we just know him to see, and he had two knives up his sleeves and he just started stabbing James.”
The victim’s father, Patrick, said: “I ran down to see what was going on. The blood was pumping out of his chest and shoulder.”