Uploaded image for project: 'SpigotPlugins'
  1. SpigotPlugins
  2. PLUG-370

dropping items fires interact event

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • None
    •  CraftBukkit version git-Bukkit-9820cd2
    • just my tester plugin
    • Yes

      So we found an issue in another plugin, and after further testing realized this was a Spigot/CB issue.

      The player interact event is fired when you drop an item, whilst not looking at a block (ie: looking up at the sky)
      If you are focused on a block (where you can see the block's hitbox) the interact event will not fire.

      Simple code for testing:

      @EventHandler
      private void onClick(PlayerInteractEvent event) {
          Bukkit.broadcastMessage("Player interacted");
      }
      
      @EventHandler
      private void onDrop(PlayerDropItemEvent event) {
          Bukkit.broadcastMessage("Player dropped");
      }
      

      Tested this on CraftBukkit and Spigot

      Focused on a block, dropping an item:

      Looking up at the sky dropping an item:

      Included a little tester plugin.

            Unassigned Unassigned
            ShaneBee Shane Bee
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: