ZombieVillager 5.46.0
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
public const CURE_MAX_TICKS = 6000CURE_MIN_TICKS
public const CURE_MIN_TICKS = 3600PROFESSION_COUNT
public const PROFESSION_COUNT = 15SKIN_COUNT
public const SKIN_COUNT = 7TAG_CONVERSION_TICKS
public const TAG_CONVERSION_TICKS = "ConversionTicks"TAG_CURER
public const TAG_CURER = "PmCurer"TAG_MARK_VARIANT
public const TAG_MARK_VARIANT = "MarkVariant"TAG_VARIANT
public const TAG_VARIANT = "Variant"TAG_VILLAGER_DATA
public const TAG_VILLAGER_DATA = "PmVillagerData"Methods
entityBaseTick() protected
protected function entityBaseTick(int $tickDiff = 1) : boolfinishConversion()
public function finishConversion() : ?\pocketmine\entity\LivingTurns into a villager now: the villager it was before being zombified if known, otherwise a new villager of the same profession and type.
fromVillager()
public static function fromVillager(\pocketmine\entity\npc\VillagerV2 $villager) : selfCreates (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()
public function getConversionSpeed() : intHow 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()
public function getConversionTicks() : intgetItemInteractButtonText() protected
protected function getItemInteractButtonText(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : ?stringgetName()
public function getName() : stringgetNetworkTypeId()
public static function getNetworkTypeId() : stringgetPickedItem()
public function getPickedItem() : ?\pocketmine\item\ItemgetProfession()
public function getProfession() : intinitEntity() protected
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisConverting()
public function isConverting() : boolonInteractWithItem() protected
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : boolsaveNBT()
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsetProfession()
public function setProfession(int $profession) : voidstartConversion()
public function startConversion(int $ticks, ?string $curer = null) : voidStarts 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
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : voidtoLegacyProfession()
public static function toLegacyProfession(int $profession) : intMaps a Bedrock villager_v2 profession to the five professions of Villager.
