Tar Slimes are hostile mobs that spawn in or around tar pits. They were added in 7.3, the Dinosaur Renaissance update. They have the same sounds as normal slimes and are the same sizes, and will also despawn when set on peaceful.
BEHAVIOR
Tar Slimes will normally bounce around in the tar impervious to damage from it, but they can easily accidentally kill themselves by either jumping out or pushing each other out of the pit and taking fall damage. They attack by jumping onto the player's head, obstructing the player's vision and suffocating them. To damage them, simply punch anywhere. It is recommended to try to navigate away from any holes or tar pits while having a Tar Slime on your head. They cannot be dislodged until they are killed, and leave a blindness effect 2 behind. They drop tar drops upon death which can be used to get tar fossils. Tar Slimes are extremely easy to kill with fire, as setting a big tar slime ablaze will transfer the burning to the smaller tar slimes, who have no time to stop burning before they die.
It is in this way that Tar Drops can be farmed by enclosing a Tar Pit and killing any Tar Slimes that spawn around it, getting effectively infinite Tar Drops so long as the Tar remains in the pit.