Skip to content

Bee 5.46.0 ​

class · pocketmine\entity\animal\Bee · source

Extends Animal

Bedrock values (entities/bee.json): 10 health, 0.55x0.5, flies (flying speed 0.15, 1.4x when angry), babies scale 0.5. Hurt by a player, it gets angry (ANGRY) with the bees around it and stings once: 2 damage plus poison (10 s on normal, 18 s on hard, none on easy), then loses its stinger (MARK_VARIANT 1) and dies 50-60 seconds later. Without nectar it looks for flowers within 6 blocks and pollinates one for a second (actor property minecraft:has_nectar); with nectar it grows the crops it flies over (up to 10) and goes back to its hive, as it does at night; it finds a free hive or nest within 16 blocks if it has none. Tempted (1.25x) and bred with flowers. No loot; XP 1-3.

Constants ​

TAG_ANGER_TIME ​

php
public const TAG_ANGER_TIME = "AngerTime"

TAG_HAS_NECTAR ​

php
public const TAG_HAS_NECTAR = "HasNectar"

TAG_HAS_STUNG ​

php
public const TAG_HAS_STUNG = "HasStung"

TAG_HIVE_X ​

php
public const TAG_HIVE_X = "HivePosX"

TAG_HIVE_Y ​

php
public const TAG_HIVE_Y = "HivePosY"

TAG_HIVE_Z ​

php
public const TAG_HIVE_Z = "HivePosZ"

TAG_PERISH_TIME ​

php
public const TAG_PERISH_TIME = "PerishTime"

Methods ​

attack() ​

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

attackMelee() ​

php
public function attackMelee(\pocketmine\entity\Living $target, float $baseDamage) : bool

becomeAngryAt() ​

php
public function becomeAngryAt(\pocketmine\entity\Living $target) : void

Makes the bee angry at the entity (and lets it sting it).

createBaby() protected ​

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

entityBaseTick() protected ​

php
protected function entityBaseTick(int $tickDiff = 1) : bool

findFlower() ​

php
public function findFlower() : ?\pocketmine\math\Vector3

Looks for a flower within 6 blocks horizontally and 4 vertically (a few random tries).

getFlyingSpeed() protected ​

php
protected function getFlyingSpeed() : float

getHivePosition() ​

php
public function getHivePosition() : ?\pocketmine\math\Vector3

getInitialSizeInfo() protected ​

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

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

hasNectar() ​

php
public function hasNectar() : bool

hasStung() ​

php
public function hasStung() : bool

initEntity() protected ​

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

isAngry() ​

php
public function isAngry() : bool

isBreedingItem() ​

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

isNight() ​

php
public function isNight() : bool

isPollinatable() ​

php
public static function isPollinatable(\pocketmine\block\Block $block) : bool

registerGoals() protected ​

php
protected function registerGoals() : void

saveNBT() ​

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

setAttackTarget() ​

php
public function setAttackTarget(?\pocketmine\entity\Living $target) : void

setHasNectar() ​

php
public function setHasNectar(bool $nectar) : void

setHivePosition() ​

php
public function setHivePosition(?\pocketmine\math\Vector3 $hive) : void

syncNetworkData() protected ​

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

tryEnterHive() ​

php
public function tryEnterHive() : bool

Enters the hive if the bee is next to it. Returns whether it did.

wantsToGoHome() ​

php
public function wantsToGoHome() : bool

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