Skip to content

VillagerGoal 5.46.0 ​

abstract class · pocketmine\entity\ai\villager\VillagerGoal · source

Extends Goal

Base of the villager schedule goals: walking to a block (bed, job site, bell, crop).

Properties ​

$villager ​

php
public \pocketmine\entity\npc\VillagerV2 $villager

Methods ​

__construct() ​

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

isNear() protected ​

php
protected function isNear(\pocketmine\math\Vector3 $block, float $reach) : bool

Whether the villager stands within $reach blocks (horizontally, and 2 blocks vertically) of the centre of the block.

walkTo() protected ​

php
protected function walkTo(\pocketmine\math\Vector3 $block, float $speed, float $reach) : bool

Keeps walking towards the block (a new path is requested once the last one ended). Returns true once within $reach of it.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.