Skip to content

MobBucket 5.46.0 ​

class · pocketmine\item\MobBucket · source

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() : ?string

Returns 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\ItemUseResult

releaseMob() ​

php
public function releaseMob(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos) : ?\pocketmine\entity\Entity

Spawns the mob of this bucket at the given position. Returns the mob, or null if there is no entity for it.

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