2

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

2 Answers 2

2

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .