Leashable 5.47.0
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() : boolWhether a lead can be put on it.
getLeashHolder()
php
public function getLeashHolder() : ?\pocketmine\entity\EntityReturns the player, knot or mob holding the lead, if it is loaded.
isLeashed()
php
public function isLeashed() : boolisLeashedTo()
php
public function isLeashedTo(\pocketmine\entity\Entity $holder) : boolWhether 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) : voidunleash()
php
public function unleash(bool $dropLead) : voidRemoves the lead; it drops as an item if asked.
