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.

-1

It'll only run if the players chordanates 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 dosn't matter where they are, remove x y and z from inside the square brackets, if it does matter change the chordanates. You also have to add distance=..1

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

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.