Skip to content

Leashable 5.47.0 ​

interface · pocketmine\entity\Leashable · source

An entity a lead can be put on (vanilla minecraft:leashable, see LeashTrait): every Mob, squids, which are WaterAnimals rather than mobs, and boats.

Methods ​

canBeLeashed() ​

php
public function canBeLeashed() : bool

Whether a lead can be put on it.

getLeashHolder() ​

php
public function getLeashHolder() : ?\pocketmine\entity\Entity

Returns the player, knot or mob holding the lead, if it is loaded.

isLeashed() ​

php
public function isLeashed() : bool

isLeashedTo() ​

php
public function isLeashedTo(\pocketmine\entity\Entity $holder) : bool

Whether the given entity holds the lead (or is the saved mob holder not found again yet).

setLeashHolder() ​

php
public function setLeashHolder(\pocketmine\entity\Entity $holder) : void

unleash() ​

php
public function unleash(bool $dropLead) : void

Removes the lead; it drops as an item if asked.

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.