BucketableMob 5.46.0
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) : voidRestores the mob's data from the NBT of the bucket it was released from.
createBucket()
php
public function createBucket() : \pocketmine\item\ItemReturns the bucket holding this mob, with its data (variant, age...) in the item NBT.
