Hi, I am making a plugin and an error occurred the error is PHP: 2021-03-21 [12:00:02] [Server thread/CRITICAL]: Error: "Call to a member function spawnToAll() on null" (EXCEPTION) in "plugins/⚔Boss.phar/src/Boss/Loader" at line 189 And the code is:- PHP: public function onInteract(PlayerInteractEvent $event) : void{ $item = $event->getItem(); $block = $event->getBlock(); if($item instanceof SpawnEgg){ if(isset(self::EGG_LIST[$item->getDamage()])){ $bossName = self::EGG_LIST[$item->getDamage()]; $nbt = Entity::createBaseNBT(new Vector3($block->getX(), $block->getY() + 1.5, $block->getZ()));; $bossEntity = Entity::createEntity("Zeus", $event->getPlayer()->level, $nbt); $bossEntity->spawnToAll(); if($bossEntity instanceof ZeusBoss){ $bossEntity->setAnAdult(); } $this->registredEntities[$bossEntity->getId()] = $bossEntity; } } }[/B]
So how I should register the entity here PHP: $this->registredEntities[$bossEntity->getId()] = $bossEntity; Can I do like this PHP: $this->registredEntities($this, Zeus);
Why would you lie about "making" this plugin when you clearly have no idea what you're doing? It's totally fine to ask for help, you don't have to lie about anything.
You don't even need to look in PMMP source. Just research, darn it! https://github.com/RevivalPMMP/Pure...lpmmp/pureentities/PureEntities.php#L117-L178 https://github.com/Heisenburger69/B...r69/BurgerSpawners/Entities/EntityManager.php