<Pix3lPirat3> ```JS
let createBot;
let pathfinder, Movements;
let mineflayer = {
startClient: async function(options) {
if(!createBot) createBot = require('mineflayer').createBot;
if(!pathfinder) pathfinder = require('mineflayer-pathfinder').pathfinder;
if(!Movements) Movements = require('mineflayer-pathfinder').Movements;
Anyone know a way to compress this? I'm using this style of loading so the initial loadtime is faster (since startClient isn't called until a player launches a client)
Just something to compress it, such as, but can't seem to figure out how to do it like:
let { pathfinder, Movements } = require('mineflayer-pathfinder')
```
Anyone know a way to compress this? I'm using this style of loading so the initial loadtime is faster (since startClient isn't called until a player launches a client)
Just something to compress it, such as, but can't seem to figure out how to do it like:
```JS
let { pathfinder, Movements } = require('mineflayer-pathfinder')
<Pix3lPirat3> ```JS
let createBot;
let pathfinder, Movements;
let mineflayer = {
startClient: async function(options) {
if(!createBot) createBot = require('mineflayer').createBot;
let pathfinder_module = require('mineflayer-pathfinder');
if(!pathfinder) pathfinder = pathfinder_module.pathfinder;
if(!Movements) Movements = pathfinder_module.Movements;
````
depending on the module this make may more sense..
connect
command, if --edition: bedrock
is called it'll load bedrock-protocol
stuff, otherwise by default mineflayer
libs are loaded