Cannot override bot.findBlock
See original GitHub issueGreetings,
I just installed https://github.com/Darthfett/mineflayer-blockFinder and after debugging my project I noticed that its implementation is always ignored in favor of the one in mineflayer.
Here’s some code snippets:
My project’s code:
var bot = mineflayer.createBot({
...
});
// Install the plugin - method override is done here
blockFinderPlugin(bot);
// Sample usage
bot.once('spawn', function() {
bot.findBlock(...) // the original findBlock is called instead of the plugin`s
});
The injection function blockFinderPlugin
is successfully called and the override code also succeeds:
function findBlockSync(options) {
...
}
function findBlock(options, callback) {
...
}
bot.findBlock = findBlock;
bot.findBlockSync = findBlockSync;
Yet the original function is always called instead. I don’t know if the issue belongs here or at the plugin dev’s repo, so apologies if this isn’t meant for here.
Cheers
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
PrismarineJS/mineflayer - Gitter
Create Minecraft bots with a powerful, stable, and high level JavaScript API. People. Repo info.
Read more >Why doesn't my code wait for the callback
I have a function that locates a block and goes to it with the help of the mineflayer-pathfinder module. Now my problem, after...
Read more >PrismarineJS/mineflayer (Raised $103.00)
bot unable to open most blocks that have a gui ... Bot cant chat on spawn ... SkinRestorer plugin: Some mineflayer features don't...
Read more >How to block spam messages on WhatsApp
Find "block contact" and "report contact" at the bottom. Credit: Screengrab: whatsapp. Go to the message thread that contains the spam ...
Read more >How to Unblock Someone on Discord on Desktop or Mobile
If you don't share a server with this person, or can't find one of their messages, you can unblock them directly from your...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ah yes, this is due to the new version system which guess the version and load the plugin afterwards. That should be fixed somehow
On Fri, Jun 23, 2017, 18:56 ViR Dash notifications@github.com wrote:
now fixed, have a look at https://github.com/Darthfett/mineflayer-blockfinder/pull/16