Set Up a Plugin to Use MongoDB Storage
Add the Dependency
Before your plugin can store data in MongoDB, you need to tell the server that MongoDB Loader Plugin must load first.
1. Open your plugin's plugin.yml file
2. Add a new line under your plugin's basic information
3. Type depend: [MongoDBLoader] if your plugin cannot run without database access
4. Type softdepend: [MongoDBLoader] if your plugin works alone but uses MongoDB when available
5. Save the file
Restart Your Server
Once you've updated plugin.yml, restart the server. The server reads this file during startup and loads plugins in the correct order. MongoDB Loader Plugin will initialize first, preparing database connection tools for your plugin to use.
If you see errors about missing database classes or connection failures after restart, verify that MongoDB Loader Plugin is installed in your plugins folder and that your plugin.yml syntax is correct. Check that there are no typos in the plugin name or bracket formatting.