Class NoteBlockEvent.Change
java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.level.BlockEvent
net.neoforged.neoforge.event.level.NoteBlockEvent
net.neoforged.neoforge.event.level.NoteBlockEvent.Change
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
- Enclosing class:
NoteBlockEvent
public static class NoteBlockEvent.Change
extends NoteBlockEvent
implements net.neoforged.bus.api.ICancellableEvent
Fired when a Noteblock is changed. You can adjust the note it will change to via
NoteBlockEvent.setNote(Note, Octave)
.
Canceling this event will not change the note and also stop the Noteblock from playing it's note.-
Nested Class Summary
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.level.NoteBlockEvent
NoteBlockEvent.Change, NoteBlockEvent.Note, NoteBlockEvent.Octave, NoteBlockEvent.Play
Nested classes/interfaces inherited from class net.neoforged.neoforge.event.level.BlockEvent
BlockEvent.BlockToolModificationEvent, BlockEvent.BreakEvent, BlockEvent.CreateFluidSourceEvent, BlockEvent.CropGrowEvent, BlockEvent.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
Nested classes/interfaces inherited from class net.neoforged.bus.api.Event
net.neoforged.bus.api.Event.HasResult, net.neoforged.bus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprivate final NoteBlockEvent.Note
private final NoteBlockEvent.Octave
-
Constructor Summary
ConstructorDescriptionChange
(Level world, BlockPos pos, BlockState state, int oldNote, int newNote) -
Method Summary
Modifier and TypeMethodDescriptionMethods inherited from class net.neoforged.neoforge.event.level.NoteBlockEvent
getNote, getOctave, getVanillaNoteId, setNote
Methods inherited from class net.neoforged.neoforge.event.level.BlockEvent
getLevel, getPos, getState
Methods inherited from class net.neoforged.bus.api.Event
getResult, hasResult, setResult
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
oldNote
-
oldOctave
-
-
Constructor Details
-
Change
-
-
Method Details
-
getOldNote
-
getOldOctave
-