1

So I'm building a map with right-click detection via a noteblock and I have this command:

/execute if block 21 107 38 minecraft:note_block[note=1] if entity @p[x=21,y=107,z=38,nbt={SelectedItem:[{id:"minecraft:arrow"}]}] run say hi

But when I'm holding an arrow while making the noteblock go to note one, the command doesn't fire.

2

1 Answer 1

-1

It'll only run if the players coordinates are the same as the note block chords.

/execute if block **21 107 38** minecraft:note_block[note=1] if entity @p[x=**21**,y=**107**,z=**38**,nbt={SelectedItem:[{id:"minecraft:arrow"}]}] run say hi

If it doesn't matter where they are, remove x y and z from inside the square brackets, if it does matter change the coordinates.

You also have to add distance=..1

3
  • This doesn't answer the question. He's asking about how to detect activating a note block while holding an arrow. Commented Jul 23, 2018 at 23:24
  • It should now work if you are holding the arrow, so it kind of does. Commented Jul 26, 2018 at 0:36
  • But your answer has nothing to do with note blocks! Commented Jul 26, 2018 at 13:47

You must log in to answer this question.

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