Class NoteBlockEvent.Play

java.lang.Object
net.neoforged.bus.api.Event
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.
  • 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)