Skip to content

Hoglin 5.46.0 ​

class · pocketmine\entity\monster\Hoglin · source

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 = 200

REPELLENT_HEIGHT ​

php
public const REPELLENT_HEIGHT = 4

REPELLENT_RANGE ​

php
public const REPELLENT_RANGE = 8

Methods ​

attack() ​

php
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : void

attackMelee() ​

php
public function attackMelee(\pocketmine\entity\Living $target, float $baseDamage) : bool

Adults 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\Animal

entityBaseTick() protected ​

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

findRepellent() ​

php
public function findRepellent() : ?\pocketmine\math\Vector3

Nearest 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() : array

getInitialSizeInfo() protected ​

php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfo

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getPickedItem() ​

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

getXpDropAmount() ​

php
public function getXpDropAmount() : int

initEntity() protected ​

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

isBreedingItem() ​

php
public function isBreedingItem(\pocketmine\item\Item $item) : bool

onAngerChange() protected ​

php
protected function onAngerChange(bool $angry) : void

onDeath() protected ​

php
protected function onDeath() : void

registerGoals() protected ​

php
protected function registerGoals() : void

saveNBT() ​

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

setAge() ​

php
public function setAge(int $age) : void

syncNetworkData() protected ​

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

tossUp() ​

php
public static function tossUp(\pocketmine\entity\Living $target) : void

Throws the target up and away (Java HoglinBase::throwTarget).

zombify() protected ​

php
protected function zombify() : void

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