Skip to content

BucketableMobTrait 5.46.0 ​

trait · pocketmine\entity\BucketableMobTrait · source

Picking up a BucketableMob with a water bucket (vanilla: fish, axolotls and tadpoles are caught with a water bucket, not an empty one). For Mobs.

Methods ​

applyBucketData() ​

php
public function applyBucketData(\pocketmine\nbt\tag\CompoundTag $tag) : void

createBucket() ​

php
public function createBucket() : \pocketmine\item\Item

getBucketItem() protected ​

php
abstract protected function getBucketItem() : \pocketmine\item\Item

Item of the filled bucket, without data.

tryPickUpWithBucket() protected ​

php
protected function tryPickUpWithBucket(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : bool

Puts the mob in the player's water bucket. Returns false if the player isn't holding a plain water bucket.

writeBucketData() protected ​

php
protected function writeBucketData(\pocketmine\nbt\tag\CompoundTag $tag) : void

Writes the data kept in the bucket (variant, age...).

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