I realize it's not exactly a bug, but it is really annoying, as I have lost several good villagers after accidentally hitting them (often due to the villager randomly exiting the trade interface while I'm clicking; see https://bugs.mojang.com/browse/MC-117137). Seeing as how tamed horses and such are considered special cases, it seems like villagers too should be considered a special case and not be attacked.
I realize it's not exactly a bug, but it is really annoying, as I have lost several good villagers after accidentally hitting them (often due to the villager randomly exiting the trade interface while I'm clicking; see https://bugs.mojang.com/browse/MC-117137). Seeing as how tamed horses and such are considered special cases, it seems like villagers too should be considered a special case and not be attacked.