I think “/js reload” is not a good way to live test
In your example script, everything is loaded “onGameInitializationEvent” and it removes everything from memory.
Basically, I created a folder “example” with a file “main.js” containing all of your plugin example. When using “/js reload example” it simply removes the command /job
So I had a simple try with a folder “log” containing “main.js” containing “console.log(“hello world”);” and when using /reload log I get :
Actually, your example plugin throws this unsatisfaying thing :
[quote]
[16:32:51] [Server thread/ERROR] [Sponge/]: Error occurred while executing command ‘job 1 10’ for source EntityPlayerMP[‘Keuterio’/279, l=‘world’, x=-179.87, y=64.00, z=335.34]: ReferenceError: “Player” is not defined
jdk.nashorn.internal.runtime.ECMAException: ReferenceError: “Player” is not defined
at jdk.nashorn.internal.runtime.ECMAErrors.error(ECMAErrors.java:57) ~[ECMAErrors.class:?]
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:319) ~[ECMAErrors.class:?]
at jdk.nashorn.internal.runtime.ECMAErrors.referenceError(ECMAErrors.java:291) ~[ECMAErrors.class:?]
at jdk.nashorn.internal.objects.Global.noSuchProperty(Global.java:1432) ~[Global.class:?]
at jdk.nashorn.internal.scripts.Script$Recompilation$9$1545AA$^eval_.createCommand$executor(:44) ~[?:?]
at jdk.nashorn.internal.runtime.ScriptFunctionData.invoke(ScriptFunctionData.java:644) ~[ScriptFunctionData.class:?]
at jdk.nashorn.internal.runtime.ScriptFunction.invoke(ScriptFunction.java:228) ~[ScriptFunction.class:?]
at jdk.nashorn.internal.runtime.ScriptRuntime.apply(ScriptRuntime.java:393) ~[ScriptRuntime.class:?]
at jdk.nashorn.api.scripting.ScriptObjectMirror.call(ScriptObjectMirror.java:117) ~[ScriptObjectMirror.class:?]
at io.github.djxy.spongejavascript.script.util.CommandManager$CommandExecutor.execute(CommandManager.java:171) ~[CommandManager$CommandExecutor.class:?]
at org.spongepowered.api.command.spec.CommandSpec.process(CommandSpec.java:331) ~[CommandSpec.class:1.8.9-1855-4.1.0-BETA-1312]
at org.spongepowered.api.command.dispatcher.SimpleDispatcher.process(SimpleDispatcher.java:331) ~[SimpleDispatcher.class:1.8.9-1855-4.1.0-BETA-1312]
at org.spongepowered.common.command.SpongeCommandManager.process(SpongeCommandManager.java:268) [SpongeCommandManager.class:1.8.9-1855-4.1.0-BETA-1312]
at net.minecraft.command.ServerCommandManager.func_71556_a(SourceFile:80) [bd.class:?]
at net.minecraft.network.NetHandlerPlayServer.func_147361_d(NetHandlerPlayServer.java:815) [lm.class:?]
at net.minecraft.network.NetHandlerPlayServer.func_147354_a(NetHandlerPlayServer.java:794) [lm.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:37) [ie.class:?]
at net.minecraft.network.play.client.C01PacketChatMessage.func_148833_a(SourceFile:9) [ie.class:?]
at org.spongepowered.common.network.PacketUtil.onProcessPacket(PacketUtil.java:107) [PacketUtil.class:1.8.9-1855-4.1.0-BETA-1312]
at net.minecraft.network.PacketThreadUtil$1.redirect$onProcessPacket$0(SourceFile:39) [fh$1.class:?]
at net.minecraft.network.PacketThreadUtil$1.run(SourceFile:13) [fh$1.class:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0_72-internal]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0_72-internal]
at net.minecraft.util.Util.func_181617_a(SourceFile:44) [g.class:?]
at net.minecraft.server.MinecraftServer.func_71190_q(MinecraftServer.java:660) [MinecraftServer.class:?]
at net.minecraft.server.dedicated.DedicatedServer.func_71190_q(DedicatedServer.java:344) [ko.class:?]
at net.minecraft.server.MinecraftServer.func_71217_p(MinecraftServer.java:605) [MinecraftServer.class:?]
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:481) [MinecraftServer.class:?]
at java.lang.Thread.run(Thread.java:745) [?:1.8.0_72-internal][/quote]