Fox 5.46.0
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
public const TAG_HELD_ITEM = "HeldItem"TAG_TRUSTED
public const TAG_TRUSTED = "TrustedPlayers"TAG_VARIANT
public const TAG_VARIANT = "Variant"VARIANT_ARCTIC
public const VARIANT_ARCTIC = 1VARIANT_RED
public const VARIANT_RED = 0Methods
addTrustedPlayer()
public function addTrustedPlayer(\pocketmine\player\Player $player) : voidattack()
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : voidcanNap()
public function canNap() : boolWhether the fox may sleep now: daytime, on the ground, out of water, not hunting, nothing scary within 12 blocks.
createBaby() protected
protected function createBaby(\pocketmine\entity\animal\Animal $partner, \pocketmine\entity\Location $location) : \pocketmine\entity\animal\AnimalgetDrops()
public function getDrops() : arraygetHeldItem()
public function getHeldItem() : ?\pocketmine\item\ItemgetInitialSizeInfo() protected
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetName()
public function getName() : stringgetNetworkTypeId()
public static function getNetworkTypeId() : stringgetVariant()
public function getVariant() : intinitEntity() protected
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisBreedingItem()
public function isBreedingItem(\pocketmine\item\Item $item) : boolisPrey()
public static function isPrey(\pocketmine\entity\Living $entity) : boolisSleeping()
public function isSleeping() : boolonInteractWithItem() protected
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : boolrandomEquipment()
public static function randomEquipment() : \pocketmine\item\ItemAn item from loot_tables/entities/fox_equipment.json (by weight).
registerGoals() protected
protected function registerGoals() : voidsaveNBT()
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsendSpawnPacket() protected
protected function sendSpawnPacket(\pocketmine\player\Player $player) : voidsetHeldItem()
public function setHeldItem(?\pocketmine\item\Item $item) : voidsetSleeping()
public function setSleeping(bool $sleeping) : voidsetVariant()
public function setVariant(int $variant) : voidsyncNetworkData() protected
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : voidtrusts()
public function trusts(\pocketmine\player\Player $player) : boolvariantForBiome()
public static function variantForBiome(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos) : int