Documentation

PlayerExhaustEvent extends EntityEvent
in package
implements Cancellable Uses CancellableTrait

Tags
phpstan-extends

EntityEvent<Human>

Interfaces, Classes, Traits and Enums

Cancellable
This interface is implemented by an Event subclass if and only if it can be cancelled.

Table of Contents

CAUSE_ATTACK  = 1
CAUSE_CUSTOM  = 11
CAUSE_DAMAGE  = 2
CAUSE_HEALTH_REGEN  = 4
CAUSE_JUMPING  = 9
CAUSE_MINING  = 3
CAUSE_POTION  = 5
CAUSE_SPRINT_JUMPING  = 10
CAUSE_SPRINTING  = 7
CAUSE_SWIMMING  = 8
CAUSE_WALKING  = 6
MAX_EVENT_CALL_DEPTH  = 50
$entity  : Entity
$eventName  : string|null
$player  : Human
$amount  : float
$cause  : int
$eventCallDepth  : int
$isCancelled  : bool
__construct()  : mixed
call()  : void
Calls event handlers registered for this event.
cancel()  : void
getAmount()  : float
getCause()  : int
Returns an int cause of the exhaustion - one of the constants at the top of this class.
getEntity()  : Entity
getEventName()  : string
getPlayer()  : Human
isCancelled()  : bool
setAmount()  : void
uncancel()  : void

Constants

MAX_EVENT_CALL_DEPTH

private mixed MAX_EVENT_CALL_DEPTH = 50

Properties

$eventName

protected string|null $eventName = null

$eventCallDepth

private static int $eventCallDepth = 1

Methods

__construct()

public __construct(Human $human, float $amount, int $cause) : mixed
Parameters
$human : Human
$amount : float
$cause : int
Return values
mixed

call()

Calls event handlers registered for this event.

public call() : void
Tags
throws
RuntimeException

if event call recursion reaches the max depth limit

Return values
void

getCause()

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

public getCause() : int
Return values
int

getEventName()

public final getEventName() : string
Return values
string

setAmount()

public setAmount(float $amount) : void
Parameters
$amount : float
Return values
void

Search results