Genisys  Genisys API 1.9.3
A server software for Minecraft: Pocket Edition with many features
EntityDamageEvent Class Reference
Inheritance diagram for EntityDamageEvent:
[legend]
Collaboration diagram for EntityDamageEvent:
[legend]

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)
 
 getRateDamage ($type=self::MODIFIER_BASE)
 
 setRateDamage ($damage, $type=self::MODIFIER_BASE)
 
 isApplicable ($type)
 
 getFinalDamage ()
 
 getUsedArmors ()
 
 getFireProtectL ()
 
 useArmors ()
 
 createThornsDamage ()
 
 getThornsDamage ()
 
 setThornsArmorUse ()
 
- Public Member Functions inherited from EntityEvent
 getEntity ()
 
- Public Member Functions inherited from Event
 getEventName ()
 
 getHandlers ()
 
- Public Member Functions inherited from Cancellable
 isCancelled ()
 
 setCancelled ($forceCancel=false)
 

Data Fields

const MODIFIER_BASE = 0
 
const MODIFIER_RESISTANCE = 1
 
const MODIFIER_ARMOR = 2
 
const MODIFIER_PROTECTION = 3
 
const MODIFIER_STRENGTH = 4
 
const MODIFIER_WEAKNESS = 5
 
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
 
const CAUSE_STARVATION = 15
 
const CAUSE_LIGHTNING = 16
 

Static Public Attributes

static $handlerList = null
 

Additional Inherited Members

- Protected Attributes inherited from EntityEvent
 $entity
 
- Protected Attributes inherited from Event
 $eventName = null
 

Constructor & Destructor Documentation

__construct ( Entity  $entity,
  $cause,
  $damage 
)
Parameters
Entity$entity
int$cause
int|int[]$damage
Exceptions

Member Function Documentation

getCause ( )
Returns
int
getDamage (   $type = self::MODIFIER_BASE)
Parameters
int$type
Returns
int
getFinalDamage ( )
Returns
int
getFireProtectL ( )
Returns
Int $fireProtectL
getOriginalDamage (   $type = self::MODIFIER_BASE)
Parameters
int$type
Returns
int
getRateDamage (   $type = self::MODIFIER_BASE)
Parameters
int$type
Returns
float 1 - the percentage
getUsedArmors ( )
Returns
Item $usedArmors notice: $usedArmors $index->$cost
index
the

index of ArmorInventory $cost: the num of durability cost

isApplicable (   $type)
Parameters
int$type
Returns
bool
setDamage (   $damage,
  $type = self::MODIFIER_BASE 
)
Parameters
float$damage
int$type
Exceptions
setRateDamage (   $damage,
  $type = self::MODIFIER_BASE 
)
Parameters
float$damage
int$typeNotice:If you want to add/reduce the damage without reducing by Armor or effect. set a new Damage using setDamage Notice:If you want to add/reduce the damage within reducing by Armor of effect. Plz change the MODIFIER_BASE Notice:If you want to add/reduce the damage by multiplying. Plz use this function.
setThornsArmorUse ( )
Returns
bool should be used after getThornsDamage()
useArmors ( )
Returns
bool

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