-
Bug
-
Resolution: Duplicate
-
None
-
Minecraft 1.12, Minecraft 17w50a, Minecraft 18w20c, Minecraft 1.13.1, 21w06a, 21w07a, 1.20.2, 23w44a, 1.20.3, 1.20.4 Release Candidate 1, 1.20.4, 23w51b
-
Confirmed
-
Hitboxes
The bug
The player can interact with entities and tile entities while inside of an entities hitbox under some circumstances.
How to Reproduce:
- Load the following datapack into your world:
hitbox_collision.nbt - Press the button in their respective marked orders on the signs
- Stand inside the 1st armor stand's hitbox (The oldest entity)
- Look straight forward to the second armor stand
- Right click the chest
→ You are only able to open the chest - Stand inside the second armor stand (The second oldest entity)
- Look straight forward to the first armor stand
- Right click the chest
→ You cannot open the chest - Aim your cursor where the slime's hitbox and chest meet
- Right click
→ You can open the chest
Screenshots/Videos:
Notes:
- This issue also applies to things such as the attack indicator. When following the same steps listed above, instead of trying to right click a chest, if you hold a tool or weapon instead the observed results will be an inconsistent and unreliable display of the attack indicator.
- Turning on entity hitboxes helps reproducing this issue. (F3 + B)
Code Analysis:
(From Remin)
Based on 1.11.2 decompiled using MCP 9.37
The method net.minecraft.client.renderer.EntityRenderer.getMouseOver(float) does not consistently define which entity should preferred. Expected would be probably:
- Closest entity intersecting with player's eye level
- If no entity intersecting with player's eye level exists closest entity in ray from player's eyes
- duplicates
-
MC-260305 Interacting with wrong entity when inside entity
- Open