The altercation took place after HMP Doncaster inmate, Levi Farrier, was ordered to stay in his cell following an altercation with a fellow prisoner who asked him to hand over his stash of Spice, Sheffield Crown Court heard.
A prison officer went to Farrier's cell to speak with him after he continuously rang his bell, in the moments leading up to the incident on July 22 last year.
Recorder Richard Woolfall told Farrier: "He explained to you it wasn't on him to let you out because he was following orders. You became aggressive. There was a struggle.
"We can see from the CCTV footage the determined way with which you were able to break yourself out of the cell.
He added: "You managed to get away, went around a pool table and took from another prisoner a snooker cue. You broke it, smashed it against a rail.
"You pointed the jagged edge towards the officer."
Ferrier, who is serving a sentence for drug offences, was apprehended by other officers at the prison a short time later, said Bev Tait, prosecuting.
He pleaded guilty to affray and possession of an offensive weapon at an earlier hearing.
Ian West, defending, told the court that Ferrier was on Spice at the time of the offence.
He said: "Since this has taken place he has realised the effect Spice has on him and has stepped away from it."
Recorder Woolfall sentenced Ferrier, who was due to be released in July, to a further eight months in prison for the attack.