MoveTowardsDwellingGoal 5.47.0
Extends MoveTowardsHomeRestrictionGoal
A villager that strayed out of its village walks back (vanilla behavior.move_towards_dwelling_restriction: priority 11, speed 0.6). The dwelling is the villager's bed and the radius around it (see VillagerV2::getHomeRadius()); villagers without a bed roam freely. After each leg the goal waits a few seconds, so that a villager that can't get back (boxed in a trading hall) doesn't search paths over and over.
Constants
SPEED
php
public const SPEED = 0.6Methods
__construct()
php
public function __construct(\pocketmine\entity\npc\VillagerV2 $villager)canStart()
php
public function canStart() : boolstop()
php
public function stop() : void