-
Bug
-
Resolution: Duplicate
-
Minor
-
None
-
None
-
None
-
3635-Spigot-d90018e-941d7e9 (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT)
-
Yes
To start, Minecraft has two different reaches when you are in survival mode: an attack reach (3 blocks) and a building reach (4.5 blocks). You can see this here https://minecraft.fandom.com/wiki/Player#Reach. However, the code in PlayerConnection.patch (near line 1164) for detecting a PlayerInteractEvent with Action.LEFT_CLICK_AIR checks to see if either an entity or a block is within 4.5 blocks. This means that if a Survival player left clicks at an entity who is outside of its attack reach but still within 4.5 blocks, neither a PlayerInteractEvent nor a EntityDamageByEntityEvent will be called. This seems like unintended behavior because the player actually is left clicking the air.
I've also included a plugin that messages the player when the PlayerInteractEvent is triggered and when the EntityDamageByEntityEvent is triggered (by the player). To recreate this issue:
- load the provided plugin
- set your gamemode to survival
- find an entity
- left click at the entity while you are further than 3 blocks away from it, but closer than 4.5 blocks from it
You will see that the entity is not damaged and that the interact event is not called.
- duplicates
-
SPIGOT-7073 PlayerInteractEvent doesn't fire if player were to left click a block, but an entity is blocking it
- Open