Class CustomDiscInsertEvent
java.lang.Object
org.bukkit.event.Event
space.subkek.customdiscs.api.event.CustomDiscInsertEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class CustomDiscInsertEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Fired when a custom disc is inserted into a jukebox.
This event can be triggered by a player's manual interaction or by automation (e.g., a hopper or a dispenser). If cancelled, the disc will not be placed inside the jukebox, and the playback will not initiate.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionCustomDiscInsertEvent(org.bukkit.block.Block block, org.bukkit.entity.Player player, DiscEntry discEntry) -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.block.BlockgetBlock()Returns the jukebox block where the disc is being inserted.@NotNull DiscEntryReturns the disc metadata entry being inserted into the jukebox.static @NotNull org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerList@Nullable org.bukkit.entity.PlayerReturns the player who inserted the disc.booleanvoidsetCancelled(boolean cancel) Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
CustomDiscInsertEvent
public CustomDiscInsertEvent(org.bukkit.block.Block block, org.bukkit.entity.Player player, DiscEntry discEntry)
-
-
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 jukebox block where the disc is being inserted.- Returns:
- The jukebox
Block.
-
getPlayer
@Nullable public @Nullable org.bukkit.entity.Player getPlayer()Returns the player who inserted the disc.- Returns:
- The
Playerinvolved, ornullif the insertion was triggered by automation (e.g., a hopper or a dispenser).
-
getDiscEntry
Returns the disc metadata entry being inserted into the jukebox.- Returns:
- The
DiscEntrycontaining track and item data.
-