MobConversion 5.46.0
Helpers for mobs turning into other mobs (husk -> zombie, piglin -> zombified piglin, hoglin -> zoglin, zombie villager -> villager): what the new mob keeps from the old one (vanilla transformation component).
Methods
convertByLightning()
php
public static function convertByLightning(\pocketmine\entity\Living $from, \pocketmine\entity\Living $to) : voidReplaces $from by $to after a lightning strike (pig -> zombified piglin, villager -> witch): the new mob keeps the state of the old one (see MobConversion::copyState()), never despawns (vanilla setPersistenceRequired) and the old one's riders get off.
copyState()
php
public static function copyState(\pocketmine\entity\Living $from, \pocketmine\entity\Living $to) : voidCopies the name, persistence and armor of $from to $to (vanilla "keep_level"/"preserve_equipment" keeps the worn equipment; held items are handled by the caller).
