PrismarineJS / mineflayer

Create Minecraft bots with a powerful, stable, and high level JavaScript API.
https://prismarinejs.github.io/mineflayer/
MIT License
4.95k stars 904 forks source link

Ability to choose which plugins are enabled #74

Closed yocontra closed 11 years ago

yocontra commented 11 years ago

Would be nice to be able to add your own plugins easier, disable/enable plugins, etc.

# add a plugin
mineflayer.use 'pluginName', (bot) ->
  # this relies on pluginTwo
  bot.enable 'pluginTwo'

mineflayer.disable 'pluginName'

bot = mineflayer.createBot()
bot.disable 'pluginName'

You could then include plugins that are disabled by default (for performance or other reasons) and enable them manually like so

bot = mineflayer.createBot()
bot.enable 'radar'
andrewrk commented 11 years ago

You can already add your own plugins. Simply add methods to the bot object and emit events on the bot object. That's how mineflayer's plugins do it.

Ability to disable plugins might be something that we do. I'll keep the issue open until the decision is made.

andrewrk commented 11 years ago

Here's an example of adding a 3rd party plugin: https://github.com/superjoe30/mineflayer-navigate/

andrewrk commented 11 years ago

I'm going to make the executive decision to always have all core plugins on. If it can be shown that there is a legitimate use case for disabling plugins then we can re-open this issue.