Skip to content

PlayerEntityInteractEvent ​

class · pocketmine\event\player\PlayerEntityInteractEvent · source

Extends PlayerEvent
Implements Cancellable

Called when a player interacts with an entity (e.g. shearing a sheep, naming a mob using a nametag).

Methods ​

__construct() ​

php
public function __construct(\pocketmine\player\Player $player, \pocketmine\entity\Entity $entity, \pocketmine\math\Vector3 $clickPos)

getClickPosition() ​

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

Returns the absolute coordinates of the click. This is usually on the surface of the entity's hitbox.

getEntity() ​

php
public function getEntity() : \pocketmine\entity\Entity

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