Class SkillDamageEvent
java.lang.Object
org.bukkit.event.Event
studio.magemonkey.fabled.api.event.SkillDamageEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class SkillDamageEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
An event for when an entity is damaged by
another entity with the use of a skill.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionSkillDamageEvent(Skill skill, org.bukkit.entity.LivingEntity damager, org.bukkit.entity.LivingEntity target, double damage, String classification, boolean knockback, boolean ignoreDivinity, boolean noShake) Initializes a new event -
Method Summary
Modifier 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 eventgetSkill()org.bukkit.entity.LivingEntityRetrieves the entity that received the damagebooleanChecks whether the event is cancelledbooleanbooleanbooleanvoidsetCancelled(boolean cancelled) Sets the cancelled state of the eventvoidsetDamage(double damage) Sets the amount of damage dealtvoidsetKnockback(boolean knockback) voidsetNoShake(boolean noShake) Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
SkillDamageEvent
public SkillDamageEvent(Skill skill, org.bukkit.entity.LivingEntity damager, org.bukkit.entity.LivingEntity target, double damage, @Nullable String classification, boolean knockback, boolean ignoreDivinity, boolean noShake) Initializes a new event- Parameters:
skill- skill used to deal damagedamager- entity dealing the damagetarget- entity receiving the damagedamage- the amount of damage dealtclassification- the damage type to useknockback- whether to apply knockback to the targetignoreDivinity- whether to ignore divinitynoShake- whether to prevent screen shake
-
-
Method Details
-
isCancelled
public boolean isCancelled()Checks whether the event is cancelled- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
- true if cancelled, false otherwise
-
setCancelled
public void setCancelled(boolean cancelled) Sets the cancelled state of the event- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable- Parameters:
cancelled- the cancelled state of the event
-
getHandlers
public org.bukkit.event.HandlerList getHandlers()Retrieves the handlers for the event- Specified by:
getHandlersin classorg.bukkit.event.Event- Returns:
- list of event handlers
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()Retrieves the handlers for the event- Returns:
- list of event handlers
-
getDamager
public org.bukkit.entity.LivingEntity getDamager()Retrieves the entity that dealt the damage- Returns:
- entity that dealt the damage
-
getTarget
public org.bukkit.entity.LivingEntity getTarget()Retrieves the entity that received the damage- Returns:
- entity that received the damage
-
getClassification
-
getSkill
- Returns:
- skill used to deal the damage
-
setDamage
public void setDamage(double damage) Sets the amount of damage dealt- Parameters:
damage- amount of damage dealt
-
getDamage
public double getDamage()Retrieves the amount of damage dealt- Returns:
- amount of damage dealt
-
isKnockback
public boolean isKnockback() -
setKnockback
public void setKnockback(boolean knockback) -
isIgnoreDivinity
public boolean isIgnoreDivinity() -
isNoShake
public boolean isNoShake() -
setNoShake
public void setNoShake(boolean noShake)
-