The court heard Neves was stopped by a group of police officers positioned at the Harrow Road junction with Ladbroke Grove on Monday, 28 August.
The officer who detained Neves for a section 60 search for weapons noticed that he seemed tense and nervous and appeared as if he was going to run off.
Neves, who goes by the name Switch, had to be restrained by the officers.
When the officer started to put him in handcuffs, the young man began to struggle and kept reaching for something in his waistband. Once he was handcuffed, Neves was rolled onto his side when a white sock was found which contained a revolver loaded with five rounds of ammo.
It turned out to be a blank firing revolver converted to discharge real live bullets. In one of the chambers of the gun was fitted with a hollow point bullet, designed to expand on impact.
Owen Neves 18, of Eye Road, Peterborough, was sentenced at Southwark Crown Court on Wednesday, 27 September after pleading guilty to obstructing a constable in execution of his duty, possessing a prohibited weapon and possessing ammunition for a firearm without a certificate.
Commander Dave Musker, who led the policing operation for Notting Hill Carnival 2017, said: "This man was intent on taking a lethal weapon to Notting Hill Carnival but was stopped by the vigilant actions of officers placed on one of the police cordons set up at the event.
"The sentence handed to Neves should act as a deterrent to anyone else considering carrying an illegal firearm on the streets of London."
Scotland Yard said officers made 313 arrests for a range of offences including 112 for drugs and 58 for offensive weapons.
Twenty-eight officers were injured across both days, while 17 arrests were made for assault on police, the Met said.
Three people were injured when an acidic liquid was thrown over a crowd near Ladbroke Grove on Sunday evening.
Thanks for stopping by. We welcome your comments.