Why did my datapack stop working?

I've made it so when you right-click with a warped fungus on a stick, it plays a tune. It worked fine until I copied the code to a carrot on a stick, and it stopped making any noise. Any clue why this would happen?
Continue to help post