Goat 5.46.0
Extends Animal
Bedrock values (entities/goat.json): 10 health, 0.9x1.3, movement 0.4, attack 2 (babies 1). Screaming goats (VARIANT 1) are 2% of spawns. Rams (behavior.ram_attack): every 30-300 seconds (screamers 5-15) a goat picks a mob or survival player 4-16 blocks away, waits a second and charges at 1.8x; the target takes the attack damage and a strong knockback (Bedrock knockback_force 2.5, approximated as 2.5x the normal knockback). Charging into a log, stone, ore, packed ice or copper block breaks off a horn (GOAT_HORN_COUNT, 2 at most) which drops as a goat horn (screamers drop the screaming kinds). Milked with a bucket; tempted (0.75x) and bred with wheat; takes 10 less fall damage. No loot; XP 1-3. Every 30-60 seconds an idle goat may leap onto a block 2-10 blocks higher within 10 blocks (behavior.jump_to_block, see LongJumpGoal; JUMP_GOAL_JUMP flag while in the air).
Constants
TAG_HORNS
public const TAG_HORNS = "GoatHornCount"TAG_SCREAMER
public const TAG_SCREAMER = "IsScreamer"Methods
breaksHorn()
public static function breaksHorn(\pocketmine\block\Block $block) : boolBlocks that break a horn off (Bedrock goat behaviour: logs, stone, ores, packed ice, copper ore).
calculateFallDamage() protected
protected function calculateFallDamage(float $fallDistance) : floatcanRam()
public function canRam() : boolcreateBaby() protected
protected function createBaby(\pocketmine\entity\animal\Animal $partner, \pocketmine\entity\Location $location) : \pocketmine\entity\animal\AnimalcreateHorn()
public function createHorn() : \pocketmine\item\ItemdestroyCycles() protected
protected function destroyCycles() : voidentityBaseTick() protected
protected function entityBaseTick(int $tickDiff = 1) : boolfindRamTarget()
public function findRamTarget() : ?\pocketmine\entity\LivingPicks a mob or a survival player 4 to 16 blocks away in sight (not goats).
getHornCount()
public function getHornCount() : intgetInitialSizeInfo() protected
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetLongJumpGoal()
public function getLongJumpGoal() : \pocketmine\entity\ai\goal\LongJumpGoalgetName()
public function getName() : stringgetNetworkTypeId()
public static function getNetworkTypeId() : stringinitEntity() protected
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisBreedingItem()
public function isBreedingItem(\pocketmine\item\Item $item) : boolisLongJumping()
public function isLongJumping() : boolisScreamer()
public function isScreamer() : boolonInteractWithItem() protected
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : boolplayAmbientSound() protected
protected function playAmbientSound() : voidramBlock()
public function ramBlock(\pocketmine\math\Vector3 $direction) : voidramInto()
public function ramInto(\pocketmine\entity\Living $target, \pocketmine\math\Vector3 $direction) : voidregisterGoals() protected
protected function registerGoals() : voidresetRamCooldown()
public function resetRamCooldown() : voidsaveNBT()
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsetHornCount()
public function setHornCount(int $horns) : voidsetRamming()
public function setRamming(bool $ramming) : voidsetScreamer()
public function setScreamer(bool $screamer) : voidsyncNetworkData() protected
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void