Skip to content

LightningStrikeEvent 5.46.0 ​

final class · pocketmine\event\world\LightningStrikeEvent · source

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 = 2

Spawned by a command or a plugin.

CAUSE_TRAP ​

php
public const CAUSE_TRAP = 1

Visual bolt of a skeleton trap going off.

CAUSE_TRIDENT ​

php
public const CAUSE_TRIDENT = 3

Called by a trident with Channeling in a thunderstorm.

CAUSE_WEATHER ​

php
public const CAUSE_WEATHER = 0

Struck by a thunderstorm.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\object\LightningBolt $bolt, int $cause)

getBolt() ​

php
public function getBolt() : \pocketmine\entity\object\LightningBolt

getCause() ​

php
public function getCause() : int

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.