Skip to content

BegGoal 5.47.0 ​

class · pocketmine\entity\ai\goal\BegGoal · source

Extends Goal

A wolf looks at the nearest player within 8 blocks holding a bone or meat (main hand or off hand) with its head tilted (vanilla behavior.beg: look_distance 8, look_time 20-40 ticks; the INTERESTED flag, see Wolf::setInterested()), as long as the player keeps holding it.

Looking for a player is one pass over the world's players on goal evaluations (see \pocketmine\entity\ai\sensing\Sensing::getNearestPlayer()), most of them skipped by their distance.

Constants ​

LOOK_DISTANCE ​

php
public const LOOK_DISTANCE = 8.0

MAX_LOOK_TICKS ​

php
public const MAX_LOOK_TICKS = 40

MIN_LOOK_TICKS ​

php
public const MIN_LOOK_TICKS = 20

Properties ​

$range ​

php
public float $range

$wolf ​

php
public \pocketmine\entity\animal\Wolf $wolf

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\animal\Wolf $wolf, float $range = self::LOOK_DISTANCE)

canContinue() ​

php
public function canContinue() : bool

canStart() ​

php
public function canStart() : bool

getFlags() ​

php
public function getFlags() : int

start() ​

php
public function start() : void

stop() ​

php
public function stop() : void

tick() ​

php
public function tick() : void

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.