MongoDB Loader
Modern MongoDB database connectivity for Minecraft servers
What is MongoDB Loader?
MongoDB Loader is a powerful library plugin that enables seamless MongoDB database connectivity for Minecraft plugins. Built with the latest
mongodb-driver-sync library, it provides a reliable foundation for plugins that need modern database functionality.
✨ Key Features
- Universal Platform Support - Works across Bukkit, Spigot, Paper, BungeeCord, Velocity, and Sponge
- Latest MongoDB Driver - Always includes the most recent MongoDB Java driver
- Automatic Platform Detection - Single JAR works on all supported platforms
- Zero Configuration - Just drop it in your plugins folder
- Developer-Friendly - Easy integration for plugin developers
- Performance Optimized - Minimal overhead and efficient connections
️ Supported Platforms
- Bukkit/Spigot/Paper - Traditional Minecraft servers
- BungeeCord - Proxy server for Minecraft networks
- Velocity - Modern, high-performance proxy server
- Sponge - Plugin platform for Minecraft servers
Installation for Server Owners
MongoDB Loader is a
dependency plugin - other plugins require it to connect to MongoDB databases.
Installation Steps:
- Download the latest mongodb-loader-<version>.jar
- Copy the JAR file to your server directory:
- Bukkit/Spigot/Paper: plugins/ directory
- BungeeCord: plugins/ directory
- Velocity: plugins/ directory
- Sponge: mods/ directory
- Start your server - the plugin will automatically detect your platform
- Install any plugins that depend on MongoDB Loader
⚠️ Important Note: MongoDB Loader doesn't add gameplay features by itself - it's a library that other plugins use for database connectivity.
For Plugin Developers
Adding as a Dependency
Configure your plugin to depend on MongoDB Loader:
Bukkit/Spigot/Paper (plugin.yml):
Code (Text):
# Required dependency
depend: [MongoDBLoader]
# Optional dependency
softdepend: [MongoDBLoader]
BungeeCord (bungee.yml):
Code (Text):
# Required dependency
depends: [MongoDBLoader]
# Optional dependency
softDepends: [MongoDBLoader]
Velocity (velocity-plugin.json):
Code (Text):
{
"dependencies": [
{
"id": "mongodb-loader",
"optional": false
}
]
}
Sponge:
Code (Text):
@Plugin("your-plugin-id")
@Dependency("mongodb-loader")
public class YourPlugin {
// ...
}
Basic Usage Example
Code (Text):
import com.mongodb.client.MongoClient;
import com.mongodb.client.MongoClients;
import com.mongodb.client.MongoDatabase;
import org.bukkit.plugin.java.JavaPlugin;
public class YourPlugin extends JavaPlugin {
private MongoClient mongoClient;
private MongoDatabase database;
@Override
public void onEnable() {
// Connect to MongoDB
mongoClient = MongoClients.create("mongodb://localhost:27017");
database = mongoClient.getDatabase("minecraft_server");
getLogger().info("Connected to MongoDB!");
}
@Override
public void onDisable() {
if (mongoClient != null) {
mongoClient.close();
}
}
}
Advanced Features Available
- Transactions - Multi-document ACID operations
- Aggregation Pipeline - Complex data processing
- Change Streams - Real-time data monitoring
- GridFS - Large file storage
- Indexes - Query optimization
Resources & Links
Support the Project
If MongoDB Loader helps your project, consider:
- ⭐ Starring the repository on GitHub
- Reporting bugs or suggesting features
- Sharing with other developers
- Contributing improvements
MongoDB Loader - Connecting Minecraft to the world of modern databases