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

PlayerInteractEvent being called twice when using minecarts

XMLWordPrintable

      If a minecart is placed on a rail, any PlayerInteractEvents are called twice. If "event.setCancelled(true)" is called in the second iteration, it also cancels the first.

      I have attached a screenshot of what happens after clicking once on rails with a minecart. The code for which is simply:

      @EventHandler(priority = EventPriority.LOWEST)
      public void onPlayerInteract(PlayerInteractEvent event)
      {
         Player player = event.getPlayer();
         Block block = event.getClickedBlock();
         if (event.getAction().equals(Action.RIGHT_CLICK_BLOCK))
         {
            player.sendMessage("Event called");
         }
      }

            Unassigned Unassigned
            KingDragonRider Ryan Barry
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: