*/ class EntityPreExplodeEvent extends EntityEvent implements Cancellable{ use CancellableTrait; private bool $blockBreaking = true; public function __construct( Entity $entity, protected float $force ){ if($force <= 0){ throw new \InvalidArgumentException("Explosion radius must be positive"); } $this->entity = $entity; } public function getForce() : float{ return $this->force; } public function setForce(float $force) : void{ if($force <= 0){ throw new \InvalidArgumentException("Explosion radius must be positive"); } $this->force = $force; } public function isBlockBreaking() : bool{ return $this->blockBreaking; } public function setBlockBreaking(bool $affectsBlocks) : void{ $this->blockBreaking = $affectsBlocks; } }