U
/u/Professional_Web9776
Guest
Hey everyone,
I wanted to share a passion project I’ve been working on called LiveJava.
For years, the workflow for custom server features has been divided into two camps:
I wanted the DX (Developer Experience) of Skript with the raw power of Java. So, I built a 71KB Plugin that does exactly that.
How it works:
When you type /livejava editor in-game, it gives you a secure, IP-locked URL. Opening it in your browser launches an embedded Web IDE (powered by Monaco Editor) hosted directly entirely on your Minecraft server.
You can write pure Java classes directly in the browser. When you hit Build:
- It asynchronously hooks into the system's javax.tools.JavaCompiler.
- Compiles the code in-memory (off the main thread, 0 TPS drop).
- Uses a custom URLClassLoader to hot-swap your classes into the server.
- Registers your commands, listeners, and tasks instantly.
Why this is different:
- True Multithreading: Unlike Skript, you can run actual async web servers, heavy database queries, and Redis pub/sub listeners inside your scripts without freezing the main thread.
- Full NMS Access: The compiler automatically detects your server's core jar (even on Paper 1.20+ where bundler hides it) via reflection and injects it into the classpath. You can write packets and net.minecraft.server code directly in your browser.
- Safe Hot-Reload: When you stop a script, the plugin automatically unregisters its commands from the CommandMap, unregisters its Bukkit listeners, and closes the ClassLoader to prevent memory/Metaspace leaks.
- IntelliSense: The Web IDE gives you auto-complete and ghost-text suggestions for Spigot/Paper events and commands right in your browser.
Here is what the Web IDE looks like:
Here is an example of an NMS script I wrote in 2 minutes:
It supports everything from 1.20.1 up to 1.21.x (dynamically reads your java.specification.version to compile for Java 17 or 21).
I’m currently running this on my own server to test things on the fly without ever restarting. Would love to hear what the community thinks of this architecture!
By the way, I haven't done Java/plugin development in a long time, so this is my first real dive back into the space. If you spot any bugs, memory leaks, or bad practices in the code, please let me know I'm open to all feedback!
Source: https://github.com/zMiercoles/LiveJava
Modrinth: https://modrinth.com/plugin/livejava
submitted by /u/Professional_Web9776
[link] [comments]
Continue reading...
I wanted to share a passion project I’ve been working on called LiveJava.
For years, the workflow for custom server features has been divided into two camps:
Write in Skript/Denizen: Great for hot-reloading and instant testing, but terrible for performance, multithreading, and accessing NMS.
Write a Java Plugin: Amazing performance and full API access, but making a small change requires recompiling, moving the .jar, running /reload (which we all know is buggy), or restarting the server entirely.
I wanted the DX (Developer Experience) of Skript with the raw power of Java. So, I built a 71KB Plugin that does exactly that.
How it works:
When you type /livejava editor in-game, it gives you a secure, IP-locked URL. Opening it in your browser launches an embedded Web IDE (powered by Monaco Editor) hosted directly entirely on your Minecraft server.
You can write pure Java classes directly in the browser. When you hit Build:
- It asynchronously hooks into the system's javax.tools.JavaCompiler.
- Compiles the code in-memory (off the main thread, 0 TPS drop).
- Uses a custom URLClassLoader to hot-swap your classes into the server.
- Registers your commands, listeners, and tasks instantly.
Why this is different:
- True Multithreading: Unlike Skript, you can run actual async web servers, heavy database queries, and Redis pub/sub listeners inside your scripts without freezing the main thread.
- Full NMS Access: The compiler automatically detects your server's core jar (even on Paper 1.20+ where bundler hides it) via reflection and injects it into the classpath. You can write packets and net.minecraft.server code directly in your browser.
- Safe Hot-Reload: When you stop a script, the plugin automatically unregisters its commands from the CommandMap, unregisters its Bukkit listeners, and closes the ClassLoader to prevent memory/Metaspace leaks.
- IntelliSense: The Web IDE gives you auto-complete and ghost-text suggestions for Spigot/Paper events and commands right in your browser.
Here is what the Web IDE looks like:
Here is an example of an NMS script I wrote in 2 minutes:
It supports everything from 1.20.1 up to 1.21.x (dynamically reads your java.specification.version to compile for Java 17 or 21).
I’m currently running this on my own server to test things on the fly without ever restarting. Would love to hear what the community thinks of this architecture!
By the way, I haven't done Java/plugin development in a long time, so this is my first real dive back into the space. If you spot any bugs, memory leaks, or bad practices in the code, please let me know I'm open to all feedback!
Source: https://github.com/zMiercoles/LiveJava
Modrinth: https://modrinth.com/plugin/livejava
submitted by /u/Professional_Web9776
[link] [comments]
Continue reading...