| Name | noteblock plays note |
| Event Lines | noteblock plays note |
| Triggers | when a NoteBlock plays a note. |
| Generated Examples | on noteblock plays note:
after noteblock plays note: |
| Switches | instrument:<instrument> to only process the event if a specific instrument was played. |
| Contexts | <context.location> returns the LocationTag of the note block.
<context.instrument> returns the name of the instrument played, see list at https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Instrument.html.
<context.sound> returns the name of the sound (that fits into playsound) represented by the instrument.
<context.tone> returns the note tone played (A to G).
<context.octave> returns the octave the note is played at (as a number).
<context.sharp> returns a boolean indicating whether the note is sharp.
<context.pitch> returns the computed pitch value (that fits into playsound). Note that volume is always 3.
|
| Cancellable | True - This adds <context.cancelled> and determine 'cancelled' or 'cancelled:false' |
| Has Location | True - This adds the switches 'in:<area>', 'location_flagged:<flag>', ... |
| Group | Block |
| Source | https://github.com/DenizenScript/Denizen/blob/dev/plugin/src/main/java/com/denizenscript/denizen/events/block/NoteBlockPlaysNoteScriptEvent.java#L17 |