Archduke's Nashorn Console
Run JavaScript commands within Minecraft, using the full power of Java's integrated JavaScript engine. Use JavaScript to invoke the Spigot API, whether for debugging or experimentation (or trolling :p).
Installation
Easy, just drop into the plugins folder, and then optionally modify config.yml.
Permissions
archnashorn.invocation - Use /invoke to evaluate a JavaScript expression. Does not default to OPs, for reasons I'll explain later.
Commands
/invoke <JS...> - Execute a JavaScript expression. End your line with a space and backslash (" \") to continue onto the next line with subsequent uses of this command. Aliased to />.
I would recommend having knowledge about JavaScript, the Nashorn JS engine, Java and the Spigot API to make the best use of this plugin. Take a look at these links:
Running Java from Nashorn - https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/nashorn/api.html
Using Java from Scripts - https://docs.oracle.com/javase/8/docs/technotes/guides/scripting/prog_guide/javascript.html
JS reference - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
Spigot API (1.12) - https://hub.spigotmc.org/javadocs/spigot/overview-summary.html
Disclaimer
The /invoke command does not by default give permission to OPs. This is because the command is very powerful, and can run any arbitrary code on the server, including code that may ban players, modify permissions, change blocks, create entities, overwrite files, create network connections, or crash the server. Do not give /invoke permission to anyone on your server that you don't have absolute, complete trust in!
If you do want to allow OPs to use /invoke, change allowOps in config.yml to true. No restart is required.
Slightly advanced notes
Declared variables in global scope persist for as long as the server is online.
The result of an expression is written in "> gray"
Text written to standard out is written in white.
Text written to standard error is written in red.
Exceptions thrown by Nashorn or Java are written in red.
Developers who modify the code (and you can decompile it if you want) may replace Nashorn with any other JSR-223 compliant ScriptEngine.
The plugin will disable itself if it can't load the JavaScript script engine.
At least Java 8 is required.
There should be no dependencies on any specific version of Spigot, so it should be version-agnostic.
(the source code isn't here because I have yet to get it hosted somewhere. In the meanwhile you can decompile the plugin.)
Similar projects
Script →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta