Cancellable
public class NotePlayEvent extends BlockEvent implements Cancellable
Event.Result
block
Constructor | Description |
---|---|
NotePlayEvent(@NotNull Block block,
@NotNull Instrument instrument,
@NotNull Note note) |
Modifier and Type | Method | Description |
---|---|---|
static @NotNull HandlerList |
getHandlerList() |
|
@NotNull HandlerList |
getHandlers() |
|
@NotNull Instrument |
getInstrument() |
Gets the
Instrument to be used. |
@NotNull Note |
getNote() |
Gets the
Note to be played. |
boolean |
isCancelled() |
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel) |
Sets the cancellation state of this event.
|
void |
setInstrument(@NotNull Instrument instrument) |
Deprecated.
no effect on newer Minecraft versions
|
void |
setNote(@NotNull Note note) |
Deprecated.
no effect on newer Minecraft versions
|
getBlock
callEvent, getEventName, isAsynchronous
public NotePlayEvent(@NotNull @NotNull Block block, @NotNull @NotNull Instrument instrument, @NotNull @NotNull Note note)
public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this event@NotNull public @NotNull Instrument getInstrument()
Instrument
to be used.@Deprecated public void setInstrument(@NotNull @NotNull Instrument instrument)
Instrument
to be used.instrument
- the Instrument. Has no effect if null.@Deprecated public void setNote(@NotNull @NotNull Note note)
Note
to be played.note
- the Note. Has no effect if null.@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
Copyright © 2020. All rights reserved.