how to animate an item in a player's hand

I want to make it so that when an item (carrot_on_a_stick) is used, the item's animation plays, but if I change the item to another one with an animated model, the animation starts from a random moment, and if I change CustomModelData every tick, then item moves down and reappears as if it was picked up (1.21.4)

Continue to help post