Beehive 5.46.0
Extends Spawnable
Beehive and bee nest block entity, holding the bees inside in the vanilla "Occupants" list (entries {ActorIdentifier, SaveData, TicksLeftToStay}). Bees enter with Beehive::addOccupant(); the hive block counts their time down and releases them (see \pocketmine\block\Beehive::onScheduledUpdate()).
Constants
MAX_OCCUPANTS
php
public const MAX_OCCUPANTS = 3TAG_ACTOR_IDENTIFIER
php
public const TAG_ACTOR_IDENTIFIER = "ActorIdentifier"TAG_OCCUPANTS
php
public const TAG_OCCUPANTS = "Occupants"TAG_SAVE_DATA
php
public const TAG_SAVE_DATA = "SaveData"TAG_SHOULD_SPAWN_BEES
php
public const TAG_SHOULD_SPAWN_BEES = "ShouldSpawnBees"TAG_TICKS_LEFT
php
public const TAG_TICKS_LEFT = "TicksLeftToStay"Methods
addAdditionalSpawnData() protected
php
protected function addAdditionalSpawnData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidaddOccupant()
php
public function addOccupant(string $actorIdentifier, \pocketmine\nbt\tag\CompoundTag $saveData, int $ticksLeftToStay) : boolPuts a bee (its saved data) in the hive for the given number of ticks. Returns false if the hive is full.
getOccupantCount()
php
public function getOccupantCount() : inthasOccupants()
php
public function hasOccupants() : boolisFull()
php
public function isFull() : boolreadSaveData()
php
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : voidtakeLeavingOccupants()
php
public function takeLeavingOccupants(int $ticks, bool $all = false) : arrayCounts the time of the bees inside down and removes those whose time is up (or all of them with $all). Returns the saved data of the removed bees.
writeSaveData() protected
php
protected function writeSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void