Overview: ScriptCore is a powerful in-game scripting engine that lets server owners and developers write JavaScript to control nearly every aspect of a Minecraft server. With ScriptCore, you can create commands, handle events, and modify game behavior
without needing to write a traditional Java plugin. (Paper 1.21+)
Can now list, download & load premade scripts in game! (Only 1 available, I will make more or you can too! Join the Discord link at the bottom to contribute!)
Version Updates: Check The Spoiler to see what's new in each version
Version 0.0.4 Released: Now you can use two new commands
/scriptcore list & /scriptcore get <scriptName.js>
Using the list option will get the list of premade JS scripts from the scripts branch on github, you can then download them using the get command and the scriptName.js : Further updates will come to polish this, due to github per IP API limits of 60 per hour, the /scriptcore list command caches for 2 hours or per restart so that you don't quickly reach the limit, update 0.0.5 will include some features to polish these commands further. Once you download a script use /scriptcore reload <scriptName.js> to load the script all without needing to restart the server. Please head to the bottom and join the discord, if you'd like to contribute to the premade scripts list it would be welcome and appreciated!
Version 0.0.3 Released: Now binds to 2000+ classes making bukkit accessible to the vast extent you would expect and want. "[03:01:54 INFO]: [ScriptCore] ✓ Auto-bound 2156 classes into JS context"
Version 0.0.2, allows a trial version of hot reloading (You can reload scripts without restart but if your script contains commands you registered, they will break until server restart if the script has been reloaded... due to bukkit expectations). If you code a new script, using reload can load it in without a server restart just fine though!
Here is a fully working slightly more advanced script that was made for 0.0.3
Tested and working perfect on version 0.0.3. (Test it by adding it to your Plugins/Scriptcore/scripts/ folder)
The new example script link:
Click here - Github trial002.js
Looking to find information about methods? Use the above script and do
...for example "/listmethodstoconsole Player"
Just part of the demonstration on what ScriptCore can do.
In order to really display how things will need to be setup in JS vs a NormalPlugin I re-coded my PlayerVaults plugin in .js to work in version 0.0.3+ without issue!
PlayerVaults.js - Available via in-game commands now! Use...
/scriptcore get playerVaults.js & then
/scriptcore reload playerVaults.js to load it up right away.
(commands will show red in chat until restart but still work fine)
Permissions & Commands for PlayerVaults.js:
playervault.amount.{n} for instance playervault.amount.5 for access to 5 vault pages for the player.
For viewing other players vaults for admins
playervaults.admin
Commands:
Admin command: /pvault playerName pageNumber
Command: /vault pageNumber or /vault will open page 1
Commands:
/scriptcore reload nameOfScript.js
/scriptcore list
/scriptcore get <scriptName.js>
Permissions:
scriptcore.reload
scriptcore.get
scriptcore.list
Key Features:
Full JavaScript Scripting Engine:
Run scripts directly in your server using GraalVM.
Access Bukkit API objects directly in JavaScript.
Create custom commands, automate tasks, or prototype server features rapidly.
Dynamic Event Handling:
Listen to any Bukkit events from JS.
Example events included in example.js: player joins, block breaks, entity damage, chat messages, etc.
Flexible enough to build mini-games, custom mechanics, or interactive systems.
Command Creation Made Simple:
Define commands entirely in JavaScript.
Includes built-in permission checking for player access.
Commands can modify player state, inventory, world, or anything accessible via Bukkit API.
Example Script (example.js):
Demonstrates the power of ScriptCore with multiple working commands and event hooks.
Includes sample commands: /feed, /heal, /fly, /gm, /give, /spawn, teleportation commands, and more.
Serves as a foundation to extend and customize your server.
Lightweight & Self-Contained:
Despite bundling GraalVM, the plugin is compact (~36 MB).
No extra dependencies or setup required—just place in /plugins.
GraalVM Integration:
Executes JS code natively on the JVM.
GraalVM is licensed under the GraalVM Free Terms and Conditions (Oracle), included as LICENSE.txt in the plugin folder.
Why Use ScriptCore?
Rapidly prototype and implement server features in JS.
Give admins and developers a flexible, runtime scripting environment.
Create custom game logic, commands, and event responses without Java compilation.
Installation:
Place the .jar in /plugins.
Start the server; example.js will be generated automatically. (Version 0.0.4 and newer will no longer generate an example.js)
Edit example.js to add your own commands and events.
Restart the server to load script changes. (restart not required if you use the /reload command for new scripts)
IMPORTANT THING TO NOTE FOR CODING JS VIA ScriptCore
Destructured Array: The key line jsFunc.execute(exposedObjects.toArray(), event); all these discovered objects are bundled into a single Java Array and passed as the first argument to the JavaScript function. The original Bukkit event object is passed as the second argument. This is why your JavaScript functions MUST use the array destructuring on the first argument else failure to work properly. As seen in the playerVaults.js provided above for example.
This is the initial test version and "might" impact server performance, please let me know. Reach out about any issues you have. Plugin hosted on Github, it was too large to host here. (36.7mb)
More updates will be coming to add additional capabilities as some things might not work yet! Although a lot already will... as of 0.0.3 you can do just about anything.
Please leave a rating with a comment on additional features you would like to see!
If you would like to get more directly involved or request a plugin, feel free to join the
Discord!