MobBucket 5.46.0
Extends LiquidBucket
Bucket of an aquatic mob (cod, salmon, tropical fish, pufferfish, axolotl, tadpole). It places water like a water bucket, leaves an empty bucket and releases the mob registered for MobBucket::getEntityTypeId() in EntitySpawnRegistry (if any) with the data saved on the bucket (variant, age...; see BucketableMob). Mobs are picked up by using a water bucket on them.
Methods
__construct()
php
public function __construct(\pocketmine\item\ItemIdentifier $identifier, string $name, \pocketmine\block\Liquid $liquid, ?string $entityTypeId = null)getEntityTypeId()
php
public function getEntityTypeId() : ?stringReturns the Bedrock identifier of the mob in the bucket (e.g. "minecraft:cod"), or null if none is known.
onInteractBlock()
php
public function onInteractBlock(\pocketmine\player\Player $player, \pocketmine\block\Block $blockReplace, \pocketmine\block\Block $blockClicked, int $face, \pocketmine\math\Vector3 $clickVector, array &$returnedItems) : \pocketmine\item\ItemUseResultreleaseMob()
php
public function releaseMob(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos) : ?\pocketmine\entity\EntitySpawns the mob of this bucket at the given position. Returns the mob, or null if there is no entity for it.
