I am using creative mode to tag Minecraft villagers as an adult or child.
Here is the code I am using:
/data merge entity @e[type=villager,limit=1,sort=nearest] {Tags:["child"]}
/data merge entity @e[type=villager,limit=1,sort=nearest] {Tags:["adult"]}
However, I want players in survival mode to be able to add these data tags to villagers. Can I create an item that, when right clicked, will execute one of these commands? I think I may need to use a carrot on a stick (since it can detect a right click) but I am not certain. Ideally, I would like to use two sticks: one called "child age wand" and the other called "adult age wand." How would I do this?