Test for certain amount of item in hand

Are there any commands that can test for a player holding at least 3 arrows in his main hand?


Solution 1:

Well, you could give a tag to te player if they hold an arrow, and remove the tag if they hold only one or two arrows.

/scoreboard players tag @a add HoldsArrows {SelectedItem:{id:"minecraft:arrow"}}
/scoreboard players tag @a[tag=HoldsArrows] remove HoldsArrows {SelectedItem:{id:"minecraft:arrow",Count:1b}}
/scoreboard players tag @a[tag=HoldsArrows] remove HoldsArrows {SelectedItem:{id:"minecraft:arrow",Count:2b}}