net.minecraftforge.event.world

## Class NoteBlockEvent

- java.lang.Object
- - cpw.mods.fml.common.eventhandler.Event
  - - net.minecraftforge.event.world.BlockEvent
    - - net.minecraftforge.event.world.NoteBlockEvent

- Direct Known Subclasses:
    NoteBlockEvent.Change, NoteBlockEvent.Play

      public class NoteBlockEvent
      extends BlockEvent

  Base class for Noteblock Events

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `NoteBlockEvent.Change` Fired when a Noteblock is changed.
    `static class` | `NoteBlockEvent.Instrument` Describes the types of musical Instruments that can be played by a Noteblock.
    `static class` | `NoteBlockEvent.Note` Information about the pitch of a Noteblock note.
    `static class` | `NoteBlockEvent.Octave` Describes the Octave of a Note being played by a Noteblock.
    `static class` | `NoteBlockEvent.Play` Fired when a Noteblock plays it's note.

    - ### Nested classes/interfaces inherited from class net.minecraftforge.event.world.BlockEvent

      `BlockEvent.BreakEvent, BlockEvent.HarvestDropsEvent`

    - ### Nested classes/interfaces inherited from class cpw.mods.fml.common.eventhandler.Event

      `Event.HasResult, Event.Result`

  - ### Field Summary

    - ### Fields inherited from class net.minecraftforge.event.world.BlockEvent

      `block, blockMetadata, world, x, y, z`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `NoteBlockEvent.Note` | `getNote()` Get the Note the Noteblock is tuned to
    `NoteBlockEvent.Octave` | `getOctave()` Get the Octave of the note this Noteblock is tuned to
    `int` | `getVanillaNoteId()` get the vanilla note-id, which contains information about both Note and Octave.
    `void` | `setNote(NoteBlockEvent.Note note, NoteBlockEvent.Octave octave)` Set Note and Octave for this event. If octave is Octave.HIGH, note may only be Note.F_SHARP

    - ### Methods inherited from class cpw.mods.fml.common.eventhandler.Event

      `getListenerList, getResult, hasResult, isCancelable, isCanceled, setCanceled, setResult, setup`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### getNote

          public NoteBlockEvent.Note getNote()

      Get the Note the Noteblock is tuned to
      Returns:
        the Note

    - #### getOctave

          public NoteBlockEvent.Octave getOctave()

      Get the Octave of the note this Noteblock is tuned to
      Returns:
        the Octave

    - #### getVanillaNoteId

          public int getVanillaNoteId()

      get the vanilla note-id, which contains information about both Note and Octave. Most modders should not need this.
      Returns:
        an ID for the note

    - #### setNote

          public void setNote(NoteBlockEvent.Note note,
                     NoteBlockEvent.Octave octave)

      Set Note and Octave for this event.
      If octave is Octave.HIGH, note may only be Note.F_SHARP
      Parameters:
        `note` - the Note
        `octave` - the Octave