Parrying
hello, i've been trying to make a datapack which allows you to parry with some weapons but im not quite sure how to go about it im not that good at making datapacks, but im alright at making commands with command blocks. im trying to make it so when the player gets attacked it resets the cooldown scoreboard which is counting down every tick and makes the attacker be pushed back and have slowness and weakness along with making an anvil landing sound. to activate the cooldown im trying to use some sort of offhand detection system to detect if some specific items are in my offhand and then putting them in my main hand with /item before removing them from the offhand and setting the cooldown scoreboard to 100 (or whatever number it will be). thank you for your time!
Continue to help post