Hoglin 5.46.0
Extends Animal
Implements Angerable
Bedrock values (hoglin.json): 40 health, 1.4x1.4, movement 0.3 (baby 0.36), knockback resistance 0.6. Adults attack players within 16 blocks for 3-9 damage and toss them up; babies hit for 1 and panic when hurt. Hurting one angers the hoglins within 16 blocks for 10 seconds. Bred with crimson fungus. Turns into a zoglin after 15 seconds outside the Nether.
- Avoids warped fungus (also potted), nether portals and respawn anchors within 8 blocks (4 up or down): it walks away from them (retreat sound) and doesn't look for players to attack while one is near (avoid_block).
- Hunted by groups of adult piglins (see
Piglin); when piglins kill one, the piglins around celebrate. Loot (adult): 2-4 porkchops (cooked when burning), 0-1 leather (+0-1 each per Looting level). Experience 5.
Constants
ANGER_TICKS
php
public const ANGER_TICKS = 200REPELLENT_HEIGHT
php
public const REPELLENT_HEIGHT = 4REPELLENT_RANGE
php
public const REPELLENT_RANGE = 8Methods
attack()
php
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : voidattackMelee()
php
public function attackMelee(\pocketmine\entity\Living $target, float $baseDamage) : boolAdults hit for 3-9 (random, vanilla attack damage range) and toss their target up; babies for 1.
createBaby() protected
php
protected function createBaby(\pocketmine\entity\animal\Animal $partner, \pocketmine\entity\Location $location) : \pocketmine\entity\animal\AnimalentityBaseTick() protected
php
protected function entityBaseTick(int $tickDiff = 1) : boolfindRepellent()
php
public function findRepellent() : ?\pocketmine\math\Vector3Nearest warped fungus, nether portal or respawn anchor within 8 blocks (4 up or down), looked for once a second.
getAdultDrops() protected
php
protected function getAdultDrops() : arraygetInitialSizeInfo() protected
php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetName()
php
public function getName() : stringgetNetworkTypeId()
php
public static function getNetworkTypeId() : stringgetPickedItem()
php
public function getPickedItem() : ?\pocketmine\item\ItemgetXpDropAmount()
php
public function getXpDropAmount() : intinitEntity() protected
php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisBreedingItem()
php
public function isBreedingItem(\pocketmine\item\Item $item) : boolonAngerChange() protected
php
protected function onAngerChange(bool $angry) : voidonDeath() protected
php
protected function onDeath() : voidregisterGoals() protected
php
protected function registerGoals() : voidsaveNBT()
php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsetAge()
php
public function setAge(int $age) : voidsyncNetworkData() protected
php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : voidtossUp()
php
public static function tossUp(\pocketmine\entity\Living $target) : voidThrows the target up and away (Java HoglinBase::throwTarget).
zombify() protected
php
protected function zombify() : void