mc-js
Create Minecraft plugins in JavaScript instead of Java! Full Bukkit/Spigot/Paper API, Hot-Reload, Events, Commands, Databases, GUIs and more.
mc-js
🚀 MC-JS - JavaScript Plugin System for Minecraft
Write Minecraft Server Plugins in JavaScript - No Java Required!
MC-JS is a powerful plugin system that allows you to develop server plugins using modern JavaScript (ES6+) instead of Java. Perfect for developers who already know JavaScript or want to quickly create plugins without having to learn Java.
✨ Key Features
🎯 Core Capabilities
- 🔒 Player Management - Develop plugins in modern JavaScript using the Rhino Engine - 🔒 Player Management - Reload plugins without server restart (`/jsreload`) - 🔒 Player Management - Access to virtually all Bukkit/Spigot/Paper API functions - 🔒 Player Management - Register listeners for any Minecraft event with priority support - 🔒 Player Management - Create custom commands with full tab completion support - 🔒 Player Management - Synchronous and asynchronous task scheduling - 🔒 Player Management - Create and manage custom GUI menus using standard Bukkit inventories (9-54 slots) with click handlers - 🔒 Player Management - Built-in SQLite database operations (INSERT, UPDATE, DELETE, SELECT) - 🔒 Player Management - Make HTTP GET/POST requests asynchronously - 🔒 Player Management - MD5, SHA256, Base64 encoding/decoding - 🔒 Player Management - YAML, JSON, and text file support - 🔒 Player Management - Create and manage boss bars with progress tracking - 🔒 Player Management - Built-in cooldown management per player - 🔒 Player Management - Per-plugin configuration files (YAML) - 🔒 Player Management - Control weather, time, world border, explosions - 🔒 Player Management - Spawn, control, and customize entities - 🔒 Player Management - Ban, kick, teleport, health, food, gamemode
🛠️ Advanced Features
- 📊 Economy Integration - Spawn particles with string or enum support - 📊 Economy Integration - Play sounds at locations or for players - 📊 Economy Integration - Create and manage scoreboards, teams, objectives - 📊 Economy Integration - Create, modify, and manage items with custom names and lore - 📊 Economy Integration - Check and manage player permissions - 📊 Economy Integration - Minecraft color codes and formatting utilities - 📊 Economy Integration - Make external API calls and web requests - 📊 Economy Integration - Vault economy support for server economies
📦 Installation
Requirements
- Minecraft Version: Paper/Spigot 1.20+ (recommended: Paper) - Minecraft Version: Version 21 or higher - Minecraft Version: 1.20+
Steps
1. Create JS plugins from the Create JS plugins page 2. Create JS plugins in your server's `plugins/` folder 3. Create JS plugins your server 4. Create JS plugins in `plugins/MC-JS/js-plugins/` directory
The plugin will automatically create the `js-plugins` directory and copy an example plugin on first run.
🚀 Quick Start
Creating Your First Plugin
1. Add the following code `plugins/MC-JS/js-plugins/` directory 2. Add the following code with `.js` extension (e.g., `myplugin.js`) 3. Add the following code:
```javascript var pluginInfo = { name: "My First Plugin", version: "1.0.0", author: "YourName", description: "My awesome plugin!" };
function onEnable() { logger.info("My plugin is enabled!");
// Register a command api.registerCommand("hello", "Say hello", "/hello", function(sender, args) { api.sendMessage(sender, "&aHello from JavaScript!"); return true; });
// Register an event api.registerEvent("player.PlayerJoinEvent", function(event) { var player = event.getPlayer(); api.sendMessage(player, "&6Welcome to the server!"); }); }
function onDisable() { logger.info("My plugin is disabled!"); }
this.onEnable = onEnable; this.onDisable = onDisable; this.pluginInfo = pluginInfo; ```
4. Check console - The plugin will auto-load on server start, or use `/jsreload` to reload 5. Check console - Type `/hello` in-game or in console 6. Check console - Look for "My plugin is enabled!" message
> 💡 Tip: Use `/jslist` to see all loaded JavaScript plugins and `/jsreload <plugin>` to reload a specific plugin.
📚 Available Objects
These objects are automatically available in all JavaScript plugins:
| Object | Description | Usage | |--------|-------------|-------| | `api` | Complete JS API wrapper - main interface for all operations | `api.registerCommand(...)` | | `server` | Minecraft server instance | `server.getOnlinePlayers()` | | `plugin` | Main plugin instance | `plugin.getName()` | | `logger` | Plugin logger | `logger.info("Message")` | | `scheduler` | Server scheduler | `scheduler.runTask(...)` | | `Bukkit` | Direct Bukkit API access | `Bukkit.getServer()` |
🎮 Commands
| Command | Description | Permission | |---------|-------------|------------| | `/jsreload` | Reload all JS plugins | `mcjs.admin` | | `/jsreload <plugin>` | Reload specific plugin | `mcjs.admin` | | `/jslist` | List all loaded JS plugins | `mcjs.admin` | | `/jsconfig` | View or reload plugin configuration | `mcjs.admin` |
📖 Documentation
> 📖 Full Documentation: Visit our 📖 Full Documentation for detailed API reference, examples, and guides.
💡 Example Applications
- Integration Plugins - Greet players with messages, titles, and sounds - Integration Plugins - Track player statistics with SQLite databases - Integration Plugins - Create interactive menus using standard Bukkit inventories with custom layouts and click handlers - Integration Plugins - Develop simple games with event handling - Integration Plugins - Create helpful tools and commands - Integration Plugins - Connect your server with external APIs
🛠️ Technical Details
- License: Rhino (Mozilla) - License: 1.21 - License: Paper, Spigot, Bukkit - License: MIT
🤝 Support
- Documentation: Documentation - Documentation: %%MD1%% - Documentation: %%MD2%%
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
---
Made with ❤️ for the Minecraft Community ```
---