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

Added better handling for automatic dependency resolution between plugins #1412

Merged
merged 4 commits into from
Nov 1, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Make note about plugin API namespace.
Signed-off-by: TheDudeFromCI <thedudefromci@gmail.com>
  • Loading branch information
TheDudeFromCI committed Oct 29, 2020
commit e36c9bae83bddaff82f464e64e3babe22cef7319
6 changes: 4 additions & 2 deletions docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1378,13 +1378,15 @@ function somePlugin(bot, options) {
function someFunction() {
bot.chat('Yay!');
}
bot.someFunction = someFunction;

bot.myPlugin = {} // Good practice to namespace plugin API
bot.myPlugin.someFunction = someFunction;
}

var bot = mineflayer.createBot(...);
bot.loadPlugin(somePlugin);
bot.once('login', function() {
bot.someFunction(); // Yay!
bot.myPlugin.someFunction(); // Yay!
});
```

Expand Down