Skip to content

VibrationListener 5.46.0 ​

interface · pocketmine\world\vibration\VibrationListener · source

Something other than a sculk sensor block that hears vibrations, e.g. a warden. Listeners are registered in the VibrationManager of their world; they receive every vibration emitted within their range that isn't blocked by wool, at once (the listener decides when the vibration "arrives").

Methods ​

getListenerPosition() ​

php
public function getListenerPosition() : \pocketmine\math\Vector3

Position the listener hears from.

getListenerRange() ​

php
public function getListenerRange() : int

Maximum distance in blocks at which the listener hears vibrations.

onVibration() ​

php
public function onVibration(\pocketmine\math\Vector3 $pos, \pocketmine\world\vibration\GameEvent $event, ?\pocketmine\entity\Entity $source, ?\pocketmine\block\Block $affected, float $distance) : void

Called when a vibration is emitted within range.

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