Class LavaPlayerStartPlayingEvent
java.lang.Object
org.bukkit.event.Event
space.subkek.customdiscs.api.event.LavaPlayerStartPlayingEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class LavaPlayerStartPlayingEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Fired whenever a lavaplayer starts playing.
Note: This event may be triggered asynchronously or from a specific region thread. Any modifications to the world or calls to non-thread-safe Bukkit methods must be wrapped in an appropriate scheduler task (e.g., Global or Region scheduler).
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionLavaPlayerStartPlayingEvent(org.bukkit.block.Block block, String identifier) -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.block.BlockgetBlock()Returns the block where the music starts playing.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerList@NotNull StringbooleanvoidsetCancelled(boolean cancel) Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
LavaPlayerStartPlayingEvent
-
-
Method Details
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()- Specified by:
getHandlersin classorg.bukkit.event.Event
-
getHandlerList
@NotNull public static @NotNull org.bukkit.event.HandlerList getHandlerList() -
isCancelled
public boolean isCancelled()- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable
-
getBlock
@NotNull public @NotNull org.bukkit.block.Block getBlock()Returns the block where the music starts playing.Thread Safety Warning: Since this event may be fired asynchronously, you must ensure thread safety when interacting with the returned block. Always verify the block state (e.g.,
block.getType()) within a synchronized context or scheduler task, as the block may have been modified or destroyed before the event reached the listener.- Returns:
- The block where the audio originated.
-
getIdentifier
- Returns:
- The identifier (URL or local path) of the track that stopped.
-