-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
None
-
None
-
3042-Spigot-a25e8ed-3512408 (MC: 1.16.5)
-
Yes
When throwing a snowball or an enderpearl by right-clicking air, the event is fired both for Action RIGHT_CLICK_AIR and LEFT_CLICK_AIR.
I don't know if that's intended, it's at least confusing as obviously no left click is involved.
This also happens in CraftBukkit version 3042-Bukkit-3512408.
How to reproduce (.jar included as attachment):
package de.jeff_media.jira.spigot6421; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.EquipmentSlot; import org.bukkit.plugin.java.JavaPlugin; public class Main extends JavaPlugin implements Listener { @Override public void onEnable() { getServer().getPluginManager().registerEvents(this,this); } @EventHandler public void onInteract(PlayerInteractEvent event) { if(event.getHand() == EquipmentSlot.HAND) { event.getPlayer().sendMessage(event.getAction().name()); } } }
Then throw a snowball in the air. It will print both RIGHT_CLICK_AIR and LEFT_CLICK_AIR. With "normal" items, it only prints RIGHT_CLICK_AIR as expected.
- duplicates
-
SPIGOT-5435 Hand calls twice PlayerInteractEvent when using potions
- Resolved