mojira.dev
MC-118394

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:

  1. Load the following datapack into your world:

[media]
  1. Press the button in their respective marked orders on the signs

  2. Stand inside the 1st armor stand's hitbox (The oldest entity)

  3. Look straight forward to the second armor stand

  4. Right click the chest
    → ❌ You are only able to open the chest

  5. Stand inside the second armor stand (The second oldest entity)

  6. Look straight forward to the first armor stand

  7. Right click the chest
    → ✔ You cannot open the chest

  8. Aim your cursor where the slime's hitbox and chest meet

    [media]
  9. Right click
    → ❌ You can open the chest

Screenshots/Videos:

[media]

Notes:

  1. 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.

  2. Turning on entity hitboxes helps reproducing this issue. (F3 + B)

Code Analysis:

(From @unknown)
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:

  1. Closest entity intersecting with player's eye level

  2. If no entity intersecting with player's eye level exists closest entity in ray from player's eyes

Linked issues

Attachments

Comments 6

@@unknown I changed the report a little bit to make it hopefully easier and faster to read. I hope you are fine with that. Feel free to improve it as well if you want.

You cannot select older versions because they are archived. This is probably the case to prevent people from reporting bugs for older versions.

@Marcono1234 I was meaning to get around to responding to this way sooner, but yeah I'm fine with the edit, haha. Changed "a little" is an understatement though XD That said, I like your edit much better, it's a lot more concise (I tend to have a bad habit of writing more than is probably necessary sometimes).

Just made a few edits myself on the things that were bugging me a little, as well as updated the versions to include the latest 1.13 snapshot (17w50a).

Confirmed for 1.13.1.

Can confirm in 21w06a

Can confirm. I'd like to request ownership of this issue to update the description with a structure file for ease of reproducing the issue, and to maintain it going forward.

This describes MC-260305; while this is older, that one got priority assigned and is easier to find.

Remin

[Mod] Jingy

(Unassigned)

Confirmed

Hitboxes

block, entity, hitbox, hovering, interaction

Minecraft 1.12, Minecraft 17w50a, Minecraft 18w20c, Minecraft 1.13.1, 21w06a, ..., 23w44a, 1.20.3, 1.20.4 Release Candidate 1, 1.20.4, 23w51b

Retrieved