How to use the flying-squid.createMCServer function in flying-squid

To help you get started, we’ve selected a few flying-squid examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github PrismarineJS / flying-squid / test / mineflayer.js View on Github external
beforeEach(async function () {
    this.timeout(60 * 1000);
    const options = settings;
    options["online-mode"]=false;
    options["port"]=25566;
    options["view-distance"]=2;
    options["worldFolder"]=undefined;

    serv=mcServer.createMCServer(options);

    await once(serv,"listening");
    bot = mineflayer.createBot({
      host: "localhost",
      port: 25566,
      username: "bot",
      version: "1.8"
    });
    bot2 = mineflayer.createBot({
      host: "localhost",
      port: 25566,
      username: "bot2",
      version: "1.8"
    });

    await Promise.all([once(bot,'login'),once(bot2,'login')]);