PHP: $nbt = Entity::createBaseNBT($level->getSafeSpawn(), null, 2, 2);$npc = new Cow("Cow", $level, $nbt);$npc->spawnToAll();
Look at how PocketMine does it! PHP: //from Bow.php$entity = new ArrowEntity(Location::fromObject( $player->getEyePos(), $player->getWorld(), ($location->yaw > 180 ? 360 : 0) - $location->yaw, -$location->pitch), $player, $baseForce >= 1);$entity->spawnToAll(); https://github.com/pmmp/PocketMine-MP/blob/stable/src/item/Bow.php