Skip to content

BucketableMob 5.46.0 ​

interface · pocketmine\entity\BucketableMob · source

A mob that can be picked up in a bucket (fish, axolotls, tadpoles): using a water bucket on it replaces the bucket with BucketableMob::createBucket(), and emptying that bucket releases the mob again with BucketableMob::applyBucketData().

Constants ​

BUCKET_TAG_AGE ​

php
public const BUCKET_TAG_AGE = "Age"

BUCKET_TAG_COLOR ​

php
public const BUCKET_TAG_COLOR = "Color"

BUCKET_TAG_COLOR2 ​

php
public const BUCKET_TAG_COLOR2 = "Color2"

BUCKET_TAG_HEALTH ​

php
public const BUCKET_TAG_HEALTH = "Health"

BUCKET_TAG_MARK_VARIANT ​

php
public const BUCKET_TAG_MARK_VARIANT = "MarkVariant"

BUCKET_TAG_VARIANT ​

php
public const BUCKET_TAG_VARIANT = "Variant"

Keys of the bucket item NBT (same names as PowerNukkitX / vanilla actor data).

Methods ​

applyBucketData() ​

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

Restores the mob's data from the NBT of the bucket it was released from.

createBucket() ​

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

Returns the bucket holding this mob, with its data (variant, age...) in the item NBT.

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