Getting jailed didn’t stop more than 15 Bloods members from drugging and thugging inside Rikers Island — thanks to scalpel blades and stashes of pot and painkillers smuggled in by pals on the outside, Bronx prosecutors said Wednesday.

The blades and drugs would be wrapped in plastic or electrical tape and smuggled inside the body cavities of Rikers visitors, officials said as they announced the indictment of a total of 29 defendants, all affiliated with the “Mac Balla” set of the Bloods. About half of those indicted worked on the outside to fuel the network, authorities said.

The defendants, hit with an assortment of charges including conspiracy, assault and weapons possession, formed a loose but often violent network that operated both inside and outside Rikers but which had its hub inside the jail, officials charged.

Thirty scalpel blades were confiscated by jail staff before they made it in, but others got inside and were used in inmate-on-inmate slashings.

“The defendants allegedly stoked the violence inside the jails by smuggling in scalpels and meting out slashings to inmates,” Bronx DA Darcel Clark told reporters, noting that the blades also put city correction officers at risk.

Some members of the network were caught selling crack or robbing people seen wearing jewelry on social media, Clark said.

The network was exposed thanks to a year’s worth of surveillance and wiretaps, officials said.

The investigation was a collaboration among the NYPD’s Bronx Gangs unit and Gun Violence Suppression Division, the city Department of Investigation and the Correction Department’s Correction Intelligence Bureau.

“Slashings and stabbings are down 31 percent from where they were a year ago” at Rikers, said DOC Commissioner Cynthia Brann.