Can interact with entities and block entities through other entity hitboxes under certain circumstances
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
2017-06-08, 01:26 AM
2024-01-25, 01:47 PM
2024-01-25, 01:47 PM
7
7
block, entity, hitbox, hovering, interaction
-