PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
Loading...
Searching...
No Matches
pocketmine\event\player\PlayerExhaustEvent Class Reference
+ Inheritance diagram for pocketmine\event\player\PlayerExhaustEvent:
+ Collaboration diagram for pocketmine\event\player\PlayerExhaustEvent:

Public Member Functions

 __construct (protected Human $human, private float $amount, private int $cause)
 
 call ()
 
 getAmount ()
 
 getCause ()
 
 getEntity ()
 
 getEventName ()
 
 getPlayer ()
 
 isCancelled ()
 
 setAmount (float $amount)
 

Static Public Member Functions

static hasHandlers ()
 

Public Attributes

const CAUSE_ATTACK = 1
 
const CAUSE_CUSTOM = 11
 
const CAUSE_DAMAGE = 2
 
const CAUSE_HEALTH_REGEN = 4
 
const CAUSE_JUMPING = 9
 
const CAUSE_MINING = 3
 
const CAUSE_POTION = 5
 
const CAUSE_SPRINT_JUMPING = 10
 
const CAUSE_SPRINTING = 7
 
const CAUSE_SWIMMING = 8
 
const CAUSE_WALKING = 6
 

Protected Attributes

Entity $entity
 
string $eventName = null
 

Detailed Description

@phpstan-extends EntityEvent<Human>

Definition at line 34 of file PlayerExhaustEvent.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\event\player\PlayerExhaustEvent::__construct ( protected Human $human,
private float $amount,
private int $cause )

Definition at line 49 of file PlayerExhaustEvent.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\player\PlayerExhaustEvent::getAmount ( )

Definition at line 64 of file PlayerExhaustEvent.php.

◆ getCause()

pocketmine\event\player\PlayerExhaustEvent::getCause ( )

Returns an int cause of the exhaustion - one of the constants at the top of this class.

Definition at line 75 of file PlayerExhaustEvent.php.

◆ getEntity()

◆ getEventName()

pocketmine\event\Event::getEventName ( )
finalinherited

Definition at line 40 of file Event.php.

◆ getPlayer()

pocketmine\event\player\PlayerExhaustEvent::getPlayer ( )
Returns
Human

Definition at line 60 of file PlayerExhaustEvent.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\player\PlayerExhaustEvent::setAmount ( float $amount)

Definition at line 68 of file PlayerExhaustEvent.php.

Member Data Documentation

◆ $entity

◆ $eventName

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

Definition at line 38 of file Event.php.

◆ CAUSE_ATTACK

const pocketmine\event\player\PlayerExhaustEvent::CAUSE_ATTACK = 1

Definition at line 37 of file PlayerExhaustEvent.php.

◆ CAUSE_CUSTOM

const pocketmine\event\player\PlayerExhaustEvent::CAUSE_CUSTOM = 11

Definition at line 47 of file PlayerExhaustEvent.php.

◆ CAUSE_DAMAGE

const pocketmine\event\player\PlayerExhaustEvent::CAUSE_DAMAGE = 2

Definition at line 38 of file PlayerExhaustEvent.php.

◆ CAUSE_HEALTH_REGEN

const pocketmine\event\player\PlayerExhaustEvent::CAUSE_HEALTH_REGEN = 4

Definition at line 40 of file PlayerExhaustEvent.php.

◆ CAUSE_JUMPING

const pocketmine\event\player\PlayerExhaustEvent::CAUSE_JUMPING = 9

Definition at line 45 of file PlayerExhaustEvent.php.

◆ CAUSE_MINING

const pocketmine\event\player\PlayerExhaustEvent::CAUSE_MINING = 3

Definition at line 39 of file PlayerExhaustEvent.php.

◆ CAUSE_POTION

const pocketmine\event\player\PlayerExhaustEvent::CAUSE_POTION = 5

Definition at line 41 of file PlayerExhaustEvent.php.

◆ CAUSE_SPRINT_JUMPING

const pocketmine\event\player\PlayerExhaustEvent::CAUSE_SPRINT_JUMPING = 10

Definition at line 46 of file PlayerExhaustEvent.php.

◆ CAUSE_SPRINTING

const pocketmine\event\player\PlayerExhaustEvent::CAUSE_SPRINTING = 7

Definition at line 43 of file PlayerExhaustEvent.php.

◆ CAUSE_SWIMMING

const pocketmine\event\player\PlayerExhaustEvent::CAUSE_SWIMMING = 8

Definition at line 44 of file PlayerExhaustEvent.php.

◆ CAUSE_WALKING

const pocketmine\event\player\PlayerExhaustEvent::CAUSE_WALKING = 6

Definition at line 42 of file PlayerExhaustEvent.php.


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