SpawnEgg
Extends Item
Methods
createEntity() protected
php
protected function createEntity(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos, float $yaw, float $pitch) : ?\pocketmine\entity\EntityCreates the entity of this egg, or returns null if there is none. By default, the entity is created by the factory registered in EntitySpawnRegistry for SpawnEgg::getEntityTypeId().
getEntityTypeId() 5.46.0
php
public function getEntityTypeId() : ?stringReturns the Bedrock identifier of the mob in this egg (e.g. "minecraft:zombie"), used to set the mob of a monster spawner, or null if unknown.
onInteractBlock()
php
public function onInteractBlock(\pocketmine\player\Player $player, \pocketmine\block\Block $blockReplace, \pocketmine\block\Block $blockClicked, int $face, \pocketmine\math\Vector3 $clickVector, array &$returnedItems) : \pocketmine\item\ItemUseResultspawnEntity() 5.46.0
php
public function spawnEntity(\pocketmine\world\World $world, \pocketmine\math\Vector3 $pos, float $yaw, float $pitch) : ?\pocketmine\entity\EntityCreates and spawns the entity of this egg at the given position (e.g. for dispensers). Does not consume the egg. Returns null if there is no entity implementation for this egg's mob.
