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

Can't cancel spawn eggs with setUseItemInHand in PlayerInteractEvent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • None
    • None
    • None

      If you try to cancel the use of a spawn egg in the PlayerInteractEvent, the only way to cancel it is by cancelling the event, or canceling the use of the block.

      You should be able to cancel it with setUseItemInHand, since you are using an item in your hand.

      Cancelling the "block use" or whole event means players can't interact with blocks that have right click events, such as crafting tables, furnaces, etc.

      Sure, there are work-arounds (untested) such as checking that the block has no right click event before cancelling the event (since they will open the block first, before using the item). But we shouldn't have to use work-arounds on things that should work as expected.

            Unassigned Unassigned
            TrashCaster Mike Dueck
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: