ScriptCraft

ScriptCraft

14.6k Downloads

utils.getPlayerPos not working

guerillagorilla opened this issue ยท 2 comments

commented

Trying to get a player's position by using /js utils.getPlayerPos(), and the command is not working. Just for checking utils.getMousePos() does work but not getPlayerPos. Any ideas on where to look for a fix?

[15:11:34] [org.scriptcraftjs.canarymod.ScriptCraftPlugin] [ERROR]: Error while trying to evaluate javascript: utils.getPlayerPos(), Error: JavaException: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: TypeError: Can't use instanceof on a non-object. (#222) in at line number 222
javax.script.ScriptException: sun.org.mozilla.javascript.internal.JavaScriptException: JavaException: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: TypeError: Can't use instanceof on a non-object. (#222) in at line number 222 (#623) in at line number 623
at com.sun.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:300)
at com.sun.script.javascript.RhinoScriptEngine.invokeFunction(RhinoScriptEngine.java:258)
at org.scriptcraftjs.canarymod.ScriptCraftPlugin.executeCommand(ScriptCraftPlugin.java:102)
at org.scriptcraftjs.canarymod.ScriptCraftPlugin.jsCommand(ScriptCraftPlugin.java:120)
at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at net.canarymod.commandsys.CommandManager$1.execute(CommandManager.java:322)
at net.canarymod.commandsys.CanaryCommand.parseCommand(CanaryCommand.java:103)
at net.canarymod.commandsys.CommandManager.parseCommand(CommandManager.java:186)
at net.canarymod.api.entity.living.humanoid.CanaryPlayer.executeCommand(CanaryPlayer.java:351)
at net.canarymod.api.entity.living.humanoid.CanaryPlayer.chat(CanaryPlayer.java:165)
at net.minecraft.network.NetHandlerPlayServer.a(NetHandlerPlayServer.java:833)
at net.minecraft.network.play.client.C01PacketChatMessage.a(C01PacketChatMessage.java:34)
at net.minecraft.network.play.client.C01PacketChatMessage.a(C01PacketChatMessage.java:42)
at net.minecraft.network.PacketThreadUtil$1.run(PacketThreadUtil.java:17)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at net.minecraft.server.MinecraftServer.z(MinecraftServer.java:634)
at net.minecraft.server.dedicated.DedicatedServer.z(DedicatedServer.java:436)
at net.minecraft.server.MinecraftServer.y(MinecraftServer.java:583)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:488)
at java.lang.Thread.run(Thread.java:745)
Caused by: sun.org.mozilla.javascript.internal.JavaScriptException: JavaException: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: TypeError: Can't use instanceof on a non-object. (#222) in at line number 222 (#623)
at sun.org.mozilla.javascript.internal.Interpreter.interpretLoop(Interpreter.java:1066)
at sun.org.mozilla.javascript.internal.Interpreter.interpret(Interpreter.java:849)
at sun.org.mozilla.javascript.internal.InterpretedFunction.call(InterpretedFunction.java:162)
at sun.org.mozilla.javascript.internal.ContextFactory.doTopCall(ContextFactory.java:430)
at com.sun.script.javascript.RhinoScriptEngine$1.superDoTopCall(RhinoScriptEngine.java:116)
at com.sun.script.javascript.RhinoScriptEngine$1.doTopCall(RhinoScriptEngine.java:109)
at sun.org.mozilla.javascript.internal.ScriptRuntime.doTopCall(ScriptRuntime.java:3160)
at sun.org.mozilla.javascript.internal.InterpretedFunction.call(InterpretedFunction.java:160)
at com.sun.script.javascript.RhinoScriptEngine.invoke(RhinoScriptEngine.java:294)
... 22 more
[15:11:34] [org.scriptcraftjs.canarymod.ScriptCraftPlugin] [ERROR]: javax.script.ScriptException: sun.org.mozilla.javascript.internal.JavaScriptException: JavaException: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: TypeError: Can't use instanceof on a non-object. (#222) in at line number 222 (#623) in at line number 623
[15:11:34] [CanaryMod] [INFO]: Command used by username: /js utils.getPlayerPos()

commented

Hey @guerillagorilla,
I've just posted a fix for this. It should be in release 3.1.1 coming soon.

commented

Works great! Thanks!