Butchercraft

Butchercraft

205k Downloads

Kubejs Error

DE-SHARK opened this issue ยท 0 comments

commented
// priority: 0

// Visit the wiki for more info - https://kubejs.com/

console.info('Hello, World! (Loaded server scripts)')

ServerEvents.recipes(e => {
    // Change recipes here
    e.remove({ output: 'minecraft:oak_planks' })
})

When I use this code( e.remove({ output: xxx }) ), Kubejs throws an error after reloading it.

My mods list:
image

Here are the details of the reported error:

[18:09:39] [INIT] KubeJS 1902.6.1-build.362; MC 1902 forge
[18:09:39] [INIT] Loaded plugins:
[18:09:39] [INIT] - dev.latvian.mods.kubejs.forge.BuiltinKubeJSForgePlugin
[18:09:39] [INFO] server_scripts:example.js:5: Hello, World! (Loaded server scripts)
[18:09:39] [INFO] Loaded script server_scripts:example.js in 0.015 s
[18:09:39] [INFO] Loaded 1/1 KubeJS server scripts in 0.024 s
[18:09:39] [INFO] Scripts loaded
[18:09:39] [INFO] Initializing recipe event...
[18:09:39] [INFO] Processing recipes...
[18:09:39] [INFO] Found 1558 recipes in 81.88 ms
[18:09:39] [ERROR] ! Error occurred while handling event 'ServerEvents.recipes': java.lang.NullPointerException
[18:09:39] [ERROR] ! java.lang.NullPointerException
[18:09:39] [ERROR] ! at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[18:09:39] [ERROR] ! at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
[18:09:39] [ERROR] ! at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[18:09:39] [ERROR] ! at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
[18:09:39] [ERROR] ! at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinTask.getThrowableException(ForkJoinTask.java:564)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinTask.reportException(ForkJoinTask.java:591)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinTask.joinForPoolInvoke(ForkJoinTask.java:1042)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinPool.invoke(ForkJoinPool.java:2639)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.recipe.RecipesEventJS.runInParallel(RecipesEventJS.java:638)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.recipe.RecipesEventJS.forEachRecipeAsync(RecipesEventJS.java:489)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.recipe.RecipesEventJS.remove(RecipesEventJS.java:516)
[18:09:39] [ERROR] ! at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[18:09:39] [ERROR] ! at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
[18:09:39] [ERROR] ! at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[18:09:39] [ERROR] ! at java.base/java.lang.reflect.Method.invoke(Method.java:568)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.MemberBox.invoke(MemberBox.java:160)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.NativeJavaMethod.call(NativeJavaMethod.java:463)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.Interpreter.interpretLoop(Interpreter.java:1086)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.Interpreter.interpret(Interpreter.java:423)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.InterpretedFunction.call(InterpretedFunction.java:72)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.Context.doTopCall(Context.java:1197)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.ScriptRuntime.doTopCall(ScriptRuntime.java:2619)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.InterpretedFunction.call(InterpretedFunction.java:70)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.ArrowFunction.call(ArrowFunction.java:42)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:129)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.InterfaceAdapter.invoke(InterfaceAdapter.java:88)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.rhino.VMBridge.lambda$newInterfaceProxy$0(VMBridge.java:70)
[18:09:39] [ERROR] ! at TRANSFORMER/jdk.proxy4/jdk.proxy4.$Proxy97.onEvent(Unknown Source)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.event.EventHandlerContainer.handle(EventHandlerContainer.java:39)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.event.EventHandler.postToHandlers(EventHandler.java:302)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.event.EventHandler.post(EventHandler.java:272)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.event.EventHandler.post(EventHandler.java:226)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.event.EventHandler.post(EventHandler.java:189)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.recipe.RecipesEventJS.post(RecipesEventJS.java:291)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.world.item.crafting.RecipeManager.handler$zzn000$customRecipesHead(RecipeManager.java:1531)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.world.item.crafting.RecipeManager.m_5787_(RecipeManager.java)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.world.item.crafting.RecipeManager.m_5787_(RecipeManager.java:34)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.packs.resources.SimplePreparableReloadListener.m_10789_(SimplePreparableReloadListener.java:13)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.CompletableFuture$UniAccept.tryFire(CompletableFuture.java:718)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.packs.resources.SimpleReloadInstance.m_143940_(SimpleReloadInstance.java:69)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.TickTask.run(TickTask.java:18)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:157)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:763)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:157)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:131)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:746)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:740)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:140)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_129861_(MinecraftServer.java:1312)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.commands.ReloadCommand.m_138235_(ReloadCommand.java:22)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.commands.ReloadCommand.m_138228_(ReloadCommand.java:53)
[18:09:39] [ERROR] ! at MC-BOOTSTRAP/[email protected]/com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:263)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.commands.Commands.m_242674_(Commands.java:240)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.network.ServerGamePacketListenerImpl.m_242600_(ServerGamePacketListenerImpl.java:1239)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$12(ServerGamePacketListenerImpl.java:1217)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_18693_(BlockableEventLoop.java:68)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1768)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.TickTask.run(TickTask.java:18)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:157)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:763)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:157)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:131)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:746)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:740)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.util.thread.BlockableEventLoop.m_18701_(BlockableEventLoop.java:140)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:726)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:658)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:244)
[18:09:39] [ERROR] ! at java.base/java.lang.Thread.run(Thread.java:833)
[18:09:39] [ERROR] ! Caused by: java.lang.NullPointerException: ItemStack should never be null, but recipe butchercraft:sheeptest[butchercraft:meat_hook] returned null as the output!
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.recipe.JsonRecipeJS.hasOutput(JsonRecipeJS.java:40)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.recipe.filter.OutputFilter.test(OutputFilter.java:15)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.recipe.RecipesEventJS$RecipeStreamFilter.test(RecipesEventJS.java:438)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.recipe.RecipesEventJS$RecipeStreamFilter.test(RecipesEventJS.java:435)
[18:09:39] [ERROR] ! at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:178)
[18:09:39] [ERROR] ! at java.base/java.util.HashMap$ValueSpliterator.forEachRemaining(HashMap.java:1779)
[18:09:39] [ERROR] ! at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
[18:09:39] [ERROR] ! at java.base/java.util.stream.ForEachOps$ForEachTask.compute(ForEachOps.java:290)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.CountedCompleter.exec(CountedCompleter.java:754)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.helpComplete(ForkJoinPool.java:1223)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinPool.helpComplete(ForkJoinPool.java:1915)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinTask.awaitDone(ForkJoinTask.java:433)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinTask.invoke(ForkJoinTask.java:687)
[18:09:39] [ERROR] ! at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel(ForEachOps.java:159)
[18:09:39] [ERROR] ! at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateParallel(ForEachOps.java:173)
[18:09:39] [ERROR] ! at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:233)
[18:09:39] [ERROR] ! at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
[18:09:39] [ERROR] ! at TRANSFORMER/[email protected]/dev.latvian.mods.kubejs.recipe.RecipesEventJS.lambda$forEachRecipeAsync$10(RecipesEventJS.java:489)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinTask$AdaptedRunnableAction.exec(ForkJoinTask.java:1375)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
[18:09:39] [ERROR] ! at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)
[18:09:39] [INFO] Posted recipe events in 241.6 ms
[18:09:40] [INFO] Added 0 recipes, removed 3 recipes, modified 0 recipes, with 0 failed recipes in 23.73 ms