Bat 5.46.0
Extends Mob
Bedrock values (entities/bat.json): 6 health, 0.5x0.9, flies around erratically (Java target rules: up to 7 blocks away horizontally, 2 down to 4 up). Hangs upside down (RESTING) under solid blocks from time to time and wakes up when a player comes within 4 blocks or when hurt. No drops, no XP.
Constants
TAG_RESTING
php
public const TAG_RESTING = "BatFlags"Methods
attack()
php
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : voidgetFlyingSpeed() protected
php
protected function getFlyingSpeed() : floatgetInitialSizeInfo() protected
php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetName()
php
public function getName() : stringgetNetworkTypeId()
php
public static function getNetworkTypeId() : stringinitEntity() protected
php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisResting()
php
public function isResting() : boolregisterGoals() protected
php
protected function registerGoals() : voidsaveNBT()
php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsetResting()
php
public function setResting(bool $resting) : voidsyncNetworkData() protected
php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : voidtickAi() protected
php
protected function tickAi(int $currentTick) : void