Pig 5.46.0
Extends Animal
Bedrock values: 10 health, movement 0.25, 0.9x0.9, bred with carrots, potatoes and beetroots, also tempted by a carrot on a stick. Can be saddled; a saddled pig is ridden by players (seat 0.63 up) and steered with a carrot on a stick held in the hand (it walks where the rider looks; using the stick boosts it 1.35x for 3 seconds and costs 2 durability, vanilla boostable component). An unsaddled pig can carry a baby zombie (seat 0.7 up). Ridden speed (approximate, Java): 0.164 blocks per tick. Loot: 1-3 porkchops (cooked when burning), +0-1 per Looting level, and the saddle. Struck by lightning it becomes a zombified piglin.
Constants
TAG_SADDLED
public const TAG_SADDLED = "Saddled"Methods
canBeRiddenBy()
public function canBeRiddenBy(\pocketmine\entity\Entity $entity) : boolcanBeSteeredBy()
public function canBeSteeredBy(\pocketmine\player\Player $rider) : boolcreateBaby() protected
protected function createBaby(\pocketmine\entity\animal\Animal $partner, \pocketmine\entity\Location $location) : \pocketmine\entity\animal\AnimalgetAdultDrops() protected
protected function getAdultDrops() : arraygetBoostItemTypeId() protected
protected function getBoostItemTypeId() : ?intgetBoostProperties() protected
protected function getBoostProperties() : arraygetInitialSizeInfo() protected
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetItemInteractButtonText() protected
protected function getItemInteractButtonText(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : ?stringgetName()
public function getName() : stringgetNetworkTypeId()
public static function getNetworkTypeId() : stringgetRiddenInput() protected
protected function getRiddenInput(\pocketmine\entity\riding\RiderInput $input) : arraygetRiddenSpeed() protected
protected function getRiddenSpeed(\pocketmine\player\Player $rider) : floatgetRideableSeats()
public function getRideableSeats() : arrayinitEntity() protected
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisBreedingItem()
public function isBreedingItem(\pocketmine\item\Item $item) : boolisSaddled()
public function isSaddled() : boolonInteractWithItem() protected
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : boolonStruckByLightning()
public function onStruckByLightning(\pocketmine\entity\object\LightningBolt $bolt) : voidVanilla: a pig struck by lightning turns into a zombified piglin holding a golden sword (not on Peaceful). The saddle is dropped.
registerGoals() protected
protected function registerGoals() : voidsaveNBT()
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsetSaddled()
public function setSaddled(bool $saddled) : voidsyncNetworkData() protected
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void