I have an error in my code but I do not understand why. Can you help me ? Error : HTML: [Server thread/CRITICAL]: ParseError: "syntax error, unexpected ';', expecting ',' or ')'" (EXCEPTION) in "GunCore v17/src/GunCore/Main" at line 515 Code : PHP: public function boss(Position $spawnPos) { $animalId = Entity::ZOMBIE; $entity = Entity::createEntity($animalId, $spawnPos->getLevel(), Entity::createNBT($spawnPos); $entity->setMaxHealth(500); $entity->setHealth(500); $entity->setScale(5); $entity->setNameTag("§8<§aTITAN§8>"); $entity->spawnToAll(); }
Try this. PHP: $entity = Entity::createEntity(Entity::ZOMBIE, $this->getServer()->getLevelByName("spawn"), $nbt);
$nbt isn't defined there? You forgot a ) after $spawnPos. You have an opening ( after createEntity, but no closing one for it, so you should have two closing ) at the end of that line, like this: PHP: $entity = Entity::createEntity($animalId, $spawnPos->getLevel(), Entity::createNBT($spawnPos)); I'd suggest learning a bit more about syntax if you see more errors like that. It makes things difficult later on otherwise.