Spigot 1.12.2 with scriptcraft 3.3.0 missing events
jsProj opened this issue ยท 6 comments
Major events like events.blockLeftClick are missing, then i get errors on some saying sendMessage isnt defined
Thank you but what about the missing events
iwent onto use raw org.bukkit.event events which works flawlessly
events.craftItem(function(ev){
alert(ev.player,"success crafting!");
});
[19:39:13 ERROR]: Could not pass event InventoryCreativeEvent to scriptcraft v3.3.0-2017-10-15
jdk.nashorn.internal.runtime.ECMAException: TypeError: Cannot read property "sendMessage" from undefined
at jdk.nashorn.internal.runtime.ECMAErrors.error(Unknown Source) ~[jdk.scripting.nashorn:?]
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(Unknown Source) ~[jdk.scripting.nashorn:?] at jdk.nashorn.internal.runtime.ECMAErrors.typeError(Unknown Source) ~[jdk.scripting.nashorn:?]
at jdk.nashorn.internal.runtime.ECMAErrors.typeError(Unknown Source) ~[jdk.scripting.nashorn:?] at jdk.nashorn.internal.runtime.Undefined.get(Unknown Source) ~[jdk.scripting.nashorn:?]
at jdk.nashorn.internal.scripts.Script$Recompilation$637$\^eval\_.__onEnable#_echo(<eval>:424) ~[?:?]
at jdk.nashorn.internal.scripts.Script$Recompilation$646$223A$\^eval\_$cu1$restOf/1604726540.L:1#L:6(<eval>:7) ~[?:?]
at jdk.nashorn.internal.scripts.Script$Recompilation$628$1318AA$\^eval\_.L:1#on#execute(<eval>:60) ~[?:?]
at jdk.nashorn.javaadapters.org_bukkit_plugin_EventExecutor.execute(Unknown Source) ~[?:?]
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[server.jar:git-Spigot-b6ecf3b-fb423b8]
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) [server.jar:git-Spigot-b6ecf3b-fb423b8]
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) [server.jar:git-Spigot-b6ecf3b-fb423b8]
at net.minecraft.server.v1_12_R1.PlayerConnection.a(PlayerConnection.java:2045) [server.jar:git-Spigot-b6ecf3b-fb423b8] at net.minecraft.server.v1_12_R1.PacketPlayInSetCreativeSlot.a(SourceFile:23) [server.jar:git-Spigot-b6ecf3b-fb423b8] at net.minecraft.server.v1_12_R1.PacketPlayInSetCreativeSlot.a(SourceFile:9) [server.jar:git-Spigot-b6ecf3b-fb423b8] at net.minecraft.server.v1_12_R1.PlayerConnectionUtils$1.run(SourceFile:13) [server.jar:git-Spigot-b6ecf3b-fb423b8]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:?] at java.util.concurrent.FutureTask.run(Unknown Source) [?:?]
at net.minecraft.server.v1_12_R1.SystemUtils.a(SourceFile:46) [server.jar:git-Spigot-b6ecf3b-fb423b8]
at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:748) [server.jar:git-Spigot-b6ecf3b-fb423b8]
at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [server.jar:git-Spigot-b6ecf3b-fb423b8]
at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [server.jar:git-Spigot-b6ecf3b-fb423b8]
at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [server.jar:git-Spigot-b6ecf3b-fb423b8]
at java.lang.Thread.run(Unknown Source) [?:?]
It's because the craftItemEvent has no player parameter (see : https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/inventory/CraftItemEvent.html). You probably want to get the inventory of the craftItemEvent and then call getHolder() on it to get who crafted an item