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

PlayerInteractEvent execution does not align with Javadocs description

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • Latest spigot build (built with buildtools at 15.11.2018 minutes before creating this ticket) version description Jenkins Build 1953, buildtools version 75

      Java 8

    • 1.13.2
    • Yes

      As javadocs of the PlayerInteractEvent describe "This event will fire as canceled if the vanilla behavior is to do nothing (e.g interacting with air)", the description does not hold true.

      When clicking a side of a block with a flower etc., the event will be fired as uncancelled, thus leading to unwanted behavior.

      Video demonstrating the issue https://www.youtube.com/watch?v=565xW9wtpRA

      @EventHandler
      public void onPlayerInteract(PlayerInteractEvent event) {
          Bukkit.broadcastMessage("Cancelled: " + event.isCancelled());  
      }
      

      Minimal reproduction plugin attached.

            Unassigned Unassigned
            Nuubles Nuubles
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: