Bee 5.46.0
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
public const TAG_ANGER_TIME = "AngerTime"TAG_HAS_NECTAR
public const TAG_HAS_NECTAR = "HasNectar"TAG_HAS_STUNG
public const TAG_HAS_STUNG = "HasStung"TAG_HIVE_X
public const TAG_HIVE_X = "HivePosX"TAG_HIVE_Y
public const TAG_HIVE_Y = "HivePosY"TAG_HIVE_Z
public const TAG_HIVE_Z = "HivePosZ"TAG_PERISH_TIME
public const TAG_PERISH_TIME = "PerishTime"Methods
attack()
public function attack(\pocketmine\event\entity\EntityDamageEvent $source) : voidattackMelee()
public function attackMelee(\pocketmine\entity\Living $target, float $baseDamage) : boolbecomeAngryAt()
public function becomeAngryAt(\pocketmine\entity\Living $target) : voidMakes the bee angry at the entity (and lets it sting it).
createBaby() protected
protected function createBaby(\pocketmine\entity\animal\Animal $partner, \pocketmine\entity\Location $location) : \pocketmine\entity\animal\AnimalentityBaseTick() protected
protected function entityBaseTick(int $tickDiff = 1) : boolfindFlower()
public function findFlower() : ?\pocketmine\math\Vector3Looks for a flower within 6 blocks horizontally and 4 vertically (a few random tries).
getFlyingSpeed() protected
protected function getFlyingSpeed() : floatgetHivePosition()
public function getHivePosition() : ?\pocketmine\math\Vector3getInitialSizeInfo() protected
protected function getInitialSizeInfo() : \pocketmine\entity\EntitySizeInfogetName()
public function getName() : stringgetNetworkTypeId()
public static function getNetworkTypeId() : stringhasNectar()
public function hasNectar() : boolhasStung()
public function hasStung() : boolinitEntity() protected
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : voidisAngry()
public function isAngry() : boolisBreedingItem()
public function isBreedingItem(\pocketmine\item\Item $item) : boolisNight()
public function isNight() : boolisPollinatable()
public static function isPollinatable(\pocketmine\block\Block $block) : boolregisterGoals() protected
protected function registerGoals() : voidsaveNBT()
public function saveNBT() : \pocketmine\nbt\tag\CompoundTagsetAttackTarget()
public function setAttackTarget(?\pocketmine\entity\Living $target) : voidsetHasNectar()
public function setHasNectar(bool $nectar) : voidsetHivePosition()
public function setHivePosition(?\pocketmine\math\Vector3 $hive) : voidsyncNetworkData() protected
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : voidtryEnterHive()
public function tryEnterHive() : boolEnters the hive if the bee is next to it. Returns whether it did.
wantsToGoHome()
public function wantsToGoHome() : bool