zuron is a project that aims to allow users to use javascript, python and lua in modern versions of minecraft
I (DocilElm) am the lead maintainer of a fork for Chattriggers Fabric, unluckily i do not have enough time to keep it up to date, this project aims to allow for a simpler api which does not require any Minecraft code so it can be easily ported to newer versions.
Currently, there only exists a /zr load command to reload all the engines at once
NOTE: these may change later on.
The main plan was to have support for mixins so our users could just build their own events, sadly that is a bit more difficult than i expected so it currently does not and seems kind of useless, one option is to use another mod's event system or something similar.
Loading your scripts is simple:
Head over to your ~/.minecraft folder then into config and you should see a folder called zuron inside of this there should be 3 different folders named js, py and lua
Open the folder of which your script's language is written (or one you want to use) on then create a new folder with your script name and the initial file.
Initial file name is enforced by zuron due to it loading one single file instead of the entire directory, all you need to do is:
JS->index.jsPY->main.pyLua->main.lua
yes sadly there is not a command currently to open the scripts folder
NOTE: modern rhino engine only supports CommonJS imports
// similar to CTJS we have support for Java.type
const System = Java.type("java.lang.System")
// printing a message into the user's console (latest log)
System.out.println("printing to console through JS")
// this is our "event system" (forgot to make it load automatically)
const event = Java.type("com.github.synnerz.zuron.internal.Register")
// subscribe/register to an event
event.register("nameOfEventHere", (arg1, arg2) => {
// the code inside of here will run whenever the event gets triggered
})
// triggering an event
event.trigger("nameOfEventHere", 1, 2)local System = Java.type("java.lang.System")
System.out:println("printing to console through Lua")
local event = Java.type("com.github.synnerz.zuron.internal.Register")
event:register("nameOfEventHere", function(arg1, arg2)
-- the code inside of here will run whenever the event gets triggered
end
)
event:trigger("nameOfEventHere", {1, 2})from java.lang import System
System.out.println("printing to console through Python")
from com.github.synnerz.zuron.internal import Register
def cb(arg1, arg2):
# the code inside of here will run whenever the event gets triggered
Register.register("nameOfEventHere", cb)
Register.trigger("nameOfEventHere", 1, 2)Special thanks to Chattriggers Fabric for being the main motivation behind this project.