Class NoteBlockEvent.Play
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.Play
- All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent
- Enclosing class:
NoteBlockEvent
public static class NoteBlockEvent.Play
extends NoteBlockEvent
implements net.neoforged.bus.api.ICancellableEvent
Fired when a Noteblock plays it's note. You can override the note and instrument
Canceling this event will stop the note from playing.
-
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.EntityMultiPlaceEvent, BlockEvent.EntityPlaceEvent, BlockEvent.FarmlandTrampleEvent, BlockEvent.FluidPlaceBlockEvent, BlockEvent.NeighborNotifyEvent, BlockEvent.PortalSpawnEvent
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate net.minecraft.world.level.block.state.properties.NoteBlockInstrument
-
Constructor Summary
ConstructorsConstructorDescriptionPlay
(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, int note, net.minecraft.world.level.block.state.properties.NoteBlockInstrument instrument) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.level.block.state.properties.NoteBlockInstrument
void
setInstrument
(net.minecraft.world.level.block.state.properties.NoteBlockInstrument instrument) Methods 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 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
-
instrument
private net.minecraft.world.level.block.state.properties.NoteBlockInstrument instrument
-
-
Constructor Details
-
Play
public Play(net.minecraft.world.level.Level world, net.minecraft.core.BlockPos pos, net.minecraft.world.level.block.state.BlockState state, int note, net.minecraft.world.level.block.state.properties.NoteBlockInstrument instrument)
-
-
Method Details
-
getInstrument
public net.minecraft.world.level.block.state.properties.NoteBlockInstrument getInstrument() -
setInstrument
public void setInstrument(net.minecraft.world.level.block.state.properties.NoteBlockInstrument instrument)
-