Skip to content

SpawnHerd 5.46.0 ​

final class · pocketmine\world\mobs\spawn\SpawnHerd · source

One entry of a spawn rule's "minecraft:herd" component: how many mobs spawn together, and the entity events applied to them ("event" to the members after the first "event_skip_count", "initial_event" to the first "initial_event_count").

Properties ​

$event ​

php
public readonly ?string $event

$eventSkipCount ​

php
public readonly int $eventSkipCount

$initialEvent ​

php
public readonly ?string $initialEvent

$initialEventCount ​

php
public readonly int $initialEventCount

$maxSize ​

php
public readonly int $maxSize

$minSize ​

php
public readonly int $minSize

Methods ​

__construct() ​

php
public function __construct(int $minSize, int $maxSize, ?string $event = null, int $eventSkipCount = 0, ?string $initialEvent = null, int $initialEventCount = 0)

getEventFor() ​

php
public function getEventFor(int $index) : ?string

Returns the event applied to the herd member at this index (0 = the first one spawned), if any.

rollSize() ​

php
public function rollSize() : int

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