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

Cancelling PlayerInteractAtEntityEvent doesn't cancel villager trading menu

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Version 1.12.2, Spigot.

      When cancelling a PlayerInteractAtEntityEvent when clicking on a villager, the trading menu still opens. I assume this is incorrect behaviour as the setCancelled method, should cancel the event like nothing happened.

      Here is the code I used to test this:

      @EventHandler(priority = EventPriority.MONITOR)
      public void onPlayerInteractAtEntity(PlayerInteractAtEntityEvent e) {
        System.out.println("Cancelled");
        e.setCancelled(true);
      }

      "Cancelled" does appear in the console, but the trading menu still opens.

            Unassigned Unassigned
            stefvanschie Stef van Schie
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: