This is a modified version of u/SquidGamer15's idea which was originally posted here:
Instead of ranging from 10 to -30, the popularity system should range from 30 to -30 in order to make more room for the effects of popularity. Popularity would dictate how villagers and golems would react to you as well as affect the nature of the raids triggered by the bad omen status effect. The higher your popularity is, the more respect you get from the villagers, and trading discounts offered by villagers in due to you having the hero of the village status effect (an effect currently only available in Bedrock Edition) stack with those triggered by high popularity, making trades even cheaper than they would be otherwise. The lower your popularity is, the more the villagers will treat you badly, and the stronger raids will become.
Effects of Popularity
30: Village Iron Golems will rush to protect you if any mob attacks you as long as you are within in their search radius
25 or over: Villagers of the diamond trade tier will offer you exclusive trades specific to their profession, some of which involve high-quality items that may otherwise be unobtainable.
20 or over: Occasionally a baby villager will give you a gift.
15 or over: Villager trades costing emeralds cost 20% less emeralds (e.g. 10 emerald trade turns into 8 emerald trade).
10 or over: Villagers are less likely to try and cheat you in trades.
5 or over: Villager trades costing emeralds cost 10% less emeralds (e.g. 10 emerald trade turns into 9 emerald trade).
4 to -4: Standard villager behavior.
-5 or under: Villager trades costing emeralds cost 10% more emeralds (e.g. 10 emerald trade turns into 11 emerald trade); Baby villagers will run away from you.
-10 or under: Villagers are more likely to try and cheat you in trades; Raids triggered by the Bad Omen status effect always have at least four waves due to the illagers and their associates seeing an already weakened village.
-15 or under: Villager trades costing emeralds cost 20% more emeralds (e.g. 10 emerald trade turns into 12 emerald trade); The village's iron golem is automatically hostile to you.
-20 or under: Villagers won’t make eye contact with you; Raids triggered by the Bad Omen status effect always have at least six waves.
-25 or under: Villagers won't trade with you at all.
-30: Even adult villagers in the village run away from you; Raids triggered by the Bad Omen status effect always have at least eight waves.
Ways to Change Popularity
- Killing all illagers and illager associates in a raid (+5)
- Building an iron golem for the village (+5)
- Successfully curing a baby zombie villager within the village (+5)
- Advancing a villager's trade tier to diamond level (+3)
- Successfully curing a zombie villager within the village (+2)
- Giving a flower to a baby villager as a gift (+2; doesn't work if baby villagers run away from you)
- Trading with a villager for the last offer slot on their list* (+1)
- Killing a zombie within the village (+1)
- Killing a husk within the village (+1)
- Killing a drowned within the village (+1)
- Killing a zombie villager of any kind within the village (+1)
- Attacking a panda near villagers* (-1)
- Attacking a villager* (-1)
- Killing a villager* (-2)
- Attacking a baby villager* (-3)
- Attacking the village's iron golem (-3)
- Killing a baby villager* (-5)
- Killing a village's iron golem* (-5)
(*These elements are already official, or at least planned; they are listed here to give a more complete picture)
Thanks for your time, and thanks to u/SquidGamer15 for allowing me to post this here.