Note Block
High-level API
Device name:
note_blockProvided by note blocks connected to a bus interface.
The device changes what the note block is set to. It does not play it, use redstone signals for that.
Instrument names include:
harp or bass, bell, chime, flute, guitar, pling, xylophone, bit.Note that the instrument configuration is transient. Environmental changes will override it back to its natural configuration.
Methods
getInstrument():stringGets the name of the instrument the block plays.
- Returns the instrument name.
getNote():numberGets the note the block is tuned to.
- Returns a note from
0 to 24.setInstrument(instrument:string)Sets the instrument the block plays.
-
instrument: the instrument name.setNote(note:number)Tunes the block to a note.
-
note: the note to tune to, from 0 to 24.Mid-level API
Device name:
NOTEMethods
1 getNoteGets the note the block is tuned to.
- Returns one byte, the note, from
0 to 24.2 setNoteTunes the block to a note.
- Takes one byte, the note, from
0 to 24.3 getInstrumentGets the name of the instrument the block plays.
- Returns the instrument name. Read while
OCDAV is set to read fully.4 setInstrumentSets the instrument the block plays.
- Takes the instrument name.