Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-3049

Left and Right click PlayerInteractEvent fire when opening door

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • None

      If you right-click on a door near the doorknob part, both a left and right click interact event fire.

      Set up

      Place a door and close it. Put cursor on door handle and right-click. You will get two PlayerInteractEvents, one for right click followed by one for left click. This does not seem to happen if you open the door at the hinges instead.

      Test plugin is available here: https://github.com/NathanWolf/Bukkit-Unit-Tests/tree/InteractEvents (Make sure to use the InteractEvents branch)

      Test plugin output

      INTERACT: RIGHT_CLICK_BLOCK on WOODEN_DOOR
      INTERACT: LEFT_CLICK_AIR on NOTHING

      Stack trace from two events

      First (right-click) event:

      [20:11:55 WARN]: java.lang.Exception: Stack trace
      [20:11:55 WARN]: at java.lang.Thread.dumpStack(Thread.java:1329)
      [20:11:55 WARN]: at com.elmakers.mine.bukkit.magic.listener.PlayerController.onPlayerInteract(PlayerController.java:363)
      [20:11:55 WARN]: at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
      [20:11:55 WARN]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [20:11:55 WARN]: at java.lang.reflect.Method.invoke(Method.java:498)
      [20:11:55 WARN]: at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302)
      [20:11:55 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
      [20:11:55 WARN]: at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
      [20:11:55 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
      [20:11:55 WARN]: at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:232)
      [20:11:55 WARN]: at net.minecraft.server.v1_11_R1.PlayerInteractManager.a(PlayerInteractManager.java:444)
      [20:11:55 WARN]: at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:904)
      [20:11:55 WARN]: at net.minecraft.server.v1_11_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:37)
      [20:11:55 WARN]: at net.minecraft.server.v1_11_R1.PacketPlayInUseItem.a(PacketPlayInUseItem.java:1)
      [20:11:55 WARN]: at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13)
      [20:11:55 WARN]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      [20:11:55 WARN]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      [20:11:55 WARN]: at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46)
      [20:11:55 WARN]: at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:747)
      [20:11:55 WARN]: at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399)
      [20:11:55 WARN]: at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:678)
      [20:11:55 WARN]: at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:576)
      [20:11:55 WARN]: at java.lang.Thread.run(Thread.java:745)

      Second (left-click) event:

      [20:11:50 WARN]: java.lang.Exception: Stack trace
      [20:11:50 WARN]: at java.lang.Thread.dumpStack(Thread.java:1329)
      [20:11:50 WARN]: at com.elmakers.mine.bukkit.magic.listener.PlayerController.onPlayerInteract(PlayerController.java:363)
      [20:11:50 WARN]: at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
      [20:11:50 WARN]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      [20:11:50 WARN]: at java.lang.reflect.Method.invoke(Method.java:498)
      [20:11:50 WARN]: at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302)
      [20:11:50 WARN]: at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
      [20:11:50 WARN]: at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
      [20:11:50 WARN]: at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
      [20:11:50 WARN]: at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:232)
      [20:11:50 WARN]: at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:199)
      [20:11:50 WARN]: at org.bukkit.craftbukkit.v1_11_R1.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:195)
      [20:11:50 WARN]: at net.minecraft.server.v1_11_R1.PlayerConnection.a(PlayerConnection.java:1382)
      [20:11:50 WARN]: at net.minecraft.server.v1_11_R1.PacketPlayInArmAnimation.a(PacketPlayInArmAnimation.java:24)
      [20:11:50 WARN]: at net.minecraft.server.v1_11_R1.PacketPlayInArmAnimation.a(PacketPlayInArmAnimation.java:1)
      [20:11:50 WARN]: at net.minecraft.server.v1_11_R1.PlayerConnectionUtils$1.run(SourceFile:13)
      [20:11:50 WARN]: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      [20:11:50 WARN]: at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      [20:11:50 WARN]: at net.minecraft.server.v1_11_R1.SystemUtils.a(SourceFile:46)
      [20:11:50 WARN]: at net.minecraft.server.v1_11_R1.MinecraftServer.D(MinecraftServer.java:747)
      [20:11:50 WARN]: at net.minecraft.server.v1_11_R1.DedicatedServer.D(DedicatedServer.java:399)
      [20:11:50 WARN]: at net.minecraft.server.v1_11_R1.MinecraftServer.C(MinecraftServer.java:678)
      [20:11:50 WARN]: at net.minecraft.server.v1_11_R1.MinecraftServer.run(MinecraftServer.java:576)
      [20:11:50 WARN]: at java.lang.Thread.run(Thread.java:745)

            Unassigned Unassigned
            NathanWolf Nathan Wolf
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: