Sting operations are not entrapment.
Entrapment requires coercion by the police to push you into something you wouldn't have otherwise done.
Selling drugs to an undercover cop? Not entrapment.
Selling drugs to an undercover cop because they said they'd kill your family if you don't get them some drugs? Entrapment.