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

PlayerInteractEvent double firing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Minor Minor
    • None
    • None
    • None
    • CraftBukkit version 3857-Spigot-94e187b-8ef7afe (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT)
    • Spigot API
    • Yes

      NOTE: THIS HAS NOTHING TO DO WITH EVENT FIRING ONCE FOR EACH HAND (MAIN AND OFF_HAND). LOOK AT THE VIDEO AND DESCRIPTION AND YOU WILL REALISE WHY.

      Link to a video of the issue: Link

      Details of the issue:

      So, when player equips armor using right click while looking at the air, PlayerInteractEvent fires.

      Since the player is using right click, event.getAction() == ActionType.RIGHT_CLICK_AIR (event.getHand() == HAND (main hand)).

      The problem is that after that event fires, another one fires where ActionType is LEFT_CLICK_AIR (event.getHand() == HAND (main hand)).

      Also, if player is equiping armor from off_hand, first event that fires is ActionType.RIGHT_CLICK_AIR (event.getHand() == OFF_HAND (off hand)), but the second event also fires where ActionType is LEFT_CLICK_AIR using event.getHand() == HAND (main hand).

      So we can conclude that when equiping armor while looking in the air (NOT BLOCK) the first event that fires is normal, but is always followed by a second event that is completely wrong (in both cases that event is LEFT_CLICK_AIR using HAND (main hand)).

      Screenshots show what I described above, just as video does.

      Plugin that can be used for reproduction of the bug is also in the attached files. Just hop onto the server, give yourself any type of armor that can be equiped by right clicking (diamond leggings for example) and put it in your main hand. Then equip that armor by right clicking. You will see that event fires twice, both times for main hand.

       

            Unassigned Unassigned
            VenomTS Adrovic Adnan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: