Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot override bot.findBlock #15

Open
ViRb3 opened this issue Jun 23, 2017 · 0 comments
Open

Cannot override bot.findBlock #15

ViRb3 opened this issue Jun 23, 2017 · 0 comments

Comments

@ViRb3
Copy link

ViRb3 commented Jun 23, 2017

Greetings,

I just installed this plugin 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 themain repo, so apologies if this isn't meant for here.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant