The warning came from the Recorder of Belfast as he jailed John Thomas Leebody for six months for involvement in a union flag protest on 6 January.
He told Leebody, from Inverary Drive, Belfast, that rioters like him bear “a collective responsibility” for protests where police come under attack.
The riot took place in east Belfast during the height of the loyalist flag protests.
The judge said that while Leebody was easily identified and his involvement was relatively short, the court had to take account that “this was a serious riot with police coming under a sustained attack and all who contributed to that, even in a modest way, must take responsibility”.
The public knew that rioters would be jailed, he said, except in exceptional circumstances.
A prosecutor lawyer said that during the riot on Castlereagh Street, police initially came under a barrage of missiles including lumps of masonry, bricks and bottles from a crowd about 150 strong.
They were later called to deal with a burning car at the junction of nearby Templemore Avenue where a group of about 60 people had gathered.
The prosecution lawyer told the court that Leebody, wearing a distinctive top and a red bandana to cover his face, ran forward and threw “a large glass bottle” at police emerging from a PSNI Land Rover.
The bottle missed the officers, but hit their vehicle showering them with glass. Leebody was also allegedly identified throwing bricks at officers.
A defence lawyer said one officer identified Leebody throwing a bottle at police, while several others reported him targeting the back of a Land Rover. He added that no officer claimed to have seen Leebody throw a brick, only “a few stones”.
He said his client was remorseful and had already paid dearly for his involvement in the riot.
Not only had he lost his girlfriend, he added, but also his employment, which given this conviction might prove difficult for him to obtain in the future, the court was told.
The defence lawyer also said that PSNI officers who had interviewed Leebody after his arrest accepted that he had been honest and candid when questioned about his involvement.
Leebody, who told police he got “caught up in the spur of the moment”, will serve six months on supervised licensed parole on his release.