#My KubeJS script crashes the server

66 messages · Page 1 of 1 (latest)

opaque cradle
lime mortarBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

winged kiteBOT
#

Paste version of 2024-07-26-3.log, crash-2024-07-26_15.42.45-fml.txt, Oress.js from @opaque cradle

opaque cradle
winged kiteBOT
#

Paste version of startup.log from @opaque cradle

opaque cradle
#

My KubeJS script crashes the server

waxen steppe
#

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

raw galleon
#

The latest.log also says that there where startup script Syntax errors

opaque cradle
winged kiteBOT
#

Paste version of startup1.log from @opaque cradle

opaque cradle
winged kiteBOT
#

Paste version of latest6.log from @opaque cradle

waxen steppe
#

doesnt look like the block builder has a way to set the loot table
and i know fuckall about loot tables heh

raw galleon
#

.setLootTableJson only accepts the actual json, not a file

waxen steppe
#

is it a vanilla method?

raw galleon
#

could be outdated

opaque cradle
#

I ran the script from #1048591172165189632

raw galleon
#

please try with just an empty startup script and send mclog

opaque cradle
#

Empty is working

raw galleon
#

which one

waxen steppe
#

if something else is crashing too, send the crash log and startup log again

winged kiteBOT
#

Paste version of latest7.log, crash-2024-07-27_21.00.50-fml.txt, startup2.log from @opaque cradle

raw galleon
#

try this

winged kiteBOT
#

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.

waxen steppe
#

open_menu_botton_startup.js?

#

o.o

opaque cradle
winged kiteBOT
opaque cradle
raw galleon
#

ethen add disableClassFilter = true on a new line

winged kiteBOT
#

Paste version of startup3.log, latest8.log, crash-2024-07-27_21.15.27-fml.txt from @opaque cradle

raw galleon
#

not the same

#

now you have the error with setLootTableJson again

raw galleon
#

if that doesn't work remove setLootTableJson for now

opaque cradle
#

I'm sure I've deleted it everywhere now.

winged kiteBOT
#

Paste version of latest9.log, crash-2024-07-27_21.22.45-fml.txt, startup4.log from @opaque cradle

opaque cradle
waxen steppe
#

same error as before

opaque cradle
# waxen steppe 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?
waxen steppe
#

idk why you psoted that, but yes, same

waxen steppe
#
open_menu_botton_startup.js#1: Failed to load Java class 
raw galleon
#

we would need to see which ⁠example-script you're using here. The open_menu_botton_startup.js oe

opaque cradle
winged kiteBOT
#

Paste version of open_menu_botton_startup.js from @opaque cradle

waxen steppe
#

you have client classes on a server

#

they dont exist on servers

#

you cant have that script on a dedicated server

opaque cradle
winged kiteBOT
#

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.