Execute command not as expected on mohist server
Tollainmear opened this issue · 1 comments
Minecraft Version
1.20.1
KubeJS Version
2001.6.4-build.133
Rhino Version
2001.2.2-build.18
Architectury Version
9.1.13
Forge/Fabric Version
Forge 47.2.20
Describe your issue
Hello,
I've registered a custom command through KubeJs, and it works as expected when I run it in single-player mode. However, when I copy this code to the Mohist server, invoking the command causes a server-side error. I have never encountered this exception(Wrapped java.lang.UnsupportedOperationException: Not supported - remote source required
) keyword before, and I'm unable to find any related information online. Do you have any ideas about this exception? Could you also provide a more detailed description to assist me, or help the Mohist dev team, in identifying or fixing this issue?
P.S.: This problem also occurs with commands like /title
, and it may be because I used the server.runcommand()
function in KubeJs.
my command:
event.register(
cmd.literal('rr').requires(src => src.hasPermission(2))
.executes(ctx => {
Utils.server.runCommand('/minecraft:reload') //line44 - Where the exception throw
return 1}
)
)
Relative error log:
[03:36:29 INFO]: Tollainmear issued server command: /healme
[03:36:29 ERROR]: Command exception: /healme
dev.latvian.mods.rhino.WrappedException: Wrapped java.lang.UnsupportedOperationException: Not supported - remote source required. (server_scripts:KaroglanTech_CMD.js#44)
at dev.latvian.mods.rhino.Context.throwAsScriptRuntimeEx(Context.java:269) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.MemberBox.invoke(MemberBox.java:180) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.NativeJavaMethod.call(NativeJavaMethod.java:463) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.Interpreter.interpretLoop(Interpreter.java:986) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.Interpreter.interpret(Interpreter.java:370) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.InterpretedFunction.call(InterpretedFunction.java:72) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.Context.callSync(Context.java:1290) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.Context.doTopCall(Context.java:1307) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.InterpretedFunction.call(InterpretedFunction.java:70) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.Context.callSync(Context.java:1290) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.ArrowFunction.call(ArrowFunction.java:42) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.Context.callSync(Context.java:1290) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.InterfaceAdapter.invoke(InterfaceAdapter.java:125) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at dev.latvian.mods.rhino.VMBridge.lambda$newInterfaceProxy$0(VMBridge.java:74) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
at jdk.proxy2.$Proxy132.run(Unknown Source) ~[?:?]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:264) ~[brigadier-1.20.1.jar%23142!/:?]
at net.minecraft.commands.Commands.m_242674_(Commands.java:318) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.m_246958_(ServerGamePacketListenerImpl.java:1835) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.lambda$handleChatCommand$10(ServerGamePacketListenerImpl.java:1799) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.util.thread.BlockableEventLoop.m_18693_(BlockableEventLoop.java:67) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at java.util.concurrent.CompletableFuture$AsyncSupply.run(Unknown Source) ~[?:?]
at net.minecraft.server.TickTask.run(TickTask.java:18) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.util.thread.BlockableEventLoop.m_6367_(BlockableEventLoop.java:156) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.util.thread.ReentrantBlockableEventLoop.m_6367_(ReentrantBlockableEventLoop.java:23) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:1029) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.server.MinecraftServer.m_6367_(MinecraftServer.java:173) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.util.thread.BlockableEventLoop.m_7245_(BlockableEventLoop.java:130) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.server.MinecraftServer.m_129961_(MinecraftServer.java:1012) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.server.MinecraftServer.m_7245_(MinecraftServer.java:1006) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.util.thread.BlockableEventLoop.m_18699_(BlockableEventLoop.java:115) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.server.MinecraftServer.m_130012_(MinecraftServer.java:991) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:908) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at net.minecraft.server.MinecraftServer.m_206580_(MinecraftServer.java:281) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at java.lang.Thread.run(Unknown Source) [?:?]
Caused by: java.lang.UnsupportedOperationException: Not supported - remote source required.
at net.minecraft.server.dedicated.DedicatedServer.m_7261_(DedicatedServer.java:585) ~[server-1.20.1-20230612.114412-srg.jar%23598!/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:?]
at dev.latvian.mods.rhino.MemberBox.invoke(MemberBox.java:160) ~[%5B前置%5Drhino-forge-2001.2.2-build.18.jar%23480!/:2001.2.2-build.18]
... 32 more
Crash report/logs
https://gist.github.com/Tollainmear/832fc5730c7582d9c3b2431b48be3bc7