Package net.minecraftforge.event.world
Class NoteBlockEvent
- java.lang.Object
-
- net.minecraftforge.eventbus.api.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 Description static classNoteBlockEvent.ChangeFired when a Noteblock is changed.static classNoteBlockEvent.NoteInformation about the pitch of a Noteblock note.static classNoteBlockEvent.OctaveDescribes the Octave of a Note being played by a Noteblock.static classNoteBlockEvent.PlayFired when a Noteblock plays it's note.-
Nested classes/interfaces inherited from class net.minecraftforge.event.world.BlockEvent
BlockEvent.BlockToolInteractEvent, BlockEvent.BreakEvent, BlockEvent.CreateFluidSourceEvent, BlockEvent.CropGrowEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
-
-
Field Summary
Fields Modifier and Type Field Description private intnoteId
-
Constructor Summary
Constructors Modifier Constructor Description protectedNoteBlockEvent(World world, BlockPos pos, BlockState state, int note)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NoteBlockEvent.NotegetNote()Get the Note the Noteblock is tuned toNoteBlockEvent.OctavegetOctave()Get the Octave of the note this Noteblock is tuned tointgetVanillaNoteId()get the vanilla note-id, which contains information about both Note and Octave.voidsetNote(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 net.minecraftforge.event.world.BlockEvent
getPos, getState, getWorld
-
-
-
-
Constructor Detail
-
NoteBlockEvent
protected NoteBlockEvent(World world, BlockPos pos, BlockState state, int note)
-
-
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 Noteoctave- the Octave
-
-