Package de.jeff_media.angelchest.events
Class AngelChestSpawnPrepareEvent
java.lang.Object
org.bukkit.event.Event
de.jeff_media.angelchest.events.AngelChestSpawnPrepareEvent
- All Implemented Interfaces:
Cancellable
Called before an AngelChest is being spawned
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorDescriptionAngelChestSpawnPrepareEvent(Player player, Block block, EntityDamageEvent.DamageCause damageCause, PlayerDeathEvent playerDeathEvent)
-
Method Summary
Modifier and TypeMethodDescriptiongetBlock()
Gets the block where the de.jeff_media.angelchest.AngelChest will be createdGets the DamageCause why the player diedstatic HandlerList
Gets the player who diedGets the PlayerDeathEvent that caused this de.jeff_media.angelchest.AngelChest to be spawnedboolean
void
Sets a new Block where the de.jeff_media.angelchest.AngelChest should be locatedvoid
setCancelled(boolean cancel)
Whether or not this event should be cancelled.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
AngelChestSpawnPrepareEvent
public AngelChestSpawnPrepareEvent(Player player, Block block, EntityDamageEvent.DamageCause damageCause, PlayerDeathEvent playerDeathEvent)
-
-
Method Details
-
getPlayerDeathEvent
Gets the PlayerDeathEvent that caused this de.jeff_media.angelchest.AngelChest to be spawned- Returns:
- PlayerDeathEvent related to this de.jeff_media.angelchest.AngelChest spawn attempt
-
getPlayer
Gets the player who died- Returns:
- Player who died
-
getBlock
Gets the block where the de.jeff_media.angelchest.AngelChest will be created- Returns:
- Block where the de.jeff_media.angelchest.AngelChest will be created
-
setBlock
Sets a new Block where the de.jeff_media.angelchest.AngelChest should be located- Parameters:
block
- Block where the de.jeff_media.angelchest.AngelChest should be located
-
getDamageCause
Gets the DamageCause why the player died- Returns:
- DamageCause why the player died
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-
isCancelled
public boolean isCancelled()- Specified by:
isCancelled
in interfaceCancellable
-
setCancelled
public void setCancelled(boolean cancel)Whether or not this event should be cancelled. If cancelled, the chest will not be spawned- Specified by:
setCancelled
in interfaceCancellable
- Parameters:
cancel
- Whether or not AngelChest should handle this player's death
-