Package io.papermc.paper.event.block
Class DragonEggFormEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.block.BlockEvent
org.bukkit.event.block.BlockGrowEvent
org.bukkit.event.block.BlockFormEvent
io.papermc.paper.event.block.DragonEggFormEvent
- All Implemented Interfaces:
Cancellable
Called when the
EnderDragon
is defeated (killed) in a DragonBattle
,
causing a Material.DRAGON_EGG
(more formally: BlockGrowEvent.getNewState()
)
to possibly appear depending on isCancelled()
.
This event might be cancelled by default depending on
eg. DragonBattle.hasBeenPreviouslyKilled()
and server configuration.-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.block.BlockEvent
block
-
Constructor Summary
ConstructorDescriptionDragonEggFormEvent
(@NotNull Block block, @NotNull BlockState newState, @NotNull DragonBattle dragonBattle) -
Method Summary
Modifier and TypeMethodDescriptionGets theDragonBattle
associated with this event.static @NotNull HandlerList
boolean
Gets the cancellation state of this event.void
setCancelled
(boolean cancelled) Sets the cancellation state of this event.Methods inherited from class org.bukkit.event.block.BlockGrowEvent
getNewState
Methods inherited from class org.bukkit.event.block.BlockEvent
getBlock
Methods inherited from class org.bukkit.event.Event
asynchronous, callEvent, getEventName, isAsynchronous
-
Constructor Details
-
DragonEggFormEvent
public DragonEggFormEvent(@NotNull @NotNull Block block, @NotNull @NotNull BlockState newState, @NotNull @NotNull DragonBattle dragonBattle)
-
-
Method Details
-
isCancelled
public boolean isCancelled()Description copied from interface:Cancellable
Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelled
in interfaceCancellable
- Overrides:
isCancelled
in classBlockGrowEvent
- Returns:
- true if this event is cancelled
-
setCancelled
public void setCancelled(boolean cancelled) Description copied from interface:Cancellable
Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
setCancelled
in interfaceCancellable
- Overrides:
setCancelled
in classBlockGrowEvent
- Parameters:
cancelled
- true if you wish to cancel this event
-
getDragonBattle
Gets theDragonBattle
associated with this event. Keep in mind that theEnderDragon
is already dead when this event is called.- Returns:
- the dragon battle
-
getHandlers
- Overrides:
getHandlers
in classBlockFormEvent
-
getHandlerList
-