Skip to content

PetSleepWithOwnerGoal 5.46.0 ​

class · pocketmine\entity\ai\goal\PetSleepWithOwnerGoal · source

Extends Goal

A tamed cat goes to sleep on the bed its owner is sleeping in (vanilla behavior.pet_sleep_with_owner, speed 1.2): it walks to the foot of the bed, hops on it and sleeps there until the owner wakes up, which makes it want to give its owner a morning gift (on_wake_with_owner, see DropGiftForOwnerGoal). Sitting cats stay where they are.

Constants ​

GIVE_UP_TICKS ​

php
public const GIVE_UP_TICKS = 400

Ticks to reach the bed before giving up.

SEARCH_HEIGHT ​

php
public const SEARCH_HEIGHT = 10

SEARCH_RANGE ​

php
public const SEARCH_RANGE = 16

Owner search box: 16 blocks sideways, 10 up or down (search_height).

SPEED ​

php
public const SPEED = 1.2

Properties ​

$cat ​

php
public \pocketmine\entity\animal\Cat $cat

Methods ​

__construct() ​

php
public function __construct(\pocketmine\entity\animal\Cat $cat)

canContinue() ​

php
public function canContinue() : bool

canStart() ​

php
public function canStart() : bool

getFlags() ​

php
public function getFlags() : int

isLying() ​

php
public function isLying() : bool

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.