Package org.bukkit.event.entity
Class EntityDamageByBlockEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
org.bukkit.event.entity.EntityDamageEvent
org.bukkit.event.entity.EntityDamageByBlockEvent
- All Implemented Interfaces:
- Cancellable
Called when an entity is damaged by a block
 
 For explosions, the Block returned by getDamager() has
 already been cleared. See getDamagerBlockState() for a snapshot
 of the block if it has already been changed.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.entity.EntityDamageEventEntityDamageEvent.DamageCause, EntityDamageEvent.DamageModifierNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.entity.EntityEvententity
- 
Constructor SummaryConstructorsConstructorDescriptionEntityDamageByBlockEvent(@Nullable Block damager, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, double damage) EntityDamageByBlockEvent(@Nullable Block damager, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, double damage, BlockState damagerBlockState) EntityDamageByBlockEvent(@Nullable Block damager, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, @NotNull Map<EntityDamageEvent.DamageModifier, Double> modifiers, @NotNull Map<EntityDamageEvent.DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions) EntityDamageByBlockEvent(@Nullable Block damager, @NotNull Entity damagee, @NotNull EntityDamageEvent.DamageCause cause, @NotNull Map<EntityDamageEvent.DamageModifier, Double> modifiers, @NotNull Map<EntityDamageEvent.DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions, BlockState damagerBlockState) 
- 
Method SummaryModifier and TypeMethodDescriptionReturns the block that damaged the player.Get a capture of the block that directly caused the damage, like a bed or respawn anchor.Methods inherited from class org.bukkit.event.entity.EntityDamageEventgetCause, getDamage, getDamage, getFinalDamage, getHandlerList, getHandlers, getOriginalDamage, isApplicable, isCancelled, setCancelled, setDamage, setDamageMethods inherited from class org.bukkit.event.entity.EntityEventgetEntity, getEntityTypeMethods inherited from class org.bukkit.event.EventcallEvent, getEventName, isAsynchronous
- 
Constructor Details- 
EntityDamageByBlockEvent
- 
EntityDamageByBlockEvent
- 
EntityDamageByBlockEventpublic EntityDamageByBlockEvent(@Nullable @Nullable Block damager, @NotNull @NotNull Entity damagee, @NotNull @NotNull EntityDamageEvent.DamageCause cause, @NotNull @NotNull Map<EntityDamageEvent.DamageModifier, Double> modifiers, @NotNull @NotNull Map<EntityDamageEvent.DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions) 
- 
EntityDamageByBlockEvent@Internal public EntityDamageByBlockEvent(@Nullable @Nullable Block damager, @NotNull @NotNull Entity damagee, @NotNull @NotNull EntityDamageEvent.DamageCause cause, @NotNull @NotNull Map<EntityDamageEvent.DamageModifier, Double> modifiers, @NotNull @NotNull Map<EntityDamageEvent.DamageModifier, ? extends Function<? super Double, Double>> modifierFunctions, @Nullable BlockState damagerBlockState) 
 
- 
- 
Method Details- 
getDamagerReturns the block that damaged the player.- Returns:
- Block that damaged the player
 
- 
getDamagerBlockStateGet a capture of the block that directly caused the damage, like a bed or respawn anchor. This block state is not placed soBlockState.isPlaced()will be false.Can be null if the block wasn't changed before the event - Returns:
- the damager block state or null if not applicable
 
 
-