EntitySpawnRegistry 5.46.0
Maps Bedrock entity identifiers (e.g. "minecraft:cow") to factories creating a new entity of that type at a location, as a spawn egg, /summon or a monster spawner would.
Spawn eggs (\pocketmine\item\SpawnEgg) look up their entity here, so registering a factory for a mob makes its egg work. Plugins can register their own mobs or replace the built-in ones.
Methods
__construct()
php
public function __construct()create()
php
public function create(string $identifier, \pocketmine\entity\Location $location) : ?\pocketmine\entity\EntityCreates (without spawning to players) an entity of the given type, or returns null if there is no factory for it.
getIdentifiers()
php
public function getIdentifiers() : arrayisRegistered()
php
public function isRegistered(string $identifier) : boolregister()
php
public function register(string $identifier, \Closure $factory) : voidunregister()
php
public function unregister(string $identifier) : void