#Can I code using KubeJs?
18 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Yes, but you will be a bit more limited than making a true mod with java
and the more technically complex it gets (adding new systems for example), the more you're likely to hit the limits of what's doable in kubejs
I have another question. How do I make a mod in Kubejs? Is there an example package for this?
oh, do you mean "packaged .jar file" when you say mod?
It's not exactly like that, I wrote the server codes or client codes in the jar, where do I put them?
you can't package the files into a single, compiled file (like .dll or .jar) due to javascript being an interpreted language
however, you can tell everyone to put the files you wrote for the server into their /kubejs folder, same as on the server
So I won't be able to make a jar and add mods to it.
I'm not sure what you mean "add mods to it", but no you cannot compile kubejs modifications into a compiled binary
For example, I am putting the codes in .minecraft/kubejs/ but since I will use jar during the mod, I will put them in the jar. Is there an alternative way to do this?
could you elaborate
If you really want to package your KubeJS "mod" into a .jar file then you can make a mod (with Java) that writes your (KJS) mod's scripts into /kubejs directory but why would you want to do that?
I am looking for something to mod with JavaScript like kubejs since Java language is very difficult.
kubejs isnt for making mods, its a tool for modpack developers to add custom things to thier packs so they dont have to write java mods. you cannot package kubejs scripts as jar files but you can write kubejs scripts for use with anything
this is kinda like asking if you can use a spoon to flip a pizza, sure you can but it isn't a very optimal way of replicating a mod