Skip to content

Bat 5.46.0 ​

class · pocketmine\entity\animal\Bat · source

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) : void

getFlyingSpeed() protected ​

php
protected function getFlyingSpeed() : float

getInitialSizeInfo() protected ​

php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfo

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

initEntity() protected ​

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

isResting() ​

php
public function isResting() : bool

registerGoals() protected ​

php
protected function registerGoals() : void

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

setResting() ​

php
public function setResting(bool $resting) : void

syncNetworkData() protected ​

php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void

tickAi() protected ​

php
protected function tickAi(int $currentTick) : void

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