Paul Gilligan died shortly after the attack in Bolton
A teenager who posted a message on the website Facebook saying he felt like killing someone has told a court he did not mean it "literally".
Leon Ramsden, 19, is accused of murdering Paul Gilligan, 31, while he was drinking in the Pepper Alley bar in Bolton, Greater Manchester, in July.
Mr Gilligan, of Little Hulton, Salford, suffered stab wounds to his shoulder and chest in the attack.
Mr Ramsden, of Bolton, denied murder at his trial at Manchester Crown Court.
He went on a three-day alcohol and cocaine fuelled bender and did not sleep on the two nights before the stabbing on 12 July 2008, the court heard.
He told defence barrister Stuart Denney QC he was upset because he had rowed with his girlfriend and had been drinking heavily.
The jury of eight women and four men were shown photographs on his mobile phone of his two friends posing with knives, and a photograph of him clutching a beer can while taking cocaine.
On 12 July he posted a message on his Facebook page which said: "I'm twisted at home. I feel like killin some1."
Mr Ramsden, who admitted he came from a family of "troublemakers", said: "It was just a figure of speech, I didn't literally mean going out and doing something like that."
He said that on 12 July he and two friends had taken cocaine and shared 24 bottles of beer and a bottle of vodka before going out to the Pepper Alley bar at about midnight.
At the bar he said he met Paul Gilligan, whom he knew socially, who got him in a headlock "which made my nose bleed", and rubbed his head with his knuckles.
He said this made him feel embarrassed and he left the bar shortly afterwards with his friends.
Mr Ramsden said they stood outside badmouthing Paul Gilligan until his friend Reece Armstrong, 24, came out of the bar and passed him a knife and a sheath and told him he had "stabbed Gilly".
He said he tucked the sheath into his waistband and handed the knife to an unnamed person and told them "to get rid of it".
Mr Ramsden then went to a club on his own, where the sheath was spotted and he was arrested on suspicion of drug possession after two sleeping pills were found on him.
He said he did not name Mr Armstrong until the first day of his trial because "I didn't want to get my mate in trouble".
When he was arrested on suspicion of attempted murder he told police "you're trying to fit me up because of my dad".
He admitted trying to destroy one of his two mobile phones because of the pictures on it and the Facebook entry he had made using the phone.
The trial continues.