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.
Created Issue:
stat.talkedToVillager doesn't add the score when right-clicking a baby villager
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.
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.
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
stat.talkedToVillager doesn't add the score when right-clicking a baby villagerminecraft.custom:minecraft.talked_to_villager doesn't add the score when right-clicking a baby villager
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
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_villagerThen 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.
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_villagerThen 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.
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_villagerThen 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.

Could you include steps to reproduce? Trying to add a scoreboard objective with the criteria "stat.talkedToVillager" doesn't seem to work for me.
Thanks Southpaw. I confess I borrowed the issue heading from another similar issue re: clicking on villagers without offers. I've updated the title to use the proper objective setting and updated the description with the commands to reproduce.
Can confirm that this is an issue. Also affects 20w49a.
Can confirm in 20w51a.
Can confirm in 21w03a.
Can confirm in 1.16.5 and 21w07a.
Can confirm in 21w08b. Video attached.
Can confirm in 21w13a.
Can confirm in 21w14a.
Can confirm in 21w16a.
Can confirm in 21w17a.
Can confirm in 1.17.
Can confirm in 1.17.1.
I can confirm this behavior in 1.18 Release Candidate 3.
Here's a code analysis of this issue. The following is based on a decompiled version of Minecraft 1.17.1 using MCP-Reborn. Please note that I'm quite tentative about this analysis, although I'm persuaded to believe that this is likely a cause of the problem.
Code Analysis (tentative):
If we look at the above class, we can see that upon talking to an adult villager, minecraft.custom:minecraft.talked_to_villager increases. This is evident through the following line of code:
However, upon talking to a baby villager, this line of code isn't present meaning that minecraft.custom:minecraft.talked_to_villager doesn't increase.
Can confirm in 1.18.
Can confirm in 1.18.1.
Can confirm in 1.18.2.
Can confirm in 1.19.2. MC-206322.png
Can confirm in 23w03a