Michael Tooley, prosecuting, told Sheffield Crown Court that the incident took place at HMP Moorland on February 1 this year, after Leam Chambers got into an argument with prison officers about his use of the telephone.
As a result, the 27-year-old was asked to return to his cell, which he agreed to do, and was subsequently escorted back to it by a prison officer.
Mr Tooley said: "Once in the cell, the defendant immediately picked up an improvised weapon and pointed it at the prison officer.
"The officer drew his extended baton and made the defendant drop the weapon."
The court was told that the weapon was constructed using two blades, some plastic and some string.
Chambers, of Walton Road, Weatherby pleaded guilty to a charge of possessing a bladed article in a prison at an earlier hearing.
Defending, Cheryl Dudley, told the court that Chambers had not constructed the weapon himself, and had found it at the prison.
She continued by saying that he had decided to keep it for his protection, after an attack while he was at HMP Lincoln that left him with a fractured eye socket and a swollen face.
"The officers followed him into the cell, he became fearful and panicked," said Ms Dudley.
She added: "He turned to the officer, and the officer told him to put it down and he did.
"He then jumped on to the bed and curled up into a ball."
Chambers was jailed in 2015 for possession of an offensive weapon, and subsequently had his sentence extended further at Lincoln Magistrates' Court for an additional charge. The Crown did not disclose the nature of the charge during today's court hearing.
Judge Peter Kelson sentenced Chambers to an additional 30 months in prison for the offence, and described his extensive criminal record as 'apalling'.
He told him: "It's a serious offence. You had your mitigation on the basis that you found this wicked weapon in your cell.
Judge Kelson added: "It matters not, for the purposes of this sentence, whether you made it yourself or you found it. You didn't hand it in.
"You didn't like something you were being asked to do. You went back into your cell, picked up this improvised weapon and pointed it at a officer.
"Prison officers must be, and will be, protected. Deterrent sentences are required in order to assist in dealing with difficult prisoners."