LightningStrikeEvent 5.46.0
Extends WorldEvent
Implements Cancellable
Called when a lightning bolt is about to strike (before it is spawned). Cancelling it prevents the strike.
Constants
CAUSE_CUSTOM
php
public const CAUSE_CUSTOM = 2Spawned by a command or a plugin.
CAUSE_TRAP
php
public const CAUSE_TRAP = 1Visual bolt of a skeleton trap going off.
CAUSE_TRIDENT
php
public const CAUSE_TRIDENT = 3Called by a trident with Channeling in a thunderstorm.
CAUSE_WEATHER
php
public const CAUSE_WEATHER = 0Struck by a thunderstorm.
Methods
__construct()
php
public function __construct(\pocketmine\entity\object\LightningBolt $bolt, int $cause)getBolt()
php
public function getBolt() : \pocketmine\entity\object\LightningBoltgetCause()
php
public function getCause() : int