Class NoteBlockEvent
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.BlockEvent
net.neoforged.neoforge.event.level.NoteBlockEvent
- Direct Known Subclasses:
NoteBlockEvent.Change
,NoteBlockEvent.Play
Base class for Noteblock Events
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Fired when a Noteblock is changed.static enum
Information about the pitch of a Noteblock note.static enum
Describes the Octave of a Note being played by a Noteblock.static class
Fired when a Noteblock plays it's note.Nested classes/interfaces inherited from class net.neoforged.neoforge.event.level.BlockEvent
BlockEvent.BlockToolModificationEvent, BlockEvent.BreakEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
NoteBlockEvent
(Level world, BlockPos pos, BlockState state, int note) -
Method Summary
Modifier and TypeMethodDescriptiongetNote()
Get the Note the Noteblock is tuned toGet the Octave of the note this Noteblock is tuned toint
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_SHARPMethods inherited from class net.neoforged.neoforge.event.level.BlockEvent
getLevel, getPos, getState
-
Field Details
-
noteId
private int noteId
-
-
Constructor Details
-
NoteBlockEvent
-
-
Method Details
-
getNote
Get the Note the Noteblock is tuned to- Returns:
- the Note
-
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
Set Note and Octave for this event.
If octave is Octave.HIGH, note may only be Note.F_SHARP- Parameters:
note
- the Noteoctave
- the Octave
-