Skip to content

Fox 5.46.0 ​

class · pocketmine\entity\animal\Fox · source

Extends Animal

Bedrock values (entities/fox.json): 10 health, 0.6x0.7, movement 0.3, attack 2. Red (VARIANT 0) or arctic (1) in biomes tagged spawns_snow_foxes. Runs from players (unless they're trusted or sneaking), wolves and polar bears within 10 blocks; hunts chickens, rabbits, fish and baby turtles (stalk and pounce approximated by a leap); sleeps during the day when nothing is around (SLEEPING); tempted (0.5x) and bred with sweet or glow berries, and babies trust the players who bred their parents. 20% spawn holding an item (fox_equipment loot), dropped on death. Picking up and eating items is not implemented. XP 1-3.

Constants ​

TAG_HELD_ITEM ​

php
public const TAG_HELD_ITEM = "HeldItem"

TAG_TRUSTED ​

php
public const TAG_TRUSTED = "TrustedPlayers"

TAG_VARIANT ​

php
public const TAG_VARIANT = "Variant"

VARIANT_ARCTIC ​

php
public const VARIANT_ARCTIC = 1

VARIANT_RED ​

php
public const VARIANT_RED = 0

Methods ​

addTrustedPlayer() ​

php
public function addTrustedPlayer(\pocketmine\player\Player $player) : void

attack() ​

php
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : void

canNap() ​

php
public function canNap() : bool

Whether the fox may sleep now: daytime, on the ground, out of water, not hunting, nothing scary within 12 blocks.

createBaby() protected ​

php
protected function createBaby(\pocketmine\entity\animal\Animal $partner, \pocketmine\entity\Location $location) : \pocketmine\entity\animal\Animal

getDrops() ​

php
public function getDrops() : array

getHeldItem() ​

php
public function getHeldItem() : ?\pocketmine\item\Item

getInitialSizeInfo() protected ​

php
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfo

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getVariant() ​

php
public function getVariant() : int

initEntity() protected ​

php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : void

isBreedingItem() ​

php
public function isBreedingItem(\pocketmine\item\Item $item) : bool

isPrey() ​

php
public static function isPrey(\pocketmine\entity\Living $entity) : bool

isSleeping() ​

php
public function isSleeping() : bool

onInteractWithItem() protected ​

php
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : bool

randomEquipment() ​

php
public static function randomEquipment() : \pocketmine\item\Item

An item from loot_tables/entities/fox_equipment.json (by weight).

registerGoals() protected ​

php
protected function registerGoals() : void

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

sendSpawnPacket() protected ​

php
protected function sendSpawnPacket(\pocketmine\player\Player $player) : void

setHeldItem() ​

php
public function setHeldItem(?\pocketmine\item\Item $item) : void

setSleeping() ​

php
public function setSleeping(bool $sleeping) : void

setVariant() ​

php
public function setVariant(int $variant) : void

syncNetworkData() protected ​

php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void

trusts() ​

php
public function trusts(\pocketmine\player\Player $player) : bool

variantForBiome() ​

php
public static function variantForBiome(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos) : int

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