JShell is Java's REPL (read-eval-print loop) tool introduced in JDK 9. With this plugin you can use JShell in Minecraft!
- Native Minecraft Version:
- Tested Minecraft Versions:
- Source Code:
Due to obvious security issues this plugin should only be used in testing environments!
- JDK 14 or higher
- Spigot 1.16 or higher
Installation is simple, just drag and drop the jar into the plugins folder and you should be good to go.
NOTE: You need to run your server with JDK 14 (or higher) for this to work. Instead of starting the server with the java command, start it with "path\to\jdk14\bin\java". For example:
Using the pluginCode (Text):"C:\Program Files\Java\jdk-14\bin\java" -Xms512M -Xmx4096M -jar spigot.jar
You can start or continue a JShell session with the /jshell command. This puts you into shell mode. Shell mode means that everything you enter is evaluated in the shell instead of send in chat. To exit the shell, type /exit. The shell also has some other commands, such as /variables and /imports.
To use the /jshell command, you have to have the jshell.execute permission
- /jshell (code) - Create or resume a JShell session. Optionally you can instantly run code by using the (code) argument.
- /exit - Exit the JShell session.
- /variables - See all variables from your session.
- /imports - See all imports from your session.
- /clear - Exit and clear the JShell session. This will remove all imports and variables.
The plugin also has a config.yml file, in this file you can configure the default imports and predefined variables for every shell. You can find templates to add new imports and variables in the config file.
A demonstration can be found here