Skip to content

MoveTowardsDwellingGoal 5.47.0 ​

class · pocketmine\entity\ai\villager\MoveTowardsDwellingGoal · source

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.6

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\npc\VillagerV2 $villager)

canStart() ​

php
public function canStart() : bool

stop() ​

php
public function stop() : void

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