KubeJS

KubeJS

61M Downloads

Need a wiki of 1.12.2

lihugang opened this issue ยท 1 comments

commented

I am a RPG server developer. Recently, I'm developing a MOD for my server.
In order to develop and manage mod easily, I chose KubeJS as my devolop tool.
When I ran this code

  onEvent('player.logged_in',function(event){
     //console.log(event);
     let name = event.player.name
     console.log("Player " + name + " joined the game");
 })

The server respond with an error:

server thread/ERROR Error loading KubeJS script kubejs/server_scripts/user-test.js: <eval>:17:8 Expected ; but found name
let name = event.player.name
^ in <eval> at line number 17 at column number 8

To solve this error, I tried a lot of methods, but nothing worked. Then, I looked up the wiki, but I found nothing. Can anyone give me a wiki of 1.12.2 version? I'm noticed that

Anything below 1.16 is no longer supported!

But it's not a matter. Thanks a lot.

I'm a junior student in China. I know little about English. If my issue has some problems of language or customs, please forgive me.

Click here to contact me. Thanks a lot.

commented

The 1.12 version of KubeJS uses a different scripting engine, Nashorn, which is a lot more primitive than Rhino and only supports basic ES5 syntax (and not even that fully). We highly recommend that you update to at least 1.16 if you want to use KubeJS because 1.12 is lacking a lot of fundamental features (I'm not sure any of the devs even remember what exactly was a part of 1.12), and, like you said, a proper wiki is missing as well unfortunately (that said, there was a mod called... Aurora I think which served as ingame documentation in the form of a web server)