PocketMine-MP 5.21.3 git-fcef015f32c0b0709cfd4d6f1b3c32f484b25bde
Loading...
Searching...
No Matches
pocketmine\event\entity\EntityRegainHealthEvent Class Reference
+ Inheritance diagram for pocketmine\event\entity\EntityRegainHealthEvent:
+ Collaboration diagram for pocketmine\event\entity\EntityRegainHealthEvent:

Public Member Functions

 __construct (Entity $entity, private float $amount, private int $regainReason)
 
 call ()
 
 getAmount ()
 
 getEntity ()
 
 getEventName ()
 
 getRegainReason ()
 
 isCancelled ()
 
 setAmount (float $amount)
 

Static Public Member Functions

static hasHandlers ()
 

Public Attributes

const CAUSE_CUSTOM = 3
 
const CAUSE_EATING = 1
 
const CAUSE_MAGIC = 2
 
const CAUSE_REGEN = 0
 
const CAUSE_SATURATION = 4
 

Protected Attributes

Entity $entity
 
string $eventName = null
 

Detailed Description

@phpstan-extends EntityEvent<Entity>

Definition at line 33 of file EntityRegainHealthEvent.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\event\entity\EntityRegainHealthEvent::__construct ( Entity $entity,
private float $amount,
private int $regainReason )

Definition at line 42 of file EntityRegainHealthEvent.php.

Member Function Documentation

◆ call()

pocketmine\event\Event::call ( )
inherited

Calls event handlers registered for this event.

Exceptions

RuntimeException if event call recursion reaches the max depth limit

Definition at line 49 of file Event.php.

◆ getAmount()

pocketmine\event\entity\EntityRegainHealthEvent::getAmount ( )

Definition at line 50 of file EntityRegainHealthEvent.php.

◆ getEntity()

◆ getEventName()

pocketmine\event\Event::getEventName ( )
finalinherited

Definition at line 40 of file Event.php.

◆ getRegainReason()

pocketmine\event\entity\EntityRegainHealthEvent::getRegainReason ( )

Returns one of the CAUSE_* constants to indicate why this regeneration occurred.

Definition at line 61 of file EntityRegainHealthEvent.php.

◆ hasHandlers()

static pocketmine\event\Event::hasHandlers ( )
staticinherited

Returns whether the current class context has any registered global handlers. This can be used in hot code paths to avoid unnecessary event object creation.

Usage: SomeEventClass::hasHandlers()

Definition at line 77 of file Event.php.

◆ isCancelled()

pocketmine\event\Cancellable::isCancelled ( )
inherited

Returns whether this instance of the event is currently cancelled.

If it is cancelled, only downstream handlers that declare @handleCancelled will be called with this event.

◆ setAmount()

pocketmine\event\entity\EntityRegainHealthEvent::setAmount ( float $amount)

Definition at line 54 of file EntityRegainHealthEvent.php.

Member Data Documentation

◆ $entity

◆ $eventName

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

Definition at line 38 of file Event.php.

◆ CAUSE_CUSTOM

const pocketmine\event\entity\EntityRegainHealthEvent::CAUSE_CUSTOM = 3

Definition at line 39 of file EntityRegainHealthEvent.php.

◆ CAUSE_EATING

const pocketmine\event\entity\EntityRegainHealthEvent::CAUSE_EATING = 1

Definition at line 37 of file EntityRegainHealthEvent.php.

◆ CAUSE_MAGIC

const pocketmine\event\entity\EntityRegainHealthEvent::CAUSE_MAGIC = 2

Definition at line 38 of file EntityRegainHealthEvent.php.

◆ CAUSE_REGEN

const pocketmine\event\entity\EntityRegainHealthEvent::CAUSE_REGEN = 0

Definition at line 36 of file EntityRegainHealthEvent.php.

◆ CAUSE_SATURATION

const pocketmine\event\entity\EntityRegainHealthEvent::CAUSE_SATURATION = 4

Definition at line 40 of file EntityRegainHealthEvent.php.


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