sefirosweb / minecraftHawkEye

Minecraft bot for equations when shooting an arrow
27 stars 3 forks source link

Cannot load plugin into bot #20

Closed kidzukii closed 1 year ago

kidzukii commented 1 year ago

The console logs an error: "plugin needs to be a function". Yields error even for code copied from readme.md.

tyjtyj commented 1 year ago

i getting this to

node perfectShotBow.js xxxxxxx xxxxxxxxxxx xxx xxxxxx
node:assert:400
    throw err;
    ^

AssertionError [ERR_ASSERTION]: plugin needs to be a function
    at EventEmitter.loadPlugin (/root/mineflayer/node_modules/mineflayer/lib/plugin_loader.js:16:12)
    at Object.<anonymous> (/root/mineflayer/perfectShotBow.js:10:5)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '=='
}
Neotastisch commented 1 year ago

Fix: const minecraftHawkEye = require('minecrafthawkeye'); bot.loadPlugin(minecraftHawkEye.default)

sefirosweb commented 1 year ago

Hello guys, could you attach the code?

What @Neotastisch says should fix the problem

Neotastisch commented 1 year ago

Hello guys, could you attach the code?

What @Neotastisch says should fix the problem

You can merge my Pull Request, which fixes the readme

sefirosweb commented 1 year ago

@kidzukii if you update the package no need to add .default, in latest version are fixed