PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
pocketmine\event\entity\EntityDamageEvent Class Reference
+ Inheritance diagram for pocketmine\event\entity\EntityDamageEvent:
+ Collaboration diagram for pocketmine\event\entity\EntityDamageEvent:

Public Member Functions

 __construct (Entity $entity, $cause, $damage)
 
 getCause ()
 
 getOriginalDamage ($type=self::MODIFIER_BASE)
 
 getDamage ($type=self::MODIFIER_BASE)
 
 setDamage ($damage, $type=self::MODIFIER_BASE)
 
 isApplicable ($type)
 
 getFinalDamage ()
 
 getEntity ()
 
 getEventName ()
 
 getHandlers ()
 
 isCancelled ()
 
 setCancelled ($forceCancel=false)
 

Public Attributes

const MODIFIER_BASE = 0
 
const MODIFIER_ARMOR = 1
 
const CAUSE_CONTACT = 0
 
const CAUSE_ENTITY_ATTACK = 1
 
const CAUSE_PROJECTILE = 2
 
const CAUSE_SUFFOCATION = 3
 
const CAUSE_FALL = 4
 
const CAUSE_FIRE = 5
 
const CAUSE_FIRE_TICK = 6
 
const CAUSE_LAVA = 7
 
const CAUSE_DROWNING = 8
 
const CAUSE_BLOCK_EXPLOSION = 9
 
const CAUSE_ENTITY_EXPLOSION = 10
 
const CAUSE_VOID = 11
 
const CAUSE_SUICIDE = 12
 
const CAUSE_MAGIC = 13
 
const CAUSE_CUSTOM = 14
 

Static Public Attributes

static $handlerList = null
 
static $eventPool = []
 
static $nextEvent = 0
 

Protected Attributes

 $entity
 
 $eventName = null
 

Detailed Description

Definition at line 27 of file EntityDamageEvent.php.

Constructor & Destructor Documentation

pocketmine\event\entity\EntityDamageEvent::__construct ( Entity  $entity,
  $cause,
  $damage 
)
Parameters
Entity$entity
int$cause
int|int[]$damage
Exceptions
\Exception

Definition at line 65 of file EntityDamageEvent.php.

Member Function Documentation

pocketmine\event\entity\EntityDamageEvent::getCause ( )
Returns
int

Definition at line 86 of file EntityDamageEvent.php.

pocketmine\event\entity\EntityDamageEvent::getDamage (   $type = self::MODIFIER_BASE)
Parameters
int$type
Returns
int

Definition at line 108 of file EntityDamageEvent.php.

pocketmine\event\Event::getEventName ( )
finalinherited
Returns
string

Definition at line 45 of file Event.php.

References pocketmine\event\Event\$eventName.

Referenced by pocketmine\plugin\PluginManager\callEvent().

+ Here is the caller graph for this function:

pocketmine\event\entity\EntityDamageEvent::getFinalDamage ( )
Returns
int

Definition at line 141 of file EntityDamageEvent.php.

pocketmine\event\Event::getHandlers ( )
inherited
Returns
HandlerList

Definition at line 82 of file Event.php.

Referenced by pocketmine\plugin\PluginManager\callEvent().

+ Here is the caller graph for this function:

pocketmine\event\entity\EntityDamageEvent::getOriginalDamage (   $type = self::MODIFIER_BASE)
Parameters
int$type
Returns
int

Definition at line 95 of file EntityDamageEvent.php.

pocketmine\event\entity\EntityDamageEvent::isApplicable (   $type)
Parameters
int$type
Returns
bool

Definition at line 134 of file EntityDamageEvent.php.

pocketmine\event\entity\EntityDamageEvent::setDamage (   $damage,
  $type = self::MODIFIER_BASE 
)
Parameters
float$damage
int$type
Exceptions
\UnexpectedValueException

Definition at line 122 of file EntityDamageEvent.php.

Member Data Documentation

pocketmine\event\Event::$eventName = null
protectedinherited

Any callable event must declare the static variable

public static $handlerList = null; public static $eventPool = []; public static $nextEvent = 0;

Not doing so will deny the proper event initialization

Definition at line 39 of file Event.php.

Referenced by pocketmine\event\Event\getEventName().


The documentation for this class was generated from the following file: