KubeJS (Old)

KubeJS (Old)

3M Downloads

Client crashes on startup

ClaudiusMinimus opened this issue ยท 6 comments

commented

Minecraft Version

1.19.2

KubeJS Version

KubeJS 1902.6.0-build.98

Rhino Version

Rhino 1902.2.1-build.242

Architectury Version

Architectury 6.3.49

Forge/Fabric Version

Forge 43.1.47

Describe your issue

Client crashes on startup with thescreeshot shown below.

CF install zip: Create on a Potato PC Forge Edition-3.1.0.zip

image

Crash report/logs

https://crashy.net/g5l3EcW1REil9BPr1y3L

commented

Exception message: java.lang.RuntimeException: There were startup script syntax errors! See logs/kubejs/startup.txt for more info

commented

startup.txt

[16:36:11] [ERR  ] Error loading KubeJS script: startup_scripts:script.js: Line 5: 'onEvent()' is no longer supported! Read more on wiki: https://kubejs.com/kjs6
[16:36:11] [INFO ] Loaded 0/1 KubeJS startup scripts in 2.25 s

points to script.js

// priority: 0

console.info('Hello, World! (You will only see this line once in console, during startup)')

onEvent('item.registry', event => {
  // Register new items here
  // event.create('example_item').displayName('Example Item')
})

onEvent('block.registry', event => {
  // Register new blocks here
  // event.create('example_block').material('wood').hardness(1.0).displayName('Example Block')
})
commented

Read the error message and the page it links to.

commented

Since onEvent() is no longer supported, might you want to fixed the default startup_scripts/script.js.
I did not write the script.js as it installed with the mod and it would therefore seem to be a bug.

commented

image

This is the generated startup script, changed... about three months ago. Did you copy over your script folder from another pack perhaps? Because you should not be getting onEvent based scripts at all anymore

commented

My bad. I forgot some code from my git repo had prevented the new defaults. Thank you for your patience with my error.