Need help with right click detection

execute as @a[scores={Clicked=..1}] if items entity @s weapon minecraft:carrot_on_a_stick[minecraft:custom_data~{foo:1}] run say it worked

give @a minecraft:carrot_on_a_stick[minecraft:custom_data={foo:1},minecraft:custom_name='"Next Camera"']

Continue to help post