Skip to content

ExploreOutskirtsGoal 5.47.0 ​

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

Extends VillagerGoal

During wander time villagers walk to the outskirts of their village and look around there (vanilla behavior.explore_outskirts in wander_schedule_villager: priority 9, speed 0.6, explore_dist 6, max_wait_time 10 s, min_dist_from_target 2.5; defaults max_travel_time 60 s, next_xz 5, next_y 3, timer_ratio 2).

The village edge is the dwelling radius around the villager's bed (see \pocketmine\entity\npc\VillagerV2::getHomeRadius()): the villager heads for a random point within 6 blocks inside it, in legs of RaidMoveGoal::STEP blocks, then explores spots up to 5 blocks around, waiting up to 10 seconds at each, for twice the time the trip took. Villagers without a bed don't explore. A leg the villager can't walk (no path, or a partial one that leaves it where it was: pens, iron farms, walled villages) ends the trip, like a failed path ends vanilla goals; the next exploration then waits ExploreOutskirtsGoal::COOLDOWN_MAX ticks, twice as long after two failed ones in a row and four times after three or more, so that villagers which can't leave their pen don't keep searching paths out of it.

Constants ​

EXPLORE_DISTANCE ​

php
public const EXPLORE_DISTANCE = 6

SPEED ​

php
public const SPEED = 0.6

Methods ​

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.