A masked robber targeted a victim outside a city centre hotel hotel before subjecting him to a violent attack.
Teenager Ryan Taylor was locked up for 27 months over the assault on the man outside the Holiday Inn, Queen Street, Wakefield.
Leeds Crown Court heard Taylor attacked the victim from behind outside the hotel in the early hours of June 16 this year.
Bashir Ahmed, prosecuting, said the victim had enjoyed a night out in the city centre and was making his way back to the hotel with some takeaway food.
Taylor approached him from behind and pushed him to the ground.
He suffered cuts to his face, hands and knees.
Taylor demanded money and the victim's mobile phone before going through his pockets.
Read more: 'Executioner' walked through kids' playground with gun before shooting man in the head
The man told Taylor he did not have any money left and that his phone was old.
The prosecutor said: "The victim recalled that he was in considerable fear at that point and did not know what was going to happen next. He feared that he might be stabbed to death."
The victim tried to get up but was pulled back to the floor and kicked.
Taylor told the man: "I have been told to get you. I don't mean it but I have been told to get."
The man then offered to get Taylor some money.
Mr Ahmed said the victim built up a "rapport" with Taylor as they walked through the city centre.
He said: "The defendant and the victim engaged in a conversation - a heart to heart.
"The victim started to chat to him about his hard life and started to relate some of that to what the defendant was saying about him suffering a hard life."
Taylor went into the hotel with the victim but police were called when staff saw the injuries to his face.
Read more: Mum recalls chilling moment she escaped shoe fetish murderer
Taylor left but was arrest a short time later.
The victim gave a statement to the police.
Mr Ahmed said: "If he was asked for some money without any force being applied he would have given it to the defendant."
Taylor, 18, of Westgate, Wakefield, pleaded guilty to attempted robbery.
He has previous convictions for assault and possessing a knife in public.
The court heard Taylor committed the offence soon after being released from a young offender institution and was desperate for money.
Sentencing Taylor, Judge Mushtaq Khokhar said: "I can understand that you might be desperate for money.
"But a lot of people do not have money and are desperate as well.
"They do not go on to attack people and rob people to get what they do not have."