Skip to content

Beehive 5.46.0 ​

class · pocketmine\block\tile\Beehive · source

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 = 3

TAG_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) : void

addOccupant() ​

php
public function addOccupant(string $actorIdentifier, \pocketmine\nbt\tag\CompoundTag $saveData, int $ticksLeftToStay) : bool

Puts 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() : int

hasOccupants() ​

php
public function hasOccupants() : bool

isFull() ​

php
public function isFull() : bool

readSaveData() ​

php
public function readSaveData(\pocketmine\nbt\tag\CompoundTag $nbt) : void

takeLeavingOccupants() ​

php
public function takeLeavingOccupants(int $ticks, bool $all = false) : array

Counts 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

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