Skip to content

Zombie ​

class · pocketmine\entity\Zombie · source

Extends Monster
Implements Ageable

Bedrock values: 20 health, movement 0.23 (baby 0.35), attack 3 (scaled by difficulty), follow range 35, burns in daylight. 5% of naturally spawned zombies are babies (small, fast, 12 XP, never grow up). Loot: 0-2 rotten flesh (+0-1 per Looting level); when killed by a player, 2.5% (+1% per Looting level) chance of an iron ingot, carrot or potato.

Constants ​

ATTACK_DAMAGE 5.46.0 ​

php
public const ATTACK_DAMAGE = 3.0

FOLLOW_RANGE 5.46.0 ​

php
public const FOLLOW_RANGE = 35.0

TAG_IS_BABY 5.46.0 ​

php
public const TAG_IS_BABY = "IsBaby"

Methods ​

burnsInDaylight() 5.46.0 ​

php
public function burnsInDaylight() : bool

getDrops() ​

php
public function getDrops() : array

getInitialSizeInfo() protected ​

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

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getPickedItem() ​

php
public function getPickedItem() : ?\pocketmine\item\Item

getXpDropAmount() ​

php
public function getXpDropAmount() : int

initEntity() 5.46.0 protected ​

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

isBaby() 5.46.0 ​

php
public function isBaby() : bool

isVillageTarget() 5.46.0 ​

php
public static function isVillageTarget(\pocketmine\entity\Living $entity) : bool

Whether zombies (and husks, drowned and zombie villagers) hunt the entity besides players: villagers, wandering traders, iron golems and snow golems (Bedrock zombie.json nearest_attackable_target).

registerGoals() 5.46.0 protected ​

php
protected function registerGoals() : void

saveNBT() 5.46.0 ​

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

setBaby() 5.46.0 ​

php
public function setBaby(bool $baby) : void

syncNetworkData() 5.46.0 protected ​

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

villageTargetGoal() 5.46.0 ​

php
public static function villageTargetGoal(\pocketmine\entity\Mob $mob) : \pocketmine\entity\ai\goal\NearestAttackableEntityGoal

The goal that makes zombie-like mobs target villagers and golems within 35 blocks. Villagers don't have to be seen (vanilla NearestAttackableTargetGoal(AbstractVillager, false)), so zombies find them behind walls and doors.

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