Documentation

ProjectileHitBlockEvent extends ProjectileHitEvent
in package

Table of Contents

MAX_EVENT_CALL_DEPTH  = 50
$entity  : Entity
$eventName  : string|null
$blockHit  : Block
$eventCallDepth  : int
$rayTraceResult  : RayTraceResult
__construct()  : mixed
call()  : void
Calls event handlers registered for this event.
getBlockHit()  : Block
Returns the Block struck by the projectile.
getEntity()  : Entity
getEventName()  : string
getRayTraceResult()  : RayTraceResult
Returns a RayTraceResult object containing information such as the exact position struck, the AABB it hit, and the face of the AABB that it hit.

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

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

getBlockHit()

Returns the Block struck by the projectile.

public getBlockHit() : Block

Hint: to get the block face hit, look at the RayTraceResult.

Return values
Block

getEventName()

public final getEventName() : string
Return values
string

getRayTraceResult()

Returns a RayTraceResult object containing information such as the exact position struck, the AABB it hit, and the face of the AABB that it hit.

public getRayTraceResult() : RayTraceResult
Return values
RayTraceResult

Search results