Pennsylvania law provides a defense to violent crimes in cases of self-defense.  Although self-defense is permitted, it is not without limitations.  The following are statutory limitations on the use of self-defense:

to resist an arrest which the actor knows is being made by a police officer, although the arrest is unlawful or to resist force used by the occupier or possessor of property or by another person on his behalf where the actor knows that the person using the force is doing so under a claim of right to protect the property.