Closed Asguho closed 6 days ago
I'm late, but if someone like me searches for a fix, here it is: go to node_modules\@nxg-org\mineflayer-custom-pvp\lib open index.js and change the last line: exports.default = plugin;
to: exports.plugin = plugin;
I'm late, but if someone like me searches for a fix, here it is: go to node_modules@nxg-org\mineflayer-custom-pvp\lib open index.js and change the last line: exports.default = plugin;
to: exports.plugin = plugin;
Also, instead of using const customPVP = require("@nxg-org/mineflayer-custom-pvp/lib/index.js"); use const customPVP = require("@nxg-org/mineflayer-custom-pvp/lib/index.js").plugin
@Ziro-Zan tysm
when i run the code above, it gets an error when running "bot.loadPlugin(customPVP)". The error message:
Debugger attached. Waiting for the debugger to disconnect... node:assert:399 throw err; ^
AssertionError [ERR_ASSERTION]: plugin needs to be a function at EventEmitter.loadPlugin ([c:\PATHTOFOLDER\custom-pvp\node_modules\mineflayer\lib\plugin_loader.js:16:12]()) at Object. ([c:\PATHTOFOLDER\custom-pvp\index.js:13:5]())
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
generatedMessage: false,
code: 'ERR_ASSERTION',
actual: false,
expected: true,
operator: '=='