2

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

3

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}}
0
0

1.13+ Update to Aeldrion's answer

  • /scoreboard players tag has been replaced with /tag.

1.13+ commands:

/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}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.