Class PhysicalDamageEvent
java.lang.Object
org.bukkit.event.Event
studio.magemonkey.fabled.api.event.PhysicalDamageEvent
- All Implemented Interfaces:
- org.bukkit.event.Cancellable
public class PhysicalDamageEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
An event for when an entity is damaged by another entity without the
 use of skills such as melee attacks or projectiles.
- 
Nested Class SummaryNested classes/interfaces inherited from class org.bukkit.event.Eventorg.bukkit.event.Event.Result
- 
Constructor SummaryConstructorsConstructorDescriptionPhysicalDamageEvent(org.bukkit.entity.LivingEntity damager, org.bukkit.entity.LivingEntity target, double damage, boolean projectile) Initializes a new event
- 
Method SummaryModifier and TypeMethodDescriptiondoubleRetrieves the amount of damage dealtorg.bukkit.entity.LivingEntityRetrieves the entity that dealt the damagestatic org.bukkit.event.HandlerListRetrieves the handlers for the eventorg.bukkit.event.HandlerListRetrieves the handlers for the eventorg.bukkit.entity.LivingEntityRetrieves the entity that received the damagebooleanChecks whether the event is cancelledbooleanChecks whether it was a projectile attackvoidsetCancelled(boolean cancelled) Sets the cancelled state of the eventvoidsetDamage(double amount) Sets the amount of damage dealtMethods inherited from class org.bukkit.event.EventgetEventName, isAsynchronous
- 
Constructor Details- 
PhysicalDamageEventpublic PhysicalDamageEvent(@Nullable org.bukkit.entity.LivingEntity damager, @NotNull org.bukkit.entity.LivingEntity target, double damage, boolean projectile) Initializes a new event- Parameters:
- damager- entity dealing the damage
- target- entity receiving the damage
- damage- the amount of damage dealt
- projectile- whether it was a projectile attack
 
 
- 
- 
Method Details- 
getDamager@Nullable public org.bukkit.entity.LivingEntity getDamager()Retrieves the entity that dealt the damage- Returns:
- entity that dealt the damage
 
- 
getTarget@NotNull public org.bukkit.entity.LivingEntity getTarget()Retrieves the entity that received the damage- Returns:
- entity that received the damage
 
- 
getDamagepublic double getDamage()Retrieves the amount of damage dealt- Returns:
- amount of damage dealt
 
- 
setDamagepublic void setDamage(double amount) Sets the amount of damage dealt- Parameters:
- amount- amount of damage dealt
 
- 
isProjectilepublic boolean isProjectile()Checks whether it was a projectile attack- Returns:
- true if a projectile attack, false otherwise
 
- 
isCancelledpublic boolean isCancelled()Checks whether the event is cancelled- Specified by:
- isCancelledin interface- org.bukkit.event.Cancellable
- Returns:
- true if cancelled, false otherwise
 
- 
setCancelledpublic void setCancelled(boolean cancelled) Sets the cancelled state of the event- Specified by:
- setCancelledin interface- org.bukkit.event.Cancellable
- Parameters:
- cancelled- the cancelled state of the event
 
- 
getHandlerspublic org.bukkit.event.HandlerList getHandlers()Retrieves the handlers for the event- Specified by:
- getHandlersin class- org.bukkit.event.Event
- Returns:
- list of event handlers
 
- 
getHandlerListpublic static org.bukkit.event.HandlerList getHandlerList()Retrieves the handlers for the event- Returns:
- list of event handlers
 
 
-