Skip to content

IronGolemMoveThroughVillageGoal 5.47.0 ​

class · pocketmine\entity\golem\IronGolemMoveThroughVillageGoal · source

Extends Goal

At night an iron golem in a village patrols it, walking from one point of interest (bed, bell, job site) to the nearest one it didn't visit lately (vanilla behavior.move_through_village: only_at_night, speed 0.6, priority 3; Java MoveThroughVillageGoal remembers the last 15 places).

The village comes from IronGolem::getVillage(), refreshed every few seconds; the goal itself tries at most once every two seconds.

Constants ​

SPEED ​

php
public const SPEED = 0.6

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\golem\IronGolem $golem)

canContinue() ​

php
public function canContinue() : bool

canStart() ​

php
public function canStart() : bool

getFlags() ​

php
public function getFlags() : int

isNight() ​

php
public static function isNight(\pocketmine\world\World $world) : bool

pickTarget() ​

php
public function pickTarget(\pocketmine\world\raid\Village $village, \pocketmine\math\Vector3 $from) : ?\pocketmine\math\Vector3

Returns the nearest point of interest of the village not visited lately (forgetting them all once every one was visited).

start() ​

php
public function start() : void

stop() ​

php
public function stop() : void

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