hello i cant spawn npc by command it give me error PHP: elseif($cmd[0] === "/npc"){ $npc = new Human($player->chunk, $block->x = cos($player->yaw * M_PI / 180); $block->z = sin($player->yaw * M_PI / 180); new CompoundTag("", [ "Pos" => new ListTag("Pos", [ new DoubleTag("", $block->getX()), new DoubleTag("", $block->getY()), new DoubleTag("", $block->getZ()) ]), "Motion" => new ListTag("Motion", [ new DoubleTag("", 0), new DoubleTag("", 0), new DoubleTag("", 0) ]), "Rotation" => new ListTag("Rotation", [ new FloatTag("", 90), new FloatTag("", 0) ]), "Skin" => new CompoundTag("Skin", [ "Data" => new StringTag("Data", $player->getSkinData()) ]) ] )); $npc->spawnToAll(); $npc->setDataProperty(Entity::DATA_NAMETAG, Entity::DATA_TYPE_STRING, "§l§9Annihilation1"); $npc->setDataProperty(Entity::DATA_SHOW_NAMETAG, Entity::DATA_TYPE_BYTE, 1); { error: [Server thread/CRITICAL]: ParseError: "syntax error, unexpected ';', expecting ',' or ')'" (EXCEPTION) in "myzip:///WCore.zip#WCore/src/WallCore/Main" at line 191 HELP ME PLS
PHP: <?phpif($cmd[0] === "/npc"){ $block->x = cos($player->yaw * M_PI / 180); $block->z = sin($player->yaw * M_PI / 180); new CompoundTag("", [ "Pos" => new ListTag("Pos", [ new DoubleTag("", $block->getX()), new DoubleTag("", $block->getY()), new DoubleTag("", $block->getZ()) ]), "Motion" => new ListTag("Motion", [ new DoubleTag("", 0), new DoubleTag("", 0), new DoubleTag("", 0) ]), "Rotation" => new ListTag("Rotation", [ new FloatTag("", 90), new FloatTag("", 0) ]), "Skin" => new CompoundTag("Skin", [ "Data" => new StringTag("Data", $player->getSkinData()) ]) ] ); //You had a double ) here
You have obviously an error in the long CompoundTag / NBT code. By the way, is the last {} supposed to be { instead of }