AbstractFish 5.46.0
Extends Mob
Implements BucketableMob
Cod, salmon, pufferfish and tropical fish (Bedrock "fish" family): 3 health, swim around in water, flee from players and axolotls, flop on land and suffocate there. Caught with a water bucket. XP 1-3 on player kills; 25% chance (+1% per Looting level) to drop a bone.
Methods
entityBaseTick() protected
php
protected function entityBaseTick(int $tickDiff = 1) : boolgetAvoidDistance() protected
php
protected function getAvoidDistance() : floatDistance at which the fish flees from players and axolotls (Bedrock avoid_mob_type max_dist).
getDrops()
php
public function getDrops() : arraygetFishDrops() protected
php
abstract protected function getFishDrops() : arraygetXpDropAmount()
php
public function getXpDropAmount() : intinitEntity() protected
php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidonInteractWithItem() protected
php
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : boolplayAmbientSound() protected
php
protected function playAmbientSound() : voidregisterGoals() protected
php
protected function registerGoals() : void