Skip to content

SleepInBedGoal 5.46.0 ​

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

Extends VillagerGoal

Walks to the claimed bed at night and sleeps in it until morning (vanilla behavior.sleep, priority 3, speed 0.6, timeout cooldown 10 seconds). The villager wakes up when its schedule moves on, when it is hurt or when its bed is broken or used by a player. A villager that can't reach its bed before giving up releases it and looks for another one.

Constants ​

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, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.