-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
None
-
Minecraft 1.15.2, Spigot 1.15.2
-
CraftBukkit version git-Spigot-99063f-be6aaf0 (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)
-
Yes
Hello,
I have created a plugin (attached) that reproduces what I believe to be a bug. Whenever I call the PlayerDropItemEvent, it seems to sometimes call the PlayerInteractEvent LEFT_CLICK_AIR action. In Minecraft, if I am looking in the air (not at a block that is close enough to break) and I drop an item, the PlayerInteractEvent is fired in addition to the PlayerDropItemEvent. In the reproduction plugin of the bug, I have the following code in the main class:
public void onEnable() { PluginManager pm = getServer().getPluginManager(); pm.registerEvents(this, this); } @EventHandler public void gunUseEvent(PlayerInteractEvent event) { Action action = event.getAction(); Player player = event.getPlayer(); player.sendMessage("Action: " + action); } @EventHandler public void onItemDrop(PlayerDropItemEvent event) { Player player = event.getPlayer(); player.sendMessage("dropped"); }
gunUseEvent is what one of the methods is called in my actual plugin. Whenever I am looking at air in Minecraft and drop an item, my chat output is:
dropped
Action: LEFT_CLICK_AIR
And when I look at the ground, my chat output is:
dropped
In addition, in my actual plugin, if I am right clicking with a my gun item (which shoots it), every once and a while the LEFT_CLICK_AIR action will be thrown (causing the gun to be in scope mode) - without even left clicking. I'm guessing these bugs (if they are bugs) are somehow linked.
Hopefully that is enough detail to get this figured out and hopefully I am not just misunderstanding how these events work. Thanks for taking a look at this and God bless!
- duplicates
-
SPIGOT-5632 Dropping an item while targetting air causes a PlayerInteractEvent
- Resolved