OtherDrops

226k Downloads

Vanilla commands issue

hgt3345 opened this issue ยท 0 comments

commented

Been having a bit of difficulty making "consumable commands"

Using this plugin as a custom magic kind of plugin, and i found out that potion effects would probably be the best way to add some nice things without increasing my plugin population.
An example of what I'm trying to do:

ANY:
    - trigger: [LEFT_CLICK, RIGHT_CLICK]
      tool: PAPER~&3Healing Scroll
      command: /effect @p[c=3,r=5] regeneration 5 5 false
      consumetool: 1

And the error i get when the "scroll" is used;

[13:03:08 ERROR]: Could not pass event PlayerInteractEvent to OtherDrops v2.8b.582
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:305) ~[spigot.jar:git-Spigot-47b1dff-f233e7d]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-47b1dff-f233e7d]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at org.bukkit.craftbukkit.v1_8_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:226) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at org.bukkit.craftbukkit.v1_8_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:193) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at org.bukkit.craftbukkit.v1_8_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:189) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:682) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at net.minecraft.server.v1_8_R1.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:50) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at net.minecraft.server.v1_8_R1.PacketPlayInBlockPlace.a(PacketPlayInBlockPlace.java:80) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_25]
        at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_25]
        at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:683) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:623) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:526) [spigot.jar:git-Spigot-47b1dff-f233e7d]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_25]
    Caused by: org.bukkit.command.CommandException: Unhandled exception executing 'effect @p regeneration 5 5 false' in org.bukkit.craftbukkit.v1_8_R1.com
    mand.VanillaCommandWrapper(effect)
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:148) ~[spigot.jar:git-Spigot-47b1dff-f233e7d]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:645) ~[spigot.jar:git-Spigot-47b1dff-f233e7d]
        at com.gmail.zariust.otherdrops.event.DropRunner.processCommands(DropRunner.java:423) ~[?:?]
        at com.gmail.zariust.otherdrops.event.DropRunner.run(DropRunner.java:93) ~[?:?]
        at com.gmail.zariust.otherdrops.SectionManager.scheduleDrop(SectionManager.java:417) ~[?:?]
        at com.gmail.zariust.otherdrops.SectionManager.performDrop(SectionManager.java:153) ~[?:?]
        at com.gmail.zariust.otherdrops.listener.OdPlayerListener.onPlayerInteract(OdPlayerListener.java:68) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ~[spigot.jar:git-Spigot-47b1dff-f233e7d]
        ... 17 more
    Caused by: java.lang.ClassCastException: com.gmail.zariust.otherdrops.PlayerWrapper cannot be cast to org.bukkit.craftbukkit.v1_8_R1.entity.CraftPlayer
        at org.bukkit.craftbukkit.v1_8_R1.command.VanillaCommandWrapper.getListener(VanillaCommandWrapper.java:129) ~[spigot.jar:git-Spigot-47b1dff-f233e7d]
        at org.bukkit.craftbukkit.v1_8_R1.command.VanillaCommandWrapper.execute(VanillaCommandWrapper.java:41) ~[spigot.jar:git-Spigot-47b1dff-f233e7d]
        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:141) ~[spigot.jar:git-Spigot-47b1dff-f233e7d]
        at org.bukkit.craftbukkit.v1_8_R1.CraftServer.dispatchCommand(CraftServer.java:645) ~[spigot.jar:git-Spigot-47b1dff-f233e7d]
        at com.gmail.zariust.otherdrops.event.DropRunner.processCommands(DropRunner.java:423) ~[?:?]
        at com.gmail.zariust.otherdrops.event.DropRunner.run(DropRunner.java:93) ~[?:?]
        at com.gmail.zariust.otherdrops.SectionManager.scheduleDrop(SectionManager.java:417) ~[?:?]
        at com.gmail.zariust.otherdrops.SectionManager.performDrop(SectionManager.java:153) ~[?:?]
        at com.gmail.zariust.otherdrops.listener.OdPlayerListener.onPlayerInteract(OdPlayerListener.java:68) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_25]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_25]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_25]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ~[spigot.jar:git-Spigot-47b1dff-f233e7d]
        ... 17 more

I've been testing with other commands, from plugins and they seem to work fine, only using any vanilla command gives a similar error. (I don't know java very well, so i couldn't extrapolate the issue here)