#My KubeJS script crashes the server
66 messages · Page 1 of 1 (latest)
Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!
Paste version of 2024-07-26-3.log, crash-2024-07-26_15.42.45-fml.txt, Oress.js from @opaque cradle
Paste version of startup.log from @opaque cradle
My KubeJS script crashes the server
something doesnt add up in your logs
your startup log says the only file loaded was example.js
but you sent a file called Oress.js
which does not appear in the logs
[16:29:15] [INFO] Loaded script startup_scripts:example.js in 0.079 s
[16:29:15] [INFO] Loaded 1/1 KubeJS startup scripts in 0.525 s with 0 errors and 0 warnings
i think you sent either the wrong startup log, or an outdated one
The latest.log also says that there where startup script Syntax errors
I sent the wrong startup.log (ores.js is disabled there)
Here's the right one:
Paste version of startup1.log from @opaque cradle
Paste version of latest6.log from @opaque cradle
doesnt look like the block builder has a way to set the loot table
and i know fuckall about loot tables 
.setLootTableJson only accepts the actual json, not a file
idk it's documented on the wiki
could be outdated
Any startup script crashes the server
I ran the script from #1048591172165189632
please try with just an empty startup script and send mclog
Empty is working
which one
if something else is crashing too, send the crash log and startup log again
Paste version of latest7.log, crash-2024-07-27_21.00.50-fml.txt, startup2.log from @opaque cradle
here
try this
Some things you do require access to classes that are blocked by default, but never fear! You can disable that!
kubejs/config/common.properties –> disableClassFilter –> true
This will not unblock classes that are explicitly excluded, such as java's networking and file management classes.
empty is working
I'll try it now
Where
ethen add disableClassFilter = true on a new line
Same thing
Paste version of startup3.log, latest8.log, crash-2024-07-27_21.15.27-fml.txt from @opaque cradle
this
if that doesn't work remove setLootTableJson for now
Paste version of latest9.log, crash-2024-07-27_21.22.45-fml.txt, startup4.log from @opaque cradle
Severely
same error as before
[21:22:36] [ERROR] ! …rhino.EvaluatorException: Failed to load Java class 'net.minecraft.client.gui.components.Button': Class could not be found! (startup_scripts:open_menu_botton_startup.js#1)
[21:22:36] [ERROR] ! at …rhino.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:67)
[21:22:36] [ERROR] ! at …rhino.Context.reportRuntimeError(Context.java:133)
[21:22:36] [ERROR] ! at …rhino.Context.reportRuntimeError(Context.java:173)
[21:22:36] [ERROR] ! at …kubejs.script.ScriptManager.loadJavaClass(ScriptManager.java:284)
[21:22:36] [ERROR] ! at …kubejs.bindings.JavaWrapper.loadClass(JavaWrapper.java:23)
[21:22:36] [ERROR] ! at java.lang.reflect.Method.invoke(Method.java:568)
[21:22:36] [ERROR] ! at …rhino.MemberBox.invoke(MemberBox.java:160)
[21:22:36] [ERROR] ! at …rhino.NativeJavaMethod.call(NativeJavaMethod.java:463)
[21:22:36] [ERROR] ! at …rhino.Interpreter.interpretLoop(Interpreter.java:986)
[21:22:36] [ERROR] ! at script(startup_scripts:open_menu_botton_startup.js:1)
[21:22:36] [ERROR] ! at …rhino.Interpreter.interpret(Interpreter.java:370)
[21:22:36] [ERROR] ! at …rhino.InterpretedFunction.call(InterpretedFunction.java:72)
[21:22:36] [ERROR] ! at …rhino.Context.callSync(Context.java:1290)
[21:22:36] [ERROR] ! at …rhino.Context.doTopCall(Context.java:1307)
[21:22:36] [ERROR] ! at …rhino.InterpretedFunction.exec(InterpretedFunction.java:83)
[21:22:36] [ERROR] ! at …rhino.Context.evaluateString(Context.java:573)
[21:22:36] [ERROR] ! at …kubejs.script.ScriptFile.load(ScriptFile.java:17)
[21:22:36] [ERROR] ! at …kubejs.script.ScriptManager.load(ScriptManager.java:217)
[21:22:36] [ERROR] ! at …kubejs.script.ScriptManager.reload(ScriptManager.java:78)
[21:22:36] [ERROR] ! at …kubejs.KubeJS.<init>(KubeJS.java:137)
[21:22:36] [ERROR] ! at …kubejs.forge.KubeJSForge.<init>(KubeJSForge.java:51)
[21:22:36] [ERROR] ! at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
[21:22:36] [ERROR] ! at java.lang.reflect.Constructor.newInstance(Constructor.java:480)
[21:22:36] [ERROR] ! at net.minecraftforge.fml.javafmlmod.FMLModContainer.constructMod(FMLModContainer.java:74)
[21:22:36] [ERROR] ! at net.minecraftforge.fml.ModContainer.lambda$buildTransitionHandler$4(ModContainer.java:124)
[21:22:36] [ERROR] ! at java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
[21:22:36] [ERROR] ! at java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1796)```
Same?
idk why you psoted that, but yes, same
.
open_menu_botton_startup.js#1: Failed to load Java class
we would need to see which example-script you're using here. The open_menu_botton_startup.js oe
Paste version of open_menu_botton_startup.js from @opaque cradle
here
you have client classes on a server
they dont exist on servers
you cant have that script on a dedicated server
How do you add a loot block then?
LootJS is an addon for KubeJS that allows modifying loot from all sources dynamically (much nicer than loot tables)!
It also supports removing loot added by mods, unlike KubeJS' current loot table events.