PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
9.98k stars 2.31k forks source link

PlayerInteractEvent and Action.LEFT_CLICK_AIR does not trigger #10330

Closed N0rth88 closed 7 months ago

N0rth88 commented 7 months ago

Expected behavior

It is necessary that the event is successfully fired and the spectators do not prevent it

Observed/Actual behavior

PlayerInteractEvent and Action.LEFT_CLICK_AIR does not trigger when a player presses the Light Mouse Click while another player in spectator mode is in the direction of his gaze. This event is not called. This problem did not occur on spigot 1.16.5

Steps/models to reproduce

`@EventHandler private void openMenu(PlayerInteractEvent e) { if (e.getAction() == Action.LEFT_CLICK_AIR e.getAction() == Action.LEFT_CLICK_BLOCK) { if (e.getHand() == EquipmentSlot.HAND) { Player p = e.getPlayer(); if (p.getGameMode().equals(GameMode.SURVIVAL)) { if (ClassesGui.getBlueNecromant().contains(p.getName())
                        ClassesGui.getRedNecromant().contains(p.getName())) {
                    if (p.getInventory().getItemInMainHand().getType() == Material.BOOK) {
                    //code..`

Plugin and Datapack List

AdvancedBan, AntiPopup, CTF, LibsDisguises, LuckPerms, ProtocolLib

Paper version

1.19.4

Other

No response

Warriorrrr commented 7 months ago

Unable to reproduce this in 1.20.4, please re-test on the latest version.