Skip to content

ZombieVillager 5.46.0 ​

class · pocketmine\entity\monster\ZombieVillager · source

Extends Zombie

Bedrock values (zombie_villager_v2.json): a zombie with a villager profession (VARIANT 0-14) and biome skin (MARK_VARIANT 0-6, the villager type).

Curing (vanilla ZombieVillager): feeding a golden apple to a zombie villager that has Weakness (e.g. from a splash potion) shows the "Cure" button, gives it Strength and makes it shake for 3 to 5 minutes (3600-6000 ticks). Each tick there is a 1% chance to look for beds and iron bars within 4 blocks: each one found (up to 14) has a 30% chance to speed the cure up by one tick per tick. The villager it turns back into keeps everything it had when it was zombified (profession, trades, level, gossip; see ZombieVillager::fromVillager()) and gives the curer the cure discount.

Constants ​

CURE_MAX_TICKS ​

php
public const CURE_MAX_TICKS = 6000

CURE_MIN_TICKS ​

php
public const CURE_MIN_TICKS = 3600

PROFESSION_COUNT ​

php
public const PROFESSION_COUNT = 15

SKIN_COUNT ​

php
public const SKIN_COUNT = 7

TAG_CONVERSION_TICKS ​

php
public const TAG_CONVERSION_TICKS = "ConversionTicks"

TAG_CURER ​

php
public const TAG_CURER = "PmCurer"

TAG_MARK_VARIANT ​

php
public const TAG_MARK_VARIANT = "MarkVariant"

TAG_VARIANT ​

php
public const TAG_VARIANT = "Variant"

TAG_VILLAGER_DATA ​

php
public const TAG_VILLAGER_DATA = "PmVillagerData"

Methods ​

entityBaseTick() protected ​

php
protected function entityBaseTick(int $tickDiff = 1) : bool

finishConversion() ​

php
public function finishConversion() : ?\pocketmine\entity\Living

Turns into a villager now: the villager it was before being zombified if known, otherwise a new villager of the same profession and type.

fromVillager() ​

php
public static function fromVillager(\pocketmine\entity\npc\VillagerV2 $villager) : self

Creates (without spawning) the zombie villager a villager turns into when a zombie kills it. It remembers the villager, which comes back as it was when cured.

getConversionSpeed() ​

php
public function getConversionSpeed() : int

How many ticks of the cure pass this tick (vanilla getConversionProgress()): 1, plus up to 14 when beds or iron bars are near, checked 1% of the time.

getConversionTicks() ​

php
public function getConversionTicks() : int

getItemInteractButtonText() protected ​

php
protected function getItemInteractButtonText(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : ?string

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getPickedItem() ​

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

getProfession() ​

php
public function getProfession() : int

initEntity() protected ​

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

isConverting() ​

php
public function isConverting() : bool

onInteractWithItem() protected ​

php
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : bool

saveNBT() ​

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

setProfession() ​

php
public function setProfession(int $profession) : void

startConversion() ​

php
public function startConversion(int $ticks, ?string $curer = null) : void

Starts curing the zombie villager: it becomes a villager after the given number of ticks, which gives the curing player (UUID) the cure discount.

syncNetworkData() protected ​

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

toLegacyProfession() ​

php
public static function toLegacyProfession(int $profession) : int

Maps a Bedrock villager_v2 profession to the five professions of Villager.

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