Does hitting people with basic tools cause them to dislike you?
Solution 1:
You can't hit someone with a tool or a melee weapon. When you swing one of these items, one of the things the game checks is whether your potential target is a monster. Monsters can be whacked; ordinary NPCs (including animals) can't.
(Source: Snooping in the source code with a decompiler)