[SPIGOT-764] Can't cancel spawn eggs with setUseItemInHand in PlayerInteractEvent Created: 03/Apr/15  Updated: 23/May/15  Resolved: 23/May/15

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Mike Dueck Assignee: Unassigned
Resolution: Fixed Votes: 1
Labels: None


 Description   

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.



 Comments   
Comment by SpigotMC [ 03/Apr/15 ]

Your build is not the latest and therefore may be the reason you are having this issue. Spigot is 0 version(s) behind. CraftBukkit is 1 version(s) behind. This message was automatically generated and is not guaranteed to be a solution to your issue.

Generated at Sat Dec 13 15:20:48 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.