minecraft.custom:minecraft.talked_to_villager doesn't add the score when right-clicking a baby villager
The bug
For a baby villager, age < 0, right clicking does not trigger the stat.talkedToVillager score which limits the ability to create baby villager dialogue mechanisms in adventure maps.
To reproduce
Add a scoreboard objective as follows:
/scoreboard objectives add VillagerClick minecraft.custom:minecraft.talked_to_villager
Then show the VillagerClick objective in the sidebar:
/scoreboard objectives setdisplay sidebar VillagerClick
Clicking on an adult villager increments the VillagerClick counter but clicking on a baby villager does not.
Code analysis
Code analysis by [Mod] Avoma can be found in this comment.