A running joke on my Twitch channel is that I shouldn't kill and eat the pigs when I'm playing Minecraft. A viewer has even made some donations in the name of the "Pig Protection Agency". During one stream I joked I should make a datapack that protects all pigs in the game, et voilà!
This datapack can be downloaded to your Minecraft world folder and serves one single purpose: pigs cannot be killed. It makes no further changes to the game.
If you have any questions, please feel free to contact me via social media: